Source: docs/lotus-v2/research/plans/lotus-v2-resource-pricing-research.md
Research — non-normative. This page records an investigation. It defines no rule; a research result enters the specification only through a decision recorded in decision history.

Lotus V2 resource pricing: prior art, principles and recommended values

On this page

Status: research for an owner decision (2026-11-18, revised the same day after owner feedback). It changes no normative file and no code. It builds on the resource calibration (called "the calibration note" below) and takes these owner decisions as given:

Every number here comes from the calibration note's measurements and its reference module (tools/lotus-v2-reference/lotus_v2_reference/resources.py), used read-only. See Reproduce.

What the revision changed:


Decision summary

The unit. 1 cu = one reference hash H_ref: one tagged BLAKE3 hash whose message takes two compressions. That is the shape of every state-tree node hash and of the 67-byte tagged preimages the schedule already charges. Every price is

weight(op) = ⌈1.5 × max over measured machines of t(op) / t(H_ref)⌉

The measured set is the M5 Max today. On it, t(H_ref) = 99.6 ns, within 0.4% of the 100 ns the calibration note used as its unit. So every approved weight is unchanged except Ed25519, which rises from 49,200 to 49,400 cu. Absolute speed drops out: a faster or slower machine changes the atom price of nothing. Only a machine on which some operation is slower relative to H_ref raises that operation's weight.

The approach. Price each operation by its worst measured ratio to H_ref, with a 1.5× margin for ratio variance between machines. Price each wire byte at a design ratio, 2 H_ref. Bound the worst block separately for each resource, as a multiple of a design block. Let the burn-floor shifts decide how many atoms a cu costs.

The prior art supports this:

Constant Recommended (in cu = H_ref) Ratio on the M5 (t ÷ t(H_ref)) Why Risk if wrong
Unit 1 cu = one two-compression tagged BLAKE3 hash 1 It appears in the schedule already. It is built from 32-bit add, xor and rotate, which cost about the same everywhere. It sits in the middle of the cost range. If H_ref is unusually fast on some machine, many ratios rise there. The margin covers 1.5×, and a cross-check finds anything more.
Wire byte 2 cu (owner decision), for every serialized byte, including the header, count and frame bytes in C_envelope; resolved coin bytes 1 cu design ratio, not measured A byte is relayed by everyone and archived forever, so it is priced at 2 node hashes. This halves the bytes a given burn buys compared with 1 cu per byte. A ratio set too low makes byte-heavy blocks the cheapest way to load validators (Ethereum, EIP-7623).
BIP340, ECDSA secp256k1 210 135.7, 133.2 ⌈1.5 × 136.7⌉ = 206 with the signing preimage The sig/hash ratio differs between architectures (64-bit multiply versus 32-bit ARX). The second-machine check measures exactly this.
ECDSA P-256 620 410.8 ⌈1.5 × 410.8⌉ = 617 The OpenSSL version and platform change the ratio.
Ed25519 (profile 2) 49,400 (was 49,200) 32,885 ⌈1.5 × 32,885⌉ = 49,328. Price the strict verifier as built. Overpricing a niche profile costs little.
Hash and VM opcodes The calibration note's per-KiB table, unchanged 77 cases All 77 measured cases stay covered in the new unit (refitted). Unmeasured opcodes keep conservative defaults and can be raised by soft fork.
Invocation, MAX_INVOCATION_COST 6 + 1 per script byte; cap 2^22 setup 3.38 ⌈1.5 × 3.38⌉ = 6 Keep wallet scripts far below the cap, so a later price rise cannot leave existing coins unspendable (as EIP-1884 broke contracts).
Hash charge h(n) 1 cu per 64-byte block, 64 bytes reserved for the tag 1 for 2 compressions Charges H_ref itself at 3 cu, so it carries more than 1.5× margin None found
Storage read 64 cu per resolved coin and per state key (approved) warm MDBX read 6.4. Cold read not measured. This is about 10 warm reads. It is held at the approved value until cold reads are measured as a ratio. Cold state is the classic underpricing (EIP-2929). Pending, with the state key.
State key Pending measurement. The approved 27-level charge (87 CPU + 64 read = 151 cu) is a placeholder only. not yet measured on the node path The node validates through SmtBatchUpdateParallel (prefix-compressed tree, deferred dirty-node hashing, up to 16 shards in parallel). It has not been measured. This is the largest open pricing risk (gate 3).
C_envelope 286 + 2F + 7N The approved 148 + F + 7N, with 2 cu per byte applied to the header, count and frame bytes Negligible
S_tx_knee 18 Payments pay +0.5%, and a 100-input consolidation +34% Low
w 10 The EMA follows sustained load, and the quadratic term prices spikes 8 reprices honest surges too fast; 12 gives an attacker days at the floor price
E_min = E_0 2^34 4 atoms per cu on a quiet chain. Payments pay only the byte fee up to about 107,000 tx/s with the approved schedule. Lower makes CPU-dense spam cheap
S_linear 32 G1, G2 and G3 hold (below) 33+ weakens sustained pricing; 31 or less raises fees at the design load
S_quad 32 A 2× spike from a quiet chain burns 418,746 XPI. Keep S_quad ≤ 33 for the u128 precheck. 34 halves the spike guard

