Lotus V2 resource calibration
On this page
- The recommendation
- Freeze gates
- Inputs
- 1. What one cu is worth
- 2. What was measured
- 3. The primitive schedule
- 4. L(tx) and C_envelope
- 5. The transaction knee
- 6. The block burn floor
- 6b. The worst block for each budget
- 7. The EMA: w and E_0
- 8. Integer safety
- 9. Differences from the development profile and the lotusd toy values
- 10. Where P05 and P03 needed reading
- 11. What to freeze if the gates do not close
- 12. Open questions for the owner
- 13. What this does not establish
- Reproduce
Status: recommended, awaiting owner sign-off; not yet freezable (2026-11-12, revised after independent review). This note proposes numbers for D08 (P05): the primitive cost-unit (cu) schedule, the transaction cost L(tx), the block envelope cost, the EMA and the block burn floor. It does not freeze them, and it changes no normative file. The shifts, the EMA and the integer rules are ready for sign-off. The cu schedule is not: four freeze gates must be closed or explicitly waived first, and section 11 gives the fallback. Every number below can be rebuilt with one command (see Reproduce). All measurements come from one machine, an Apple M5 Max.
The recommendation
| Constant | Recommended | Development profile | lotusd toy values | Section |
|---|---|---|---|---|
| What 1 cu is worth | 1 wire byte = 100 ns of one M5 Max core; every CPU weight is ⌈1.5 × measured time ÷ 100 ns⌉ | uncalibrated test weights | none | 1 |
CHECKSIG, CHECKSIGVERIFY, CHECKDATASIG BIP340 (0) and ECDSA secp256k1 (3) |
210 cu, signing preimage included | 50,000 | 3 | |
CHECKDATASIG ECDSA P-256 (1) |
620 cu | 50,000 | 3 | |
CHECKDATASIG Ed25519 (2) |
49,200 cu, the verifier as built; lower only after an equivalent verifier is measured (gate 2) | 50,000 | 2 | |
| Hash opcodes | BLAKE3 2 + 11/KiB; SHA256 3 + 5/KiB; HASH256 4 + 5/KiB; LEAFHASH 2 + 14/KiB; NODEHASH 3; MERKLEROOT 3 + 2 per step (4 for HASH256) | 64 + 1/byte | 3 | |
| Other VM opcodes | per-opcode table in resources.py; default 1 + 1 per KiB of operands and of result; size terms per KiB, not per byte |
1 + 1/byte | 3 | |
ENFORCEOUTPUT |
2 cu + 1 cu per transaction output | 1 + 1/byte, 5 per output (test value) | 3 | |
| Per invocation | 6 cu setup, counted toward MAX_INVOCATION_COST, plus the unchanged 1 cu per script byte |
1 cu per script byte | 3 | |
| Outer hashing | 1 cu per 64-byte block, 64 bytes reserved for the tag | 1 + 1 per byte, 64 reserved | 4 | |
| Storage | 64 cu per resolved coin and per state-key update, plus 1 cu per resolved coin byte | 1 per coin byte | 4 | |
| State-key CPU | 87 cu per key (27 levels); covers the in-memory tree only (gate 3) | 27 hashes per byte | 4 | |
| L(tx) of a 1-in/2-out payment | 1,179 cu (251 wire bytes) | 65,029 cu | 443 cu (stand-in bytes + 64·(in+out)) |
4 |
C_envelope for N transactions |
148 + F + 7N cu (F = frame-prefix bytes) | 138 + F + N² + N + 130(2N−1) + 722 | 138 + 64N | 4 |
S_tx_knee |
18 (2^18 = 262,144 cu) | 17 | 16 | 5 |
w |
10 (1,024 blocks, 34 hours) | 10 | 2 | 7 |
E_min |
2^34 = 17,179,869,184 cu | 65,536 | 4 | 6 |
E_0 |
= E_min | = E_min | 4 | 7 |
S_linear |
32 | 64 | 32 | 6 |
S_quad |
32 | 32 | 60 | 6 |
MAX_INVOCATION_COST (not in the brief; suggested) |
2^22 = 4,194,304 cu | 100,000,000 | 8 | |
| Byte margin (proposed P05 change) | 2 cu per wire byte, if the owner accepts changing C24's "1 wire byte = 1 cu"; otherwise 1 | 1 | 1 | 6b |
What these numbers do. A payment costs 1,179 cu, about 4.7 cu per byte. At the recommended fee floor of 100,000 atoms/kB, users pay only the byte fee (25,100 atoms, a twentieth of a cent at 2 cents per XPI) at every load up to the 100,000 tx/s design target. Above it, fees rise with load. On a quiet chain, a single block twice the design size must burn 305,000 XPI, two launch block subsidies. A coinbase-only block stays affordable from the smallest tail subsidy at every EMA that can be reached by burning everything that can be issued in 16,000 years. Every product fits in u128 once blocks of 2^64 cu or more are rejected; such blocks cannot be paid for anyway.
What they do not do, and why the schedule is not yet freezable:
- One cu is one number, but a validator has four budgets: CPU, state-tree updates, bandwidth and storage reads. A design-size block's cu is 2.98 times any single budget's 120-second capacity, because an ordinary payment uses all of them at once. A block that spends the same cu on one resource overloads that resource. The worst block a miner can buy by giving up one launch subsidy takes the reference validator 272 s of CPU or 416 s of bandwidth (section 6b).
- The 100,000 tx/s design load is reachable only with code that does not exist yet. It needs the state tree updated on several cores, and its branch nodes in RAM. lotusd's state store updates the tree on one thread, at 25 µs per key in this measurement. It carries about 6,700 tx/s on the reference validator. A launch-subsidy block made of many-output transactions would take it over an hour to validate under the recommended weights (section 1).
Freeze gates
The cu schedule should not be frozen until each of these is done, or the owner explicitly waives it.
- An x86 server run of the harness. The factor of 2 between an M5 Max core and a reference-server core is an estimate. Every CPU weight depends on it.
- A measured Ed25519 verifier that is equivalent to the strict verifier, with the vector set in Ed25519, before profile 2 is priced below 49,200 cu.
- A demonstration of design-load state validation: a block's state-tree updates done in parallel (or fast enough on one thread), with branch nodes in RAM or the cold reads measured, at 10^8 coins. Until then the 87 cu per-key CPU charge covers the in-memory tree, not the store lotusd ships.
- A decision on the bandwidth margin (section 6b): a byte margin, a separate byte budget, or accepting a 416-second worst block.
Inputs
| Input | Value | Source |
|---|---|---|
| Measurement machine | Apple M5 Max, 18 cores (6 super, 12 performance), 48 GiB, macOS 26.6; one core per measurement | daemon/docs/evidence/resource-calibration/ |
| Code measured | src/lotus_v2 of lotusd 080ad66f2c, exported read-only, built -O2 -DNDEBUG as the daemon's RelWithDebInfo build; libsecp256k1, the Bitcoin crypto libraries and LevelDB from daemon/.build/v2; OpenSSL 4.0.3 |
harness/ in the evidence directory |
| Issuance | Set A: block 1 pays 150,378 XPI; the end of year 4 about 55,384 XPI; the genesis tail 378 XPI; the tail floor 94.5 XPI; reserve R_0 157.3 billion XPI; T_max 12,096 XPI | issuance calibration |
| Fee floors simulated | 100,000 atoms/kB (recommended by the issuance note) and 1,000 atoms/kB (the spec today); 1 XPI = 10^6 atoms | owner has not chosen |
| Prices | 0.002, 0.02 and 0.2 dollars per XPI | brief |
| Design load | 100,000 tx/s of 1-in/2-out payments: 12,000,000 per 120-second block | brief, D11 |
| Typical transaction | 1-in/2-out native payment from a bare-key script PUSH32(key) CHECKSIG (not an address type), one 64-byte signature, two 45-byte outputs; 251 bytes. The standard payment uses the type-1 keyhash address (addresses, 37-byte program, arguments signature and key): 287 bytes, L = 1,529, C_tx = 1,537 under the approved schedule |
P01 grammar; matches the issuance note's 250-byte payment |
1. What one cu is worth
P05 fixes 1 wire byte = 1 cu and leaves open how much computation a cu buys. That exchange rate is the anchor for every other weight, so it must come from a stated machine.
The reference validator is a modest server: 8 cores, a 1 Gbit/s link and local NVMe storage. Its cores are assumed to run these kernels at half the speed of an M5 Max super core. That factor is an estimate (gate 1): libsecp256k1 verifies in about 11 µs here and is reported at roughly 20–25 µs on current x86 server cores, but this was not measured. Each of its three budgets is turned into cu per second the same way, so that a block which fills any one of them has the same cu:
| Resource | Reference budget | cu per second | So one unit costs |
|---|---|---|---|
| Bandwidth | 40 MB/s of new chain data (a third of 125 MB/s; the rest relays to peers) | 40,000,000 | 1 byte = 1 cu (P05's definition) |
| CPU | 8 cores × ½ M5 speed = 4 M5-core-seconds per second | 40,000,000 | 1 cu = 100 ns of M5 Max core time |
| Storage reads | 625,000 random reads per second from local NVMe | 40,000,000 | 1 read = 64 cu |
Every CPU weight is then ⌈1.5 × measured M5 time ÷ 100 ns⌉. The factor 1.5 is the margin P05 asks for. It covers measurement noise (a repeat run moved the median row by 1.6% and the largest by 7.6%), differences between ARM and x86 in individual kernels, and operands the benchmark did not hit. Bytes carry no margin: 1 byte is 1 cu by definition.
The design load, and what it requires
A payment takes about 31.5 µs of M5 time: 13.9 µs for its CHECKSIG (with the signing preimage), 2.8 µs to prepare the transaction (identities and roots), and 14.8 µs for three state-tree updates at 4.9 µs each. 4.9 µs is the in-memory tree extrapolated to 10^8 keys. The previous version of this note counted all of that as CPU spread over 8 cores and priced storage at one read per key. Those two assumptions do not match the code, and they do not match each other: the CPU figure treats the tree as in memory, while the read figure treats each key as one cold read.
Stated plainly, 100,000 tx/s needs all of the following:
- The state tree updated on about 3 or more cores. lotusd's
IncrementalUtxoSetandDiskStateStoreupdate the tree on one thread.DiskStateStoreonly prepares keys and leaf hashes in parallel. 36 million key updates per block at 4.9 µs, on a reference core twice as slow, take 355 s: 296% of the block interval. - The tree's branch nodes in RAM, so that each key update costs one storage read (the leaf). At 10^8 coins that is on the order of 10^8 branch nodes, likely 10–20 GB with index overhead (an estimate; not measured). Each uncached level adds one read per key. With three uncached levels a payment needs 13 reads instead of 4, and storage runs at 208% of its budget.
- A store whose per-key cost is close to the in-memory tree.
DiskStateStoreas built took 25 µs per key at 1 million coins, with 7.1 database reads per key, all from the page cache. That is five times the in-memory tree. The run was made with the machine heavily loaded by other work, so it should be repeated, but the gap is too large to be noise.
| Design-load check (100,000 tx/s of payments) | CPU | Tree (one thread) | Bandwidth | Reads | Load at which the busiest budget is full |
|---|---|---|---|---|---|
| Tree on 8 cores, branch nodes in RAM | 79% | 63% | 64% | 126,900 tx/s | |
| Tree on one thread (the code as built), in-memory tree | 42% | 296% | 63% | 64% | 33,800 tx/s |
Tree on one thread, DiskStateStore as built |
42% | 1,498% | 63% | 64% | 6,700 tx/s |
DiskStateStore as built, on 8 threads |
63% | 64% | 43,700 tx/s | ||
| Tree on 8 cores, three uncached tree levels | 79% | 63% | 208% | 48,100 tx/s |
Without those changes the design load is about 6,700 tx/s on the reference validator with the store lotusd ships, or 33,800 tx/s with the in-memory tree on one thread. Schnorr batch verification (6.7 µs per signature in batches of 8,192, measured) is extra CPU headroom. It is not priced in, because a failed batch falls back to single checks.
Alternatives. At 50 ns per cu every CPU weight doubles, and CPU-heavy scripts pay twice as much relative to bytes. At 200 ns they halve. Either choice moves only the CPU weights; the shifts in section 6 are set against block cost in cu and would be refitted in the same way.
2. What was measured
All times are medians of seven trials on one M5 Max core. The full rows are in bench_cu.tsv, bench_ctx.tsv, bench_disk.tsv and bench_mdbx.tsv; bench_cu-repeat.tsv repeats the hash, signature and VM rows.
| Operation | Time | Note |
|---|---|---|
| BIP340 verify, libsecp256k1, parsed key | 11.3 µs | 13.3 µs with key parsing |
CHECKDATASIG BIP340 through the VM |
13.9 µs | the whole EvaluateVm call |
CHECKSIG of a bare-key spend (PUSH32(key) CHECKSIG), with its signing preimage, on a prepared transaction |
13.9 µs | EvaluateVmWithContext; 256 outputs make no difference |
CHECKDATASIG ECDSA secp256k1 / P-256 |
13.6 / 41.3 µs | P-256 through OpenSSL EVP, as the VM calls it |
CHECKDATASIG Ed25519 (the VM's strict verifier) |
3,276 µs | see Ed25519 |
| BIP340 batch, per signature | 10.7 / 7.7 / 6.7 µs | batches of 64 / 1,024 / 8,192, one thread |
| Transaction preparation, 1-in/2-out / 1-in/256-out | 2.8 / 76.9 µs | identities, roots and field sizes, once per transaction |
EvaluateVm, one argument, DROP ONE |
337 ns | the fixed cost of an invocation |
Introspection read with its push and DROP |
66–94 ns | OUTPUTVALUE, OUTPUTRECORD, UTXOOUTPUT, UTXOVALUE, TXTOKENBALANCE |
ENFORCEOUTPUT template scan |
about 3 ns per transaction output | default template, 1 to 256 outputs |
OP_SUCCESS scan |
about 3 ns per script byte | 8,190 DROP bytes, then a success pair |
Loop iteration (ENUMERATE index and DROP) |
17 ns | 65,536 iterations |
| Tagged BLAKE3, 0 / 67 / 130 bytes | 57 / 100 / 143 ns | about 43 ns per 64-byte compression |
| BLAKE3 / SHA256, 8 KiB | 3.1 / 2.4 µs | 2.6 and 3.4 GB/s |
In-memory sparse tree (IncrementalUtxoSet), one insert or erase with its share of the root |
3.0 µs at 1M keys, 3.6 µs at 4M | about 4.9 µs extrapolated to 2^27 keys |
DiskStateStore, one insert or erase in a 200,000-key block, with commit |
25.0 µs at 1M coins | one thread; 7.1 database reads per key; commit is 14.6 µs of it; heavy machine load during the run |
| MDBX point read, file in page cache | 0.40 µs at 1M coins, 0.64 µs at 10M | the vendored libmdbx that DiskStateStore uses; not a cold read |
MUL 1024 × 1024 bytes |
15 µs | |
LOG 1,024 bytes |
709 µs | 64 rounds, quadratic in limbs |
SQRT 1,024 bytes |
62 µs |
Cold storage was not measured. macOS cannot drop the page cache without root. The 40-million-coin MDBX run and the 4-million-coin DiskStateStore run both hit the 12 GiB memory guard. The 64 cu per read comes from the NVMe budget in section 1, not from this machine.
Ed25519
The VM's profile 2 verifier (vm.cpp lines 906–1126 at 080ad66f2c) does every field operation with OpenSSL BIGNUM, and runs four scalar multiplications: [S]B, [h]A, and [L]A and [L]R for the subgroup checks. It takes 3.3 ms, 237 times a BIP340 check, so the price that covers it is 49,200 cu (49,130 needed). That is the recommendation until gate 2 closes.
A faster verifier is likely possible, but it is only acceptable if it accepts and rejects exactly what this one does. It must reproduce P03 profile 2 as vm.cpp implements it:
- the encodings of A and R decode only when y < p;
- an encoding with x = 0 and the sign bit set is rejected;
- S < L;
- A and R are not the identity, and both lie in the prime-order subgroup (
[L]Pis the identity); - the equation is the uncofactored
[S]B = R + [h]A, with h = SHA512(R ‖ A ‖ message) mod L; - a malformed public key is an error; a malformed R, an out-of-range S, a failed subgroup check or a failed equation gives false. (lotusd then raises NULLFAIL for a nonempty signature; see section 10.)
Vector set: the "Taming the many EdDSAs" vectors (Chalkias, Garillot, Nikolaenko, 2020), plus all 19 non-canonical y values (p to 2^255 − 1) with both sign bits, used for A and, separately, for R. Each case must give the same result, error or false, as the BIGNUM verifier.
Library verifiers are not a reference for either the result or the time. OpenSSL's Ed25519 verify (36 µs here) runs neither subgroup check and accepts a different set. A dedicated curve25519 implementation of the strict profile has been estimated at about 100 µs. Neither that figure nor the 1,700 cu price in the earlier version of this note is measured. 1,700 cu is a budget of 113 µs at margin 1.5, only 1.13 times the estimate. If 1,700 cu were frozen with the current verifier, a design-size block of Ed25519 checks would take the reference validator about 6,200 seconds.
LOG on large operands is expensive but correctly bounded. 709 µs for a 1,024-byte operand is about 10,600 cu. P05's limb surcharge already makes the static charge quadratic, so the schedule covers it with 175 cu per KiB of surcharged operand.
3. The primitive schedule
Signatures
| Check | Measured (VM call less its 337 ns setup) | ⌈1.5 × t ÷ 100 ns⌉ | Recommended |
|---|---|---|---|
BIP340 (CHECKSIG with its preimage, CHECKSIGVERIFY, CHECKDATASIG 0) |
13.6 µs | 205 | 210 |
ECDSA secp256k1 (CHECKDATASIG 3) |
13.3 µs | 200 | 210 |
ECDSA P-256 (CHECKDATASIG 1) |
40.9 µs | 614 | 620 |
Ed25519 (CHECKDATASIG 2) |
3,275 µs as built | 49,130 | 49,200 until gate 2 |
CHECKDATASIG should be charged by its selector when the instruction just before it pushes a constant 0..3, and at the most expensive profile otherwise. P03 already says a nonconstant selector pays the maximum. The size pass already reads the preceding constant for NUM2BIN, PICK and loop bounds, so this uses the same mechanism. Without it, every BIP340 CHECKDATASIG would pay the Ed25519 price.
VM opcodes
Size-dependent charges are counted per KiB, not per byte:
charge = base + ceil((operand_kib × Σ operand bounds + result_kib × Σ result bounds) / 1024)
At 100 ns per cu, an integer coefficient of 1 cu per byte would price copying 8 KiB at 8,192 cu, when it takes 230 ns (4 cu). Per-KiB coefficients keep integers and stay within a few times of the measured cost. The charge is still a nondecreasing function of each operand bound, which is all P05 requires. P05's limb surcharges ((limbs_a·limbs_b − 1) × 16 bytes on MUL, DIV, MOD, MUL128_WIDE; (limbs² − 1) × 16 on LOG and SQRT) are added to the operand bytes first, unchanged.
The C++ VmOpcodeCost has per_operand_byte and per_result_byte; they would become per-KiB coefficients with one rounding at the end. That is the only structural change this schedule needs.
| Opcodes | base | operand cu/KiB | result cu/KiB | Fitted against |
|---|---|---|---|---|
| Default (stack moves, pushes, introspection, control) | 1 | 1 | 1 | dispatch 8–17 ns; DUP of 8 KiB 230 ns; DROP of 8 KiB 96 ns |
CAT; INVERT AND OR XOR; EQUAL(VERIFY); LESSSWAP |
1 | 0 / 1 | 1 | XOR 8 KiB 450 ns |
RAWLEFTBITSHIFT |
1 | 11 | 1 | 6.0 µs at 8 KiB |
NUM2BIN / BIN2NUM |
2 | 25 / 17 | 4 / 17 | 2.0 µs at 8 KiB / 2.0 µs at 1 KiB |
1ADD 1SUB NEGATE ABS ADD SUB MIN MAX |
2 | 20 | 20 | ADD 1 KiB 3.7 µs |
Comparisons and Boolean numerics (NOT … WITHIN) |
2 | 25 | 1 | LESSTHAN 1 KiB 3.3 µs |
MUL |
2 | 7 | 7 | 15 µs at 1 KiB, surcharge included |
DIV, MOD |
2 | 24 | 24 | MOD 1 KiB by 16 B 3.2 µs |
MULPOW2 |
2 | 25 | 25 | not measured; numeric decode rate |
ADDCARRY, SUBCARRY / MUL128_WIDE |
2 | 9 / 8 | 9 / 8 | 0.9 µs / 15 µs at 1 KiB |
LOG |
3 | 175 | 1 | 709 µs at 1 KiB |
SQRT |
4 | 34 | 1 | 62 µs at 1 KiB; 0.32 µs at 16 B |
SHA256 / HASH256 |
3 / 4 | 5 | 0 | 2.5 / 2.6 µs at 8 KiB |
BLAKE3 / LEAFHASH / STATEHASH |
2 | 11 / 14 / 11 | 0 | 3.2 / 5.0 µs at 8 KiB |
NODEHASH |
3 | 0 | 0 | 165 ns |
SIGHASH |
4 | 0 | 1 | 0.2 µs on a prepared transaction |
ENFORCEOUTPUT |
2, + 1 per transaction output | 0 | 0 | 3 ns per output scanned |
MERKLEROOT_SORTED, _INDEXED |
3 + per step: 2 (selectors 0–2), 4 (selector 3, HASH256), 4 if nonconstant | 68–234 ns per step |
fit_opcodes() in resources.py checks 77 measured cases against this table, and every one of them is covered. That is a statement about the cases measured, not about every operand. The review found one case the first version missed, SQRT of 16 bytes (5 cu needed, 4 charged). That led to adding the 16-byte rows for every numeric opcode, MOD, SPLIT, INVERT, LESSSWAP, DROP, loop iterations, CHECKSIG with its preimage, SIGHASH, introspection, ENFORCEOUTPUT, the success scan and transaction preparation. Three coefficients rose as a result: SQRT's base (3 to 4), DIV/MOD (22 to 24 per KiB) and the default operand term (0 to 1 per KiB). The tightest fits are CHECKSIG with its preimage (205 needed, 212 charged with its key push), P-256 (614, 620), SQRT at 16 bytes (5, 5) and HASH256 at 1 KiB (9, 9). Some cases are overcharged by design: DIV of 1 KiB by 1 KiB costs 62 cu and is charged about 1,600, because P05's quadratic surcharge assumes the worst divisor shape.
Still not measured:
- the phase-2 assignment of
ENFORCEOUTPUTclaims (deferred checks); STATEVERIFY,STATEHASH,MULPOW2andMERKLEROOT_INDEXED;- the branch and path introspection reads (
UTXOBRANCH,OUTPUTREQUIRESBRANCH,OUTPUTEXCLUSIVEBRANCH,OUTPUTCONTINUESBRANCH); - cold storage reads;
- any of the above on x86.
Per invocation
Each invocation pays 6 cu of setup (the 337 ns of EvaluateVm overhead), plus P05's structural charge of 1 cu per script byte, unchanged. The 6 cu belongs to the invocation's charge and counts toward MAX_INVOCATION_COST, like the structural bytes. The success scan measured about 3 ns per byte, well inside 1 cu per byte. Script bytes are therefore paid twice, once as wire bytes and once as the structural scan. That is conservative, and it matches the P05 text.
4. L(tx) and C_envelope
The recipe keeps the structure of the development profile's conservative-block-cost-1, which both the reference (block_cost.py) and lotusd (block_cost.cpp) already implement, and changes its weights. Writing h(n) = ⌈(n + 64) / 64⌉ for a hash of n payload bytes (one cu per 64-byte block, 64 bytes reserved for the domain tag), and CS(n) for a CompactSize width:
L = wire bytes + Σ invocation charges + 2·h(112)
+ per input: h(InputCore) + h(InputFull)
+ per witness: 6 + h(1 + CS(script) + script) + siblings·h(65)
+ per spend: 64 + coin_bytes + h(CS(out)+out) + h(core+CS(out)+out) + 2 + key(coin)
+ per mint: h(0) + 2
+ trees: (A·max(I,1) + 2·max(O,1))·h(66), A = 4 for coinbase, 6 otherwise
+ per output: h(CS(out)+out) + key(coin) if spendable
+ assets: (I + O + spends) × 1
key(n) = h(36) + h(33 + CS(n) + n) + 27·h(67) + 64
C_envelope = 134 + 4 + F + N + (2N − 1)·h(65) + h(37) + h(130) + h(116) + h(50) + h(64)
= 148 + F + 7N
The transaction's own hashing (everything but the tree and the VM) charges 54 cu for a payment and 2,086 cu for a 1-in/256-out transaction. Measured preparation needs 42 and 1,154.
What changed from the development recipe, and why:
| Item | Development | Recommended | Reason |
|---|---|---|---|
| Hash charge | 1 + (n + 64) cu | ⌈(n + 64)/64⌉ cu | A 67-byte tagged hash takes 100 ns: 1.5 cu needed, 3 charged. The development charge of 132 cu is 88 times the cost. |
| Coin resolution | coin bytes | 64 + coin bytes | One storage read, priced from the NVMe budget. The warm read measured 0.64 µs, well inside. |
| State key | 27 hashes, 1 cu per byte | 27 hashes per block + 64 | The CPU part (87 cu) covers the in-memory update; the 64 is one storage read for the leaf, with branch nodes in RAM (section 1). |
| Path matching per spend | 256 cu | 2 cu | The paths are uint16_t bitmasks bounded by 16 × 16 (P05). |
| Asset aggregation | r² + r + spends | r + spends | P05 asks for a sort or another bounded procedure. Sorting r ≤ 512 records takes under 15 µs; 1 cu per record covers it. The quadratic charge alone was 262,656 cu for the largest transaction, more than the knee. |
| Duplicate-ID check | N² + N | N | P02 orders transactions by TxID (CTOR), so duplicates are adjacent: one comparison per transaction. With N² a 12,000,000-transaction block would cost 1.44 × 10^14 cu and need a burn of about 4.8 × 10^12 XPI, so the design load could never be mined. |
The per-key charge is frozen at 27 levels. P05 sizes it at "~27 hashes per key at 10^8 coins". The in-memory update grows by about 0.27 µs per doubling of the key count. The 87 cu CPU charge (8.7 µs) covers 1.5 times the measured update up to about 1.2 × 10^9 keys, and the unmargined update up to about 1.9 × 10^12. Beyond about 10^9 keys the margin erodes. The tree's real depth then exceeds the 27 hashes charged, and the branch nodes that must stay in RAM grow with the set. Long before that, storage becomes the limit unless validator RAM grows with the UTXO set. The charge cannot be lowered later without a hard fork, but policy could raise it (section 11). The charge does not cover DiskStateStore as built: 25 µs per key at 1M coins needs 375 cu with margin, against 87 charged. Gate 3 is about this gap.
Resulting costs. The quadratic column uses the recommended knee, 18.
| Transaction | Wire bytes | L | C_tx | Stand-in bytes + 64(in+out) |
Development L |
|---|---|---|---|---|---|
| 1-in/2-out payment | 251 | 1,179 | 1,184 | 443 | 65,029 |
| 2-in/2-out payment | 396 | 1,926 | 1,940 | 652 | |
| 10-input consolidation | 1,511 | 7,697 | 7,922 | 2,215 | |
| 100-input consolidation | 14,561 | 74,927 | 96,342 | 21,025 | |
| 256-input consolidation | 37,181 | 191,459 | 331,292 | 53,629 | |
| Token transfer (2 in, 3 out) | 505 | 2,231 | 2,249 | 825 | |
| Covenant spend (state coin, 2 branches, ~2,000 cu VM) | 973 | 4,376 | 4,449 | 1,229 | |
| Coinbase, 1 / 4 outputs | 103 / 238 | 286 / 901 | 286 / 904 | 231 / 558 | 5,437 / |
Where a payment's 1,179 cu go:
- 251 for its wire bytes;
- 252 for the script and signature, including the 6 cu setup;
- 256 for four storage reads (one coin, three tree keys);
- 99 for the resolved coin's bytes;
- 261 for the 81 tree hashes of three keys;
- 54 for the transaction's own hashes;
- about 6 for path matching and asset records.
The stand-in undercounts it 2.7 times, mainly by missing the signature and the state tree. With the UTXO set in RAM (no storage reads) a payment would cost 923 cu; with four times the reads, 1,947 cu.
C_envelope for one transaction is 158 cu, against 993 in the development profile and 202 for the stand-in; for 12,000,000 transactions it is 1.2 × 10^8 cu, under 1% of the block. A coinbase-only block with four outputs costs 1,060 cu (904 for the coinbase, 156 for the envelope). Its floor at E_0 is 1,060 × 2^34 >> 32 = 4,240 atoms.
5. The transaction knee
C_tx = L + (L² >> S_tx_knee). P05 (and C24 in the consensus summary) states the candidate knee of 17, sized for a payment of about 500 cu and a 100-input consolidation of about 32,000 cu. P05 aimed at a surcharge of about 1.24 times for the latter. With measured weights both are about 2.3 times larger, so the knee moves up by one.
| Knee | Payment | 10 inputs | 100 inputs | 256 inputs |
|---|---|---|---|---|
| 16 | 1.8% | 11.7% | 114% | 292% |
| 17 (P05 candidate) | 0.8% | 5.9% | 57% | 146% |
| 18 | 0.4% | 2.9% | 29% | 73% |
| 19 | 0.2% | 1.5% | 14% | 37% |
Recommend 18. It restores P05's intended shape: payments flat, a 100-input consolidation about 1.29 times its linear cost, and a mega-transaction strongly super-additive (L = 2^22, about 4 million cu, pays 17 times its linear cost). 17 would make ordinary wallet consolidations pay 57% extra. 19 makes the knee too weak to discourage merging batches. If 18 is adopted, P05's table and C24's "candidate knee shift 17" change with it. A C_tx above 2^64 − 1 (L above 2^41) is rejected rather than wrapped.
6. The block burn floor
R = (C_block · max(E_n, E_min)) >> S_linear + (C_block²) >> S_quad
Two observations shape the choice.
E_min / 2^S_linearis a minimum price per cu. On a quiet chain every block must burn at least that many atoms per cu. Recommended: 2^34 / 2^32 = 4 atoms per cu. A payment's share is 1,184 × 4 = 4,736 atoms, below the 12,550 atoms the 100,000 atoms/kB byte fee already burns. So payments pay only the byte fee, while a CPU-heavy transaction, which has few bytes, pays per cu as a payment does.- At steady load above E_min, E ≈ C_block, so the floor is C² (2^−S_linear + 2^−S_quad): quadratic in sustained load. Below E_min, the linear term is fixed at 4 atoms per cu, and the quadratic term alone prices sudden blocks.
The shifts were chosen against four goals:
- G1, ordinary use stays cheap. Up to the 100,000 tx/s design load, the floor stays below the burned half of the minimum byte fees, so users pay only the byte fee.
- G2, a large block costs more than it is worth. A block twice the design size, on a quiet chain, burns more than a launch block subsidy (150,378 XPI). The miner's whole reward is then not enough to make one.
- G3, honest miners are never pushed below zero. A coinbase-only block remains affordable from
T_minat every EMA that can ever be reached (section 8). - G4, integer safety (section 8).
With E_min = 2^34 about 1.2 times above the design block (1.43 × 10^10 cu), the EMA term stays at its floor up to the design load and only rises above it. S_linear = S_quad = 32 meets G1 with 30% to spare and G2 twice over. The precheck of section 8 holds for any S_quad ≤ 33. 32 is chosen for G1 and G2, not for the precheck.
Fees and revenue under load
Three cases are shown, because the owner has not chosen the fee floor:
- A is the recommendation:
MIN_FEE_PER_KB = 100,000,E_min = 2^34. - B keeps the recommended shifts and uses the spec's current 1,000 atoms/kB.
- C also uses 1,000 atoms/kB, but lowers
E_minto 2^28 so that payments again pay only the byte fee on a quiet chain.
Each case gives the fee per payment that users must pay for the block to fund R, the required burn R, and the whole coinbase payout (miner, stakers and treasury; the miner's share is about half). All values assume steady load, with the EMA at its steady state.
| Load | Case | Fee per payment (atoms) | at $0.002 / $0.02 / $0.2 | R per block (XPI) | Payout at launch / on the tail (XPI) |
|---|---|---|---|---|---|
| 1 tx/s | A | 25,100 | $0.00005 / $0.0005 / $0.005 | 0.58 | 150,379 / 379 |
| B | 9,607 | $0.00002 / $0.0002 / $0.0019 | 0.58 | 150,379 / 379 | |
| C | 251 | $0.0000005 / $0.000005 / $0.00005 | 0.009 | 150,378 / 378 | |
| 1,000 tx/s | A | 25,100 | $0.00005 / $0.0005 / $0.005 | 577 | 151,872 / 1,872 |
| B | 9,616 | $0.00002 / $0.0002 / $0.0019 | 577 | 150,955 / 955 | |
| C | 251 | $0.0000005 / $0.000005 / $0.00005 | 13.7 | 150,393 / 393 | |
| 10,000 tx/s | A | 25,100 | $0.00005 / $0.0005 / $0.005 | 6,198 | 165,318 / 15,318 |
| B | 10,330 | $0.00002 / $0.0002 / $0.0021 | 6,198 | 156,575 / 6,575 | |
| C | 1,588 | $0.000003 / $0.00003 / $0.0003 | 953 | 151,330 / 1,330 | |
| 100,000 tx/s | A | 25,100 | $0.00005 / $0.0005 / $0.005 | 104,854 | 299,778 / 149,778 |
| B | 17,476 | $0.00003 / $0.0003 / $0.0035 | 104,854 | 255,222 / 105,222 | |
| C | 15,880 | $0.00003 / $0.0003 / $0.0032 | 95,276 | 245,646 / 95,646 | |
| 200,000 tx/s | A | 31,759 | $0.00006 / $0.0006 / $0.0064 | 381,105 | 529,086 / 379,086 |
| B, C | 31,759 | $0.00006 / $0.0006 / $0.0064 | 381,105 | about 531,000 / 381,000 |
What the table shows:
- In case A, users pay exactly the byte fee up to the design load. Above it the floor takes over and fees rise with load: 27% more at twice the design load. Even then a payment costs well under a cent at 20 cents per XPI.
- At the design load the three cases converge on 16,000–25,000 atoms per payment. Near capacity the burn floor, not the byte fee, sets the price.
- In case B the byte fee is decorative. With 1,000 atoms/kB and the recommended
E_min, the cu floor sets every payment's fee at about 9,600 atoms, 38 times the byte fee. Wallets would have to price by cu. - Case C makes payments nearly free on a quiet chain but makes CPU-heavy spam about 2.4 times cheaper (below).
- The payout never goes below zero when users pay what the floor needs (
test_honest_payout_is_positive). In case A this holds even if every payment pays only the minimum, up to twice the design load. In cases B and C a block of minimum-fee payments can need more burn than the coinbase can give. Consensus rejects such a block rather than letting the payout go negative, so an honest miner includes only transactions whose fee covers their share of R. Mempool and wallet policy has to price by cu for that, as the daemon's per-kcu fee code already does.
Spikes, spam and self-dealing
| Attack | Recommended (A) | Notes |
|---|---|---|
| One block at 1× / 2× / 10× the design size, quiet chain | burns 104,854 / 304,985 / 5,335,978 XPI | G2: 2× costs two launch subsidies |
| A day at 2× the design size, from a quiet chain | burns 219.6 million XPI: $0.44M / $4.4M / $44M at $0.002 / $0.02 / $0.2 | E stays below E_min all day (section 7); the burn is the 4 atoms/cu floor plus the quadratic term |
| A miner giving up one launch subsidy (150,378 XPI) | can make one block of at most 1.82 × 10^10 cu, 1.27× the design size | year 4 (55,384 XPI): 0.63×; on the tail (378 XPI): 0.7% |
| Blocks that fill the reference validator's CPU with P-256 loops (the most CPU per cu found) | 580,954 transactions per block, 8.05 × 10^9 cu: R is 47,272 XPI for the first block and 34.0 million XPI over a day | Case C: 13.9 million XPI a day. Byte fees alone would be 9.2 million XPI a day in case A, 92,441 in B and C |
The CPU row now counts the burn floor with both terms. The first version mixed fees with burn and left out the quadratic term. An attacker who is not a miner pays the burn twice over in fees: 162,740 atoms per transaction in case A. Without the burn floor, CPU spam would pay only the byte fee, 22,100 atoms per transaction at 100,000 atoms/kB or 221 at 1,000. The cu floor is what prices CPU and storage work that has few bytes.
Alternatives considered
| Shifts (S_linear, S_quad), E_min | 1× / 2× / 10× spike from quiet (XPI) | Effect |
|---|---|---|
| (32, 32), 2^34 — recommended | 104,854 / 304,985 / 5,335,978 | meets G1–G4 |
| (31, 31), 2^33 | 152,492 / 495,537 / 10,099,796 | at the design load users pay 27% above the byte fee; a launch subsidy buys 0.99× design |
| (30, 30), 2^32 | 247,769 / 876,643 / 19,627,431 | stronger spike guard; at the design load users pay about 2.5 times the byte fee |
| (33, 34), 2^35 | 69,126 / 162,070 / 1,763,114 | softer; a 2× spike costs about one launch subsidy, so G2 only just holds; S_quad = 34 breaks the u64 precheck |
| (31, 34), 2^33 | 69,126 / 162,070 / 1,763,114 | cheaper bursts with the same sustained price; same precheck problem |
| (64, 32), 65,536 — development | 48,039 / 192,155 / 4,803,867 | no EMA term and no cu floor: CPU spam pays only the byte fee |
| (32, 60), E_min 4, w 2 — lotusd toy | 0.0002 / 0.0008 / 0.018 | no spike guard at all; fails liveness |
6b. The worst block for each budget
The cu of a block is a sum over resources, while each resource has its own budget of 4.8 × 10^9 cu per 120 seconds. A design-size block, 1.43 × 10^10 cu, is 2.98 times any single budget. A payment uses CPU, tree updates, bytes and reads at once; a transaction built to load one resource puts nearly all of its cost on it. worst_per_cu() searches such shapes and reports the most reference-validator time per cu of C_tx for each budget:
| Budget | Worst shape found | Reference time per cu | Design-size block | Block one launch subsidy buys (1.27×) |
|---|---|---|---|---|
| CPU (8 cores) | a spend looping 20 P-256 checks, no outputs (C_tx 13,845) | 14.8 ns | 213 s | 272 s |
| Bandwidth (40 MB/s) | one 8 KiB witness argument per transaction (1.10 cu per byte) | 22.8 ns | 326 s (13.1 GB) | 416 s (16.6 GB), archived permanently |
| Reads (625,000/s) | 1 input, 64 outputs | 7.2 ns | 103 s | 132 s |
| Tree, one thread, in-memory tree | 1 input, 64 outputs | 43.9 ns | 628 s | 800 s |
Tree, one thread, DiskStateStore as built |
1 input, 64 outputs | 222 ns | 3,175 s | 4,047 s (519 s on 8 threads) |
The reviewer found 1.03 cu per byte and 17.7 GB for the launch-subsidy block. This search's best is 1.10 cu per byte: in the recommended recipe, larger argument-heavy transactions pay the knee and smaller ones pay more per-spend overhead. Either way the block takes 7 block intervals of bandwidth, and bytes carry no margin.
With one launch subsidy, a miner can therefore stall the reference validator for 2.3 block intervals of CPU, 3.5 of bandwidth, or, with lotusd's store as built, more than half an hour of tree updates. A year-4 subsidy buys half that, and a tail subsidy almost nothing (under 5 s on every budget). Gate 3 handles the tree. For CPU and bandwidth there are four levers, compared here by the fee per payment at the design load (the byte fee is 25,100 atoms) and by the worst block one launch subsidy buys:
| Option | Payment C | Fee at 100,000 tx/s | Launch block | CPU | Bandwidth | Reads |
|---|---|---|---|---|---|---|
| As recommended: 1 cu per byte, (32, 32), E_min 2^34 | 1,184 | 25,100 | 1.27× | 272 s | 416 s | 132 s |
| Byte margin 2, E_min 2^34 | 1,437 | 25,100 | 1.05× | 267 s | 208 s | 107 s |
| Byte margin 2, E_min 2^35 | 1,437 | 34,788 | 0.78× | 198 s | 154 s | 79 s |
| Byte margin 3, E_min 2^35 | 1,691 | 43,315 | 0.66× | 195 s | 101 s | 66 s |
| Shifts (31, 31), E_min 2^33 | 1,184 | 31,759 | 0.99× | 212 s | 324 s | 102 s |
| Shifts (30, 30), E_min 2^32 | 1,184 | 63,518 | 0.75× | 160 s | 245 s | 78 s |
| Separate byte budget of 4.8 GB per block | 1,184 | 25,100 | 1.27× | 272 s | 120 s | 132 s |
- A byte margin charges each wire byte b cu instead of 1. It is the same as keeping 1 byte = 1 cu and dividing every other weight by b, with the shifts and
E_minmoved by log2 b. The multiplier form keeps every fitted integer. Either form changes C24's and P05's "1 wire byte = 1 cu". With b = 2 andE_minunchanged, fees at the design load do not change: payments still pay only the byte fee up to 100,000 tx/s, with the floor binding from about 107,000 tx/s. The bandwidth-bound block halves. CPU is unchanged, because the CPU weights are unchanged and the launch subsidy still buys about a design-size block. - Raising
E_minor lowering the shifts shrinks the block a subsidy buys, which helps every budget at once, but it raises fees at the design load: by 39% (byte margin 2,E_min2^35) up to 153% (shifts 30). - A separate byte budget (a per-block byte cap) bounds bandwidth at one block interval for free at the design load. But it is a new hard limit of the kind P05 avoids, and it would refuse honest blocks above 1.6 times the design load.
Recommend byte margin 2 with E_min = 2^34. It halves the worst bandwidth block at no fee cost at the design load, and needs one sentence in P05 and C24. Accept the CPU figure: a 2.2-interval stall for one launch subsidy, falling to 1.1 intervals by year 4. If the owner wants every budget under about 1.7 intervals at launch, take byte margin 2 with E_min = 2^35 and accept 39% higher fees at the design load. The remaining tables in this note use the schedule as P05 states it (1 cu per byte), so that they stay comparable with the development profile. Under byte margin 2 with E_min 2^34, a payment is 1,437 cu and the knee still adds under 1%. G1 holds up to the design load, a 2× spike from a quiet chain burns 418,746 XPI, and a coinbase-only block (1,299 cu) still pays 90.0 XPI from T_min at the highest reachable EMA.
7. The EMA: w and E_0
E_{n+1} = E_n − (E_n >> w) + (C_block >> w). Exact integer simulation of the recommended profile, with E in cu at the end of days 1, 2, 3, 5 and 10:
| Sequence | Day 1 | Day 2 | Day 3 | Day 5 | Day 10 |
|---|---|---|---|---|---|
| Empty chain (coinbase only) | 8.5 × 10^9 | 4.2 × 10^9 | 2.1 × 10^9 | 5.1 × 10^8 | 1.5 × 10^7 |
| Steady 1 tx/s | 8.5 × 10^9 | 4.2 × 10^9 | 2.1 × 10^9 | 5.1 × 10^8 | 1.5 × 10^7 |
| Steady 10,000 tx/s | 9.2 × 10^9 | 5.3 × 10^9 | 3.3 × 10^9 | 1.9 × 10^9 | 1.4 × 10^9 |
| 100,000 tx/s from genesis | 1.57 × 10^10 | 1.50 × 10^10 | 1.46 × 10^10 | 1.44 × 10^10 | 1.43 × 10^10 |
| One 10× design block on day 2 | 8.5 × 10^9 | 4.3 × 10^9 | 2.1 × 10^9 | 5.2 × 10^8 | 1.6 × 10^7 |
| Attacker at 2× design through day 2 | 8.5 × 10^9 | 1.87 × 10^10 | 9.2 × 10^9 | 2.3 × 10^9 | 6.7 × 10^7 |
- E_0 = E_min is safe at genesis. The floor uses
max(E, E_min), so anyE_0 ≤ E_minprices the first blocks identically. On an empty chain E decays from E_0 (half-life 710 blocks, 24 hours) and the floor stays at 4 atoms/cu. The first block's floor is 4,240 atoms against a 150,378 XPI entitlement. A larger E_0 would only make launch blocks dearer, and a zero E_0 changes nothing, soE_0 = E_minkeeps one number and matches the development profile. - A single spike barely moves E. A 10× block adds C/1024 = 1.4 × 10^8 to E, under 1% of
E_min. The quadratic term prices spikes; the EMA prices only sustained load. - Because E_min sits above the design block, the EMA term does nothing until load has stayed above about 1.2 times the design for many hours. Starting from a quiet chain, a 2× attack keeps E below E_min for 31.3 hours, and a 4× attack for 12.2 hours. The first version of this note said that a day at 2× raises E above E_min. It does not: E ends the day at 1.4 × 10^10, below 1.7 × 10^10. That day's 219.6 million XPI of burn comes from the 4 atoms/cu floor and the quadratic term alone. The EMA matters only for attacks, or honest growth, that last beyond those times.
| w | Window | Hours until E > E_min at 2× / 4× design | E after a 2× attack day | Burned that day (XPI) | Reachable E bound |
|---|---|---|---|---|---|
| 8 | 8.5 h | 7.8 / 3.1 | 2.7 × 10^10 | 240.0 million | 2^44.75 |
| 10 | 34.1 h | 31.3 / 12.2 | 1.4 × 10^10 | 219.6 million | 2^43.75 |
| 12 | 136.5 h | 122.8 / 47.5 | 5.0 × 10^9 | 219.6 million | 2^42.75 |
Recommend w = 10, P05's candidate. Since E_min already covers the first day of any attack up to 2×, w decides what happens after it. With w = 10, a sustained 2× load is followed by the linear term from the second day, and a 4× load within half a day. With w = 12, a 2× attacker gets five days at the floor price before the linear term follows. With w = 8, an honest surge above 1.2 times the design load reprices everyone within eight hours, and the attack-day burn rises only 9%. The u64 bounds hold for all three.
8. Integer safety
All quantities are exact integers. The bounds below are checked in tests/test_resources.py.
L and C_tx fit u64, and anything above is rejected. The largest transaction P05's framing allows has 256 spends, each with 16 witnesses of an 8,192-byte script, 64 siblings and 64 arguments of 8,192 bytes, and 256 maximal outputs (844 bytes each). That is 2.19 GB of wire. With MAX_INVOCATION_COST = 2^22 its L is under 2^35 and its C_tx under 2^51. With the development cap of 10^8, L is under 2^39 and C_tx under 2^60. Both fit u64; the u128 square in C_tx has room to spare. A transaction whose C_tx would exceed 2^64 − 1 (L above 2^41 at knee 18) is invalid. A smaller invocation cap matters for verification time, not for overflow: 10^8 cu is about 6.7 seconds of M5 time in one invocation, while 2^22 is about 0.28 seconds and still covers 65,536 loop iterations of 64 cu each.
A block of 2^64 cu or more can never be paid for. The floor needs BurnedFees + U ≥ R, and both are bounded by what the block can hold:
BurnedFees + U ≤ S + G ≤ (2^64 − 1) + 2^62 · (2^32 − 1) < 2^95
(u64 subsidy; at most 2^32 − 1 transactions, each fee ≤ MAX_MONEY = 2^62, C16a)
C_block ≥ 2^64 ⇒ R ≥ C_block² >> 32 ≥ 2^96 > 2^95
So a validator may reject any block with C_block ≥ 2^64 before computing R. For every other block, C_block · max(E, E_min) ≤ (2^64 − 1)² < 2^128 and C_block² < 2^128: the whole floor fits u128. P05 says to compute the products "exactly (at least 256-bit intermediates)". The precheck gives the same answer for every block, so 256-bit arithmetic stays correct but is not needed. This needs S_quad ≤ 33 (at 33, R ≥ 2^95 still exceeds what a block can pay).
The EMA never overflows u64. With E ≤ 2^64 − 1 and C < 2^64, E − (E >> 10) + (C >> 10) ≤ 2^64 − 1 exactly. P05's rule that "a block whose E_{n+1} would exceed 2^64−1 is invalid" can therefore never fire after the precheck. It stays as defence in depth.
The EMA cannot get far. Let a = 2^−w. The integer update gives E' ≤ (1 − a)E + aC + 1, so after n blocks
E_n ≤ E_0 + a · Σ d_k C_k + 2^w, d_k = (1 − a)^(n−1−k)
Σ d_k C_k ≤ sqrt(Σ d_k²) · sqrt(Σ C_k²) (Cauchy–Schwarz)
Σ d_k² ≤ 1 / (a(2 − a)) ≤ 1/a
Σ C_k² ≤ 2^S_quad · (B + n) (each block burns ≥ C_k² >> S_quad ≥ C_k²/2^S_quad − 1)
⇒ E_n ≤ E_0 + sqrt(2^(S_quad − w) · (B + n)) + 2^w
where B is the total burned over the n blocks. The horizon is n = 2^32 blocks (about 16,000 years). B cannot exceed everything issued in that time: the whole bootstrap reserve plus T_max in every block, R_0 + 2^32 · T_max ≈ 5.2 × 10^19 atoms ≈ 2^65.5. The first version used 2^62 with the same 2^32 blocks, which is not consistent. With the consistent budget, E < 2^43.75 for the recommended profile. The test checks this bound against greedy attackers that spend a budget over 1, 64, 1,024 and 4,000 blocks.
Liveness at every reachable EMA (G3). A coinbase-only block with four outputs costs 1,060 cu. At E = 2^43.75 its floor is 3,652,898 atoms (about 3.65 XPI). The tail floor T_min is 94.5 XPI, so the coinbase can still pay 90.85 XPI after the byte charge, enough for four outputs above the recommended 54,600-atom DUST_LIMIT. This is weaker than the development profile's "every representable u64 EMA" bound. That stronger bound needs S_linear ≥ 48, which would switch the EMA term off at any realistic load. The issuance-bounded statement is the one that matters: no amount of burning that can actually happen can stall coinbase-only blocks. The lotusd toy values fail it. Their reachable E is 2^62, where a coinbase-only block's floor is about 965,000 XPI.
9. Differences from the development profile and the lotusd toy values
The development profile sets E_0 = E_min = 65,536 cu, S_tx_knee = 17, w = 10, S_linear = 64, S_quad = 32, and the exact conservative-block-cost-1 schedule. Those are fixture values for a separate network. Where the mainnet recommendation differs:
| Item | Development | Mainnet recommendation | Why |
|---|---|---|---|
| Signature charge | 50,000 cu | 210 cu (BIP340); 49,200 (Ed25519 as built) | measured: 50,000 is 240 times a BIP340 check at 100 ns per cu |
| Hash charge | 1 + (n + 64) per byte | per 64-byte block | measured: about 88 times too high |
| Storage | coin bytes only | 64 cu per coin and per key | storage reads are a scarce resource at the design load |
| Path matching, assets, duplicates | 256 per spend; r²; N² | 2; r; N | bounded linear procedures exist (bitmasks, sorting, CTOR order). N² alone makes the design load unminable. |
S_tx_knee |
17 | 18 | measured L is 2.3 times P05's estimate |
S_linear |
64 | 32 | 64 switches the EMA term off. The development profile chose it to prove affordability at every u64 EMA; the mainnet proof uses the issuance bound instead (section 8). |
E_min, E_0 |
65,536 | 2^34 | 65,536 cu gives a cu floor of 0 at S_linear = 64; 2^34 at 32 is the 4 atoms/cu floor |
S_quad, w |
32, 10 | 32, 10 | unchanged |
The lotusd constants at 080ad66f2c (kDefaultMonetaryProfile in mempool_overlay.cpp, and DEFAULT_BURN_* in fee_hysteresis.h) are knee 16, w 2, E_min 4, S_linear 32, S_quad 60, E_0 4. They are placeholders:
- w = 2 averages four blocks, so a spike reprices the next blocks at once;
S_quad = 60charges nothing for spikes;E_min = 4gives no cu floor.
They should be replaced by the profile's values, not tuned. The daemon's L stand-in, bytes + 64·(in+out), undercounts a payment 2.7 times. Its envelope stand-in, 138 + 64·N, overcounts by about 9 times. This lane did not edit lotusd.
10. Where P05 and P03 needed reading
- Rounding of size-dependent charges. P05: "A charge that grows with operand size is a nondecreasing function of a per-operand size bound." It does not require a per-byte linear form. I read that as allowing
base + ⌈(a·Σ + b·Σ)/1024⌉. The C++ and Python schedules use per-byte coefficients today, so the meaning of those two fields changes. CHECKDATASIGby selector. P03: "CHECKDATASIG with a nonconstant selector is charged at the most expensive defined profile." I read this as allowing a constant selector to be charged at its own profile, found the same way the size pass finds a constantNUM2BINwidth: from the instruction immediately before. A sentence in P05's transfer rules would make it explicit.- A failing signature: false or an error. P03: "Any correctly sized signature that fails the selected profile, including scalar/point canonicality, subgroup or verification checks, produces false." lotusd raises
CHECKDATASIG NULLFAILfor every nonempty signature that fails (vm.cppabout line 1886), andCHECKSIG NULLFAILlikewise; only an empty signature yields false. The spec and the code disagree, and one of them must change. The cost is the same either way, since the whole check runs before the result is known. The choice decides what a script can observe, and it must be settled before the Ed25519 vectors (gate 2) can state expected results. - Exact 256-bit floor arithmetic. P05: "The burn-floor terms below are computed exactly (at least 256-bit intermediates)." The precheck in section 8 shows u128 gives the same result for every block. This is an implementation equivalence, not a rule change.
- Storage in consensus cost. P05: "Storage I/O and peer submission limits remain operational obligations; consensus does not require the entire UTXO set in RAM." I still price one storage read per resolved coin and per state key. The schedule is frozen and storage is a scarce resource at the design load, so leaving it out would underprice spends and outputs for good. This is a pricing choice, not a requirement that nodes keep anything in RAM or on disk. The design load, though, does need the tree's branch nodes in RAM (section 1).
- The duplicate-transaction check in
C_envelope. P05 lists "block transaction-tree hashing and other block-only work". I read the CTOR order (P02) as making the duplicate check linear. S_tx_knee. P05's table and C24 state 17 as the candidate. This note recommends 18.- "1 wire byte = 1 cu". C24 and P05 state it as the normalisation. The recommended byte margin (section 6b) changes it to 2 cu per byte.
MIN_FEE_PER_KB. P05 and C14b state 1,000 atoms/kB; the issuance note recommends 100,000. Both are simulated. The recommendedE_mindepends on which is chosen.
11. What to freeze if the gates do not close
The launch is fixed for 2026-12-21. Gates 1 and 4 are days of work. Gates 2 and 3 are engineering: a new Ed25519 verifier with its vectors, and a parallel or faster state store. They may not land in time.
Can a later parameter vote fix the schedule after launch? The spec mentions such a vote only for scalar economic parameters. C14c: "A way to vote on scalar parameters such as this is still to be designed." C14a describes how it would work: a frozen consensus minimum, with a higher working value chosen by a non-consensus process and enforced as policy, "Such policy can only tighten this rule, never loosen it." Applied to the cu schedule, that process could raise a weight in policy, for example to price state keys higher. It could never lower a frozen weight, since a lower weight accepts blocks the frozen one rejects. Lowering any cu weight after genesis is a hard fork. Nothing in docs/lotus-v2/ plans a vote over cu weights, and the vote it does mention is not designed.
That makes the two possible errors unequal:
- An underpriced weight is a standing security hole. Ed25519 at 1,700 cu with the current verifier gives a 6,200-second design-size block. The 87 cu per-key charge with the store as built allows a launch-subsidy block that takes 4,047 s. A policy layer could tighten these on the live network, but nothing fixes them for a node validating history, except checkpoints and finality.
- An overpriced weight costs capacity and fees until a hard fork lowers it.
The as-built option freezes weights that the code at 080ad66f2c can actually meet:
- Ed25519 at 49,200 cu;
- state keys priced as one-thread work: CPU weight ⌈1.5 × 25 µs × 8 ÷ 100 ns⌉ = 2,996 cu per key;
- a design load that the one-thread tree can carry.
| As-built option (state keys as one-thread work) | Per-key time | Payment L | Design load | Fee per payment at that load | Block one launch subsidy buys |
|---|---|---|---|---|---|
DiskStateStore as built |
25.0 µs | 9,906 cu | 6,700 tx/s | 121,788 atoms ($0.0024 at $0.02) | 2.2× that design (266 s of tree) |
| In-memory tree, one thread | 4.9 µs | 2,697 cu | 33,800 tx/s | 35,940 atoms | 1.6× (198 s) |
With E_min 2^34 and shifts (32, 32) unchanged, the launch-subsidy stall stays near two block intervals, the same order as the target schedule's CPU figure. Later improvements would need a hard fork to pass on as lower prices. Before real usage, such a fork is cheap.
Recommendation: wait for the gates, but set a freeze date (for example 2026-12-07). Freeze the as-built value for every gate still open on that date. Concretely:
- If gate 2 is open, Ed25519 is 49,200 cu. Profile 2 is a niche profile, so overpricing it costs little.
- If gate 3 is open, state keys are priced from the measured one-thread store and the design load is stated as what that store carries. A design figure the code cannot meet would leave a security hole that no vote can close.
- Gates 1 and 4 should simply be done: run the harness on an x86 server, and decide the byte margin.
The design target of 100,000 tx/s is not given up. It becomes the case for the hard fork that lowers the prices once the faster code exists and is measured.
12. Open questions for the owner
- Fee floor. Recommend 100,000 atoms/kB (case A). At 1,000 atoms/kB, keep
E_min = 2^34(case B) rather than lowering it to 2^28 (case C): case C makes CPU-heavy spam 2.4 times cheaper, and case B already makes the byte fee irrelevant. - Freeze strategy. Recommend the gate-by-gate freeze date of section 11.
- Bandwidth margin. Recommend byte margin 2 with
E_min = 2^34(no fee cost at the design load). The alternative with every budget under about 1.7 intervals isE_min = 2^35, at 39% higher fees at the design load. - Ed25519. Recommend 49,200 cu unless an equivalent verifier passes the vector set and is measured before the freeze date. Also settle false versus NULLFAIL for failing signatures (section 10).
- The reference validator and the 100 ns anchor. Recommend accepting the 8-core, 1 Gbit/s, local-NVMe reference, with the x86 run as gate 1.
- Pricing storage reads (64 cu per coin and per key). Recommend keeping them.
- Per-KiB VM coefficients and selector-priced
CHECKDATASIG. Recommend both. Each needs a small change to the C++ cost structure and a sentence in P05. S_tx_knee = 18instead of P05's 17. Recommend 18.MAX_INVOCATION_COST. Suggest 2^22 cu (about 0.28 s of M5 time), with the 6 cu setup counted inside it, down from the development value of 10^8 (about 6.7 s). It was not in this lane's brief.- Linear asset and duplicate charges in place of the development profile's quadratic ones. Recommend linear.
13. What this does not establish
- No x86 measurement (gate 1). The reference validator's speed is the M5 Max's divided by an estimated factor of 2.
- No cold-storage measurement, and no state-tree measurement at 10^8 coins. 64 cu per read is derived from an assumed NVMe budget of 625,000 reads per second. The 4.9 µs in-memory figure is extrapolated from 1M and 4M keys. The 25 µs store figure is from 1M coins on a loaded machine.
- No RAM measurement for keeping branch nodes resident.
- The unmeasured opcodes listed in section 3 keep default charges.
- No measurement of a full block's validation in lotusd. The design-load check adds up per-primitive timings.
- The worst-case search covers the shapes listed in
attack_shapes(). It is a search, not a proof that nothing worse exists. - No price, demand or mempool model. Fees are what the floor requires at steady load; real fees depend on wallet and miner policy.
- Nothing here changes lotusd or a normative spec file.
Reproduce
From the repository root, with the standard library only (about a second):
PYTHONPATH=tools/lotus-v2-reference python3 -m lotus_v2_reference.resources
PYTHONPATH=tools/lotus-v2-reference python3 -m unittest tools/lotus-v2-reference/tests/test_resources.py
The module is tools/lotus-v2-reference/lotus_v2_reference/resources.py; its output is saved as daemon/docs/evidence/resource-calibration/resources-report.txt. The timings it uses are copied from the .tsv files into MEASURED_NS. To remeasure, build the harness in daemon/docs/evidence/resource-calibration/harness/ (build.sh gives the git archive command for the lotusd sources) and run run.sh under the shared heavy-build lock while nothing else heavy runs.