Worst blocks, as multiples of a design block (one launch subsidy of burn, approved schedule, 2 cu per byte; from the calibration note's search). These are ratios, so the 100k tx/s benchmark scales them directly:

If the benchmark shows that a design block validates within the block interval with a factor of 3 to spare, no budget's worst block exceeds it.

G3 and the EMA bound without T_min and T_max (section 2). The redefinition does not change these.

Freeze gates:

Gate Can research close it? What is left
1. Ratio cross-check on any second machine No, it needs a measurement, of any architecture. Run the existing harness on one more machine. Until then, the 1.5× margin covers ratio variance between machines.
2. Ed25519 Yes, by decision: freeze 49,400. Nothing
3. State-key price No. Measure SmtBatchUpdateParallel (src/primitives/block.cpp) at 10M+ coins, warm and cold, on 1 to 16 threads, as ratios to H_ref. Include the cold storage read.
4. Bandwidth The decision is closed by 2 cu per byte. Bytes per block at design and worst case are now ratios that the 100k benchmark checks.

Throughput (section 5). A cu price is an exchange rate between operations and says nothing about speed. The atom price of a cu comes from the burn floor. How fast blocks validate is the 100k tx/s benchmark's question.

The 120k+ tx/s figures were bursts of 1,000 to 6,000 transactions on a small, fully cached state, timing one stage. They show the hot path is fast, not what is sustained. The sustained rate on a large state, and on the node's actual path, is what the benchmark has to show.


1. The unit: 1 cu = one reference hash

Why a reference operation, not a machine

The calibration note's unit, "1 cu = 100 ns of one M5 Max core", tied every weight to one machine's absolute speed. It then needed an estimate of how fast a reference server is (the old gate 1). But nothing in consensus uses absolute speed:

What consensus does depend on is the ratio between operations. That is the price of one kind of work in terms of another, and an attacker exploits a wrong ratio by buying only the underpriced work.

The choice

H_ref is one tagged BLAKE3 hash whose message takes two compressions. It is measured as the harness case tagged/67 (a 67-byte message): 99.6 ns on the M5 Max. Option C's 99-byte tree-node preimage is also two compressions (P05).

Why this operation:

  1. It is already in the schedule, and it is the most frequent CPU operation in it. Every state-tree node, every outpoint key and most of a transaction's identity hashing is this shape. The hash charge h(n) stays exact: 1 cu per 64-byte block.
  2. It is stable across architectures. A single BLAKE3 compression is 32-bit additions, xors and rotations, which every 64-bit CPU runs at about one per cycle per lane. For a single block it needs no SIMD; SIMD speeds up only messages above about 1 KiB. A signature check depends on 64×64-bit multiplies and on library assembly, which vary more between platforms, so it is a worse reference.
  3. It sits in the middle of the cost range. A byte copy is a small fraction of it and a signature check about 137 of it, so neither the cheap nor the expensive end dominates the rounding.
  4. The approved numbers stay put. 99.6 ns is within 0.4% of the old 100 ns unit.

The alternative, "1 cu = 1/128 of a BIP340 verification" (88 ns on the M5), would raise every CPU weight by about 13% and tie the unit to the operation whose cross-platform ratio is least certain.

The pricing rule

weight(op) = ⌈ m × max_{machine ∈ measured set} ( t_machine(op) / t_machine(H_ref) ) ⌉,   m = 1.5

The approved values in the new unit

Refitting all 77 measured cases with t(H_ref) = 99.6 ns changes the required value of 11 cases by 1 to 0.4%:

Item Ratio Needed (⌈1.5 × ratio⌉) Approved New
CHECKSIG type 1 with its preimage 136.7 206 210 + key push 2 210 (unchanged)
CHECKDATASIG BIP340 / ECDSA secp256k1 135.7 / 133.2 204 / 200 210 210
CHECKDATASIG P-256 410.8 617 620 620
CHECKDATASIG Ed25519 (as built) 32,885 49,328 49,200 49,400
Invocation setup 3.38 6 6 6
LOG 1,024 B / SQRT 1,024 B / MUL 1,024 × 1,024 7,114 / 621 / 149 10,671 / 931 / 224 charged 11,376 / 2,215 / 478 unchanged
LESSTHAN 1,024 B, DIV 1,024 / 1,024, LOG 128 B 50 / 63 / 193 charged 53 / 1,610 / 198 unchanged
Transaction preparation, 1-in/256-out 1,158 outer hashes charge 2,086 unchanged
Every other measured case unchanged unchanged

Only Ed25519 crosses its charge, by 0.26%. Every L(tx), C_tx, C_envelope, burn and fee figure in the calibration note and below is therefore unchanged.

What a byte is worth

2 cu per wire byte means one byte is priced like two node hashes, or four BLAKE3 compressions. That is not a measurement. Bandwidth and archive storage cannot be expressed as a CPU ratio on one machine. It is a design ratio, set by the owner at twice P05's normalisation.

What the ratio does:

If the 100k benchmark shows that relaying bytes is the binding constraint at design load, the byte ratio is the lever. Raising it is a soft fork on C_enforce.

Why ratio variance is the real risk

The 2016 Shanghai attacks are the clearest example. In September and October 2016, Ethereum blocks took tens of seconds to process, and some nodes could not keep up. Ethereum hardware was not slow. The problem was that EXTCODESIZE cost 20 gas, the same order as arithmetic, while it forced a disk read hundreds of times more expensive than an ADD. An attacker filled blocks with nothing else and bought disk time at a 10 to 35 times discount. Ethereum's fix, EIP-150, changed that ratio: it raised state reads by 10 to 35 times and left the rest of the schedule alone. The block gas limit, and so the absolute budget, did not cause the attack and was not the fix.

The same holds for every case in section 3:

When the machines are faster or slower overall, the operators' hardware requirements change, not the security of the price schedule. A ratio error lets an attacker concentrate a block on one operation and make validation take ratio-error times longer than the same cu of normal traffic, on every machine. That is what the margin and the cross-check guard against.


2. G3 and the EMA bound without T_min and T_max

Unchanged by the redefinition, because it is stated in cu and atoms.

What changed

The calibration note proved two things using the tail clip:

Without the clip, both inputs are gone.

The EMA never overflows, independent of issuance

E' = E − (E >> w) + (C >> w) keeps E at or below max(E, C). If E ≤ X and C ≤ X, then E' ≤ X − ⌊X/2^w⌋ + ⌊X/2^w⌋ = X, because E − ⌊E/2^w⌋ never decreases as E grows. So E_n ≤ max(E_0, max_k C_k) < 2^64, given the calibration note's rejection of blocks of 2^64 cu or more.

That precheck assumes a u64 subsidy. With no clip, T_n reaches MAX_MONEY at about 1.5 × 10^20 times genesis work and exceeds u64 at about 2.4 × 10^21 times. The spec must say what happens there; a checked-overflow rejection would be a cap by another name. This is outside this note.

Bounding E by recent burn

With a = 2^−w and decay weights d_k = (1 − a)^age:

E_n ≤ E_0 + a·Σ d_k C_k + 2^w
a·Σ d_k C_k ≤ sqrt(a) · sqrt(Σ d_k C_k²)                  (Cauchy–Schwarz, Σ d_k ≤ 1/a)
C_k² ≤ 2^S_quad · (P_k + 1)                              (each block burns P_k ≥ C_k² >> S_quad)
⇒ E_n ≤ E_0 + sqrt(2^(S_quad − w) · (D_n + 2^w)) + 2^w,   D_n = Σ d_k P_k

D_n is the decayed burn: each block's burn weighted by (1 − 2^−10)^age. It needs no issuance cap. At a steady design load, D is about 1.4 × 10^14 atoms and the bound is about 2.4 × 10^10 plus the decayed E_0, against an actual E of 1.7 × 10^10.

For comparison with the old statement, the lifetime bound at a constant work level:

Work (× W_g) Tail Lifetime budget over 2^32 blocks E bound Coinbase-only floor as a share of the tail
1/16 94.5 XPI 2^59.0 2^40.5 0.50%
1 378 XPI 2^60.6 2^41.3 0.22%
1,024 12,096 XPI 2^65.5 2^43.75 0.037%
3.3 × 10^8 6.9 million XPI 2^74.6 2^48.3 0.0016%
1.5 × 10^20 4.6 × 10^12 XPI 2^94 2^58 0.000002%

When work is steady, the guarantee gets stronger as work grows: the floor's share of the tail falls as 1/sqrt(T). The only danger is a tail that is low now after a burn that was large recently.

G3 restated

A coinbase-only block at step n is affordable if T_n ≥ K + ((C_cb · max(E_n, E_min)) >> S_linear) + (C_cb² >> S_quad). That holds whenever the decayed burn is below

D*(T) = ((T − K − (C_cb² >> S_quad)) · 2^S_linear / C_cb − E_0 − 2^w)² · 2^(w − S_quad)

The smallest possible tail is at POW_LIMIT work. With the placeholder 2^224 − 1, the work per block is 2^32, which is 2.39 × 10^−6 of W_g, so T ≥ isqrt(T_g² · 2^32 / W_g) = 583,895 atoms (0.584 XPI). The static part is easily affordable at that tail: 5,752 atoms of floor, plus K of 37,700 atoms at 100,000 atoms/kB or 377 at 1,000.

The decayed burn that breaks G3 (MIN_FEE_PER_KB = 100,000, shifts (32, 32), w = 10):

Tail now Coinbase-only block Proved D* Cheapest attack found
0.584 XPI 1,299 cu (envelope bytes at 1 cu) 4.85 R_0 16.8 R_0
0.584 XPI 1,438 cu (recommended) about 3.9 R_0 about 13.7 R_0
0.584 XPI about 3,500 cu (sensitivity, if the pending state-key measurement comes out near the withdrawn library figure) about 0.65 R_0 about 2.3 R_0
3.78 XPI (work at 10^−4 W_g) 1,299 cu 231 R_0
94.5 XPI 1,299 cu 1.5 × 10^5 R_0
378 XPI (T_g) 1,299 cu 2.4 × 10^6 R_0

R_0 is 157.3 billion XPI. The cheapest attack holds a constant block cost for k blocks, searched over k from 64 to 4,096; the best k is about 1,024.

Lever, for the 3,357 cu sensitivity case Proved Cheapest attack Cost
None: (32, 32), w 10 0.70 R_0 2.5 R_0
w 11 1.41 R_0 5.0 R_0 The EMA follows sustained load half as fast
S_linear 33, E_min 2^35 2.82 R_0 8.7 R_0 Sustained-load pricing is halved
S_quad 31 2× Doubles spike burns and raises fees at the design load
E_min no effect
POW_LIMIT (higher minimum work) in proportion to the minimum work An existing consensus constant, still a placeholder

Recommendation: keep (32, 32) and w = 10. Replace G3's wording, "affordable from T_min at every reachable EMA", with the relative statement and the D* formula. No finite parameter makes G3 unconditional while total issuance is unbounded. Revisit S_linear only if the state-key measurement makes coinbase-only blocks much more expensive. C16a's issuance bound still refers to T_max and needs a separate edit.


3. Prior art

Ethereum gas

Bitcoin

Bitcoin Cash, Lotus's parent tier

Lesson: this is the nearest prior art. Costs are ratios fitted to cross-implementation benchmarks, in a unit tied to hashing and bytes, not to a machine.

Solana, Cardano, Kaspa, Monero, Zcash

Academic work


4. Principles for a chain with frozen prices

  1. Price ratios, not speeds. Define the unit by a reference operation. A weight is the worst measured ratio, times a margin. Absolute speed belongs to validator requirements and the throughput benchmark.
  2. Price the code as built, on the path that validates. Measure the node's block path, not a library path that does not run during validation (section 6).
  3. Size the margin to ratio uncertainty. 1.5× covers kernels measured on the target code on one machine. A second machine of any architecture tests it. Operations not yet measured keep conservative defaults.
  4. Cold versus warm. Price every first touch of state as a read, because consensus cannot see caches (C24). Measure the cold read as a ratio before freezing it.
  5. Bytes are priced by a design ratio, chosen so that byte-heavy blocks are not the cheapest way to load validators. Bandwidth has no CPU ratio to measure.
  6. Bound the worst block per resource, as a multiple of a design block, so that the throughput benchmark covers it directly.
  7. Sustained versus burst. Sustained throughput is for the benchmark on a large, realistic state. The shifts price bursts. Burst microbenchmarks on an empty state justify neither.
  8. Leave headroom under hard caps, so that raising a price never makes existing coins unspendable.
  9. Use the error asymmetry. Raising a price is a soft fork and lowering one a hard fork, so err high at genesis.

5. Pricing and throughput: the owner's question

Why earlier benchmarks showed 120k+ tx/s. The figures are in the victory report, section 12: 156k tx/s for a 4,000-transaction burst, 201k tx/s for a 6,001-transaction block connect, and 460k tx/s for mempool overlay inserts. They measured:

They show the hot path is fast. They do not show what a validator sustains on a large state.

How price relates to throughput. A cu price is an exchange rate between kinds of work, in H_ref units. It does not encode any speed, so it cannot set throughput. Throughput comes from three separate things:

  1. What validators can do. The 100k tx/s benchmark measures it on the node's path.
  2. The atom price of a cu. The burn floor sets it. E_min and the shifts were fitted so that payments pay only the byte fee up to about 107,000 tx/s.
  3. Bursts. The quadratic term prices them.

The cu schedule's job is to make sure no transaction shape gets more validator work per cu than a payment does, beyond the stated worst-case multiples (2.8× CPU, 2.7× bytes, 1.4× reads). If the benchmark shows design blocks validate with that much room to spare, the worst blocks fit too.

Withdrawn. The earlier note gave 33,800 tx/s as "what the reference validator sustains on the shipping code", and cited 1,200 tx/s cold and 7,700 tx/s warm from the state-tree lane's connect runs. Those came from the lotus_v2 library state path (incremental_utxo.cpp and DiskStateStore) before option C. The node validates blocks through src/primitives/block.cpp → SmtBatchUpdateParallel, which uses the prefix-compressed tree with deferred dirty-node hashing and hashes up to 16 shards in parallel. None of those figures describes it.


6. Notes per constant

Payments pay only the byte fee (25,100 atoms) up to about 107,000 tx/s. A 1×, 2× or 10× spike from a quiet chain burns 139,367, 418,746 or 7,694,250 XPI.


7. What this does not establish

Reproduce

From the repository root, standard library only:

PYTHONPATH=tools/lotus-v2-reference python3 -m lotus_v2_reference.resources

The figures in this note came from a short script that imports resources and calibration read-only:

References

Ethereum:

Bitcoin and Bitcoin Cash:

Other chains:

Academic:

Lotus: