V2 development draft · Source at 00505898

Lotus v2 consensus specification

Test vectors

Vector directory and SHA-256 checksums

Status: review draft; not launchable. Requirement IDs below identify proposed rules for conformance work. MUST denotes an obligation within this draft, not a claim that the existing daemon implements it. Open decisions and missing parameter values block genesis. Historical v1 consensus is outside this document.

Monetary index convention: issuance step n >= 0 means block height n + 1; genesis commits the initial state without advancing any recurrence. See P02's genesis/indexing rule.

1. Validity boundary

C01 — Scalar semantics. Define block validity by deterministic parsing, contextual checks, script evaluation, accounting and state transition. Caches, batch signatures, threads, databases, indexing, mempool policy and transport MUST preserve this result. Consensus limits cannot depend on machine speed, cache warmth or local configuration.

C02 — Unknown data and extension points. Every opcode byte not assigned an instruction by P03 is OP_SUCCESS_N, with N its unsigned decimal byte value. Encountering an unassigned success opcode during P03's instruction-boundary scan unconditionally succeeds for that invocation, including in skipped code; pushed data bytes do not count. This bypasses that invocation's VM execution, structured decoding and final-stack checks, not witness framing/limits, membership proofs, other required branches, accounting, locks or enclosing budgets. Unknown transaction/header versions, flags, lock kinds, signing modes and signature algorithms MUST reject; CHECKDATASIG defines only selectors 0..3. An assignment may only narrow transaction/block validity. P05 freezes monetary accounting costs and permits stricter execution charges without changing committed state. No other field has success-on-unknown behavior, and no vote implicitly gives one. Network feature negotiation does not change block validity.

C03 — State. The validation state contains unspent coins with complete output bytes, creation height, creation parent MTP, coinbase status, and optional Coin-v2 lifespan provenance (fee_per_output:u64, expiration_height:u64) in UtxoRoot, plus the canonical MonetaryState record in P02. At genesis ($h = 0$), Bytes(MonetaryState) is the 56-byte core monetary record (0x38 length prefix: bootstrap_reserve:u64 || tail_subsidy:u64 || prev_work:u256 || ema_block_cost:u64 with history_root = 0x00..00 omitted); at every post-genesis height ($h \ge 1$), Bytes(MonetaryState) is the 88-byte extended record (0x58 length prefix: the 56-byte core monetary record followed by the 32-byte append-only HeaderHistoryRoot history_root over all prior canonical block hashes $(0, \text{BlockID}0) \dots (h-1, \text{BlockID}{h-1})$). The header's state_root (StateRoot = H_state(0x00 || ChainID || u64(height) || UtxoRoot || Bytes(MonetaryState))) commits to both UtxoRoot and MonetaryState. Header PoW is necessary but not sufficient for block validity.

2. Encoding contract (D01)

C04 — Primitive proposal. Fixed-width transaction integers use little-endian encoding. Hashes are 32 bytes in digest order; display reversal is not serialization. Byte order is little-endian by convention throughout: wherever consensus orders two hashes or byte strings (branch-tree nodes in P02, LESSSWAP in P03, proof of work in P04) it reads them as unsigned little-endian integers. An unsigned amount is u64 in [0, 2^64-1], subject to the final narrower asset/supply limits. Aggregate arithmetic uses checked unsigned 128-bit or equivalently bounded mathematical integers. Never reinterpret token units as signed native amounts.

CS(n) denotes shortest CompactSize: one byte for 0..252; fd plus u16 for 253..65535; fe plus u32 through 2^32−1; otherwise ff plus u64. Larger-than-needed encodings reject. Bytes(x)=CS(len(x)) || x; Vec(xs)=CS(count(xs)) || encode(each item in order). Count and cumulative-byte limits MUST be checked before allocation, indexing, or multiplication. Truncation and trailing bytes reject. Actual limit values remain OPEN.

C05 — Output proposal. Serialize flags:u8 || value:u64 || token_id? || state_root? || branches || paths:

A one-branch, one-path native output occupies 45 bytes under this proposal; the corresponding token output is 77 bytes (and a one-branch native or token IS_BURN output with paths = [] occupies 43 or 75 bytes). With C09's hard consensus caps (MAX_OUTPUT_BRANCHES = 16, MAX_OUTPUT_PATHS = 16), every serialized Output is at most 812 bytes (844 bytes when HAS_STATE is set) and every native UTXO Coin record is at most 868 bytes (900 bytes with HAS_STATE, or up to 917 bytes when the 17-byte Coin-v2 lifespan provenance extension encoding_version:u8 (=2) || fee_per_output:u64 || expiration_height:u64 is attached; in V1-to-V2 hard-fork migration profiles that import legacy P2PKH/P2SH outputs encoded as 80 || value:u64 || Bytes(scriptPubKey), a legacy bridge Coin is bounded by 10,085 bytes). Neither size guarantees cache-line alignment.

C06 — Transaction candidate. P01 owns the exact ordinary/coinbase grammar: version u32 (7), one u64 lock word packing lock_kind and a 56-bit lock_value, u16 input and output counts, then inputs and outputs, with nothing after the outputs. Its fixed prefix is 16 bytes. There are no read-only inputs: every input of an ordinary transaction either spends a coin or is a mint. Ordinary transactions require a consuming input but may have zero outputs. A coinbase is the transaction whose single input has flags 02 and carries the parent BlockID and derived height (u32, with overflow rejection); it has no other inputs. Its authorization is CoinbaseData = Vec(Bytes(data)), with count zero or one and, if present, a nonempty element of at most MAX_ELEMENT_BYTES = 8192 bytes. Count zero is canonical absence. The data is opaque vanity/extranonce material with no script, proof or authorization meaning and no OP_SUCCESS_N scan; its bytes and hashing incur P05 charges. Unknown version/flags reject. A mint is an input with flags 03 whose prev_txid holds the token ID and whose authorization is one branch witness revealing a mint script, its membership proof and arguments; mint inputs are unique per token and exactly cover positive deltas.

C07 — Identities and canonical TxID-keyed block commitment. P01 and P02 define the Merkleized core and complete transaction identities (101-implement-malfix.patch provenance): each input i has core projection InputCore(i) (retaining CS(path_index) and Vec(CoreWitness) = Bytes(script) || Vec(h32 sibling) for spends and CoreWitness for mints, omitting only spend/mint Vec(Bytes(arg)); coinbase retains all of CoinbaseData) with leaf InputCoreLeaf(i) = H_inputcore(InputCore(i)) and complete leaf InputFullLeaf(i) = H_inputfull(Input(i)), and each output j has leaf OutputLeaf(j) = H_output(Bytes(Output[j])). Letting InputsRoot, FullInputsRoot, and OutputsRoot be their canonical bottom-up indexed binary Merkle roots (IndexedTreeRoot in P02) and TxHeaderCore = version:u32 || lock:u64 || input_count:u16 || output_count:u16, TxID = H_txid(ChainID || TxHeaderCore || InputsRoot || OutputsRoot) and TxHash = H_txhash(ChainID || TxHeaderCore || FullInputsRoot || OutputsRoot) (each hashing an exact 112-byte preimage). Mutating coinbase data changes both identities. The block commits to the coinbase transaction and the ordinary transaction set via P02's two-branch Merklix commitment TransactionsRoot = H_txroot(0x03 || CoinbaseLeaf || SubtreeA), where CoinbaseLeaf = H_txroot(0x00 || cb.TxID || cb.TxHash) and SubtreeA is the single-leaf-collapsed 256-bit radix Merklix tree keyed by TxID over all ordinary transactions (with leaf digest TxLeaf(tx) = H_txroot(0x01 || tx.TxID || tx.TxHash) and branch subtree counts). Ordinary transactions in a serialized block body MUST appear in strict ascending lexicographical TxID order (Canonical Transaction Ordering, CTOR). Reject duplicate TxIDs within a block and any attempted overwrite of an existing outpoint, including a coinbase outpoint; no BIP30 exception applies. Parent/height separates coinbase identities along one chain, while identical coinbases on competing siblings are allowed if valid against their respective states; no global duplicate-coinbase ban applies. Signature mode FULL commits to TxID, CoinsRoot = IndexedTreeRoot(CoinLeaf[0 .. input_count - 1]) and the active spend/mint selector under C18; P01's two partial modes commit to OwnInputHash(i) and either OutputsRoot or OutputLeaf(i), keeping every sighash preimage fixed-size ($O(1)$ per invocation). Spend/mint witness arguments remain outside TxID and the signature message but inside TxHash; no general claim of argument-byte immutability follows.

3. Application hash domains and branch commitments

C08 — Hashes and trees. P02 owns the application domain registry and exact branch, bottom-up indexed-Merkle (IndexedTreeRoot), ordered-transaction, compact sparse-UTXO and full-state-envelope algorithms. H_name(x)=BLAKE3(ASCII(tag) || 00 || x) with 32-byte output. Because domain separation is an ordinary ASCII byte prefix before unkeyed BLAKE3, any script can construct and verify any H_name digest (H_txid, H_inputcore, H_output, H_coinentry, H_merkleidx, etc.) in three instructions (<"Lotus/v2/...\x00"> SWAP CAT BLAKE3) without a dedicated opcode per domain tag, and combine it with MERKLEROOT_INDEXED (0xc1, hash_alg = 0) to prove any input or output of a parent/injected transaction (OUTPOINTTXID(i)) in $O(\log N)$ space. Leaf/node type bytes are application-level inputs, independent of BLAKE3's internal flags. Header hash-group definitions and their additional domains are in P04. Do not reuse a branch-membership proof as an ordered-vector or keyed-map proof.

C09 — Output authorization structure. Every output MUST have 1 <= branch_count <= 16 (MAX_OUTPUT_BRANCHES = 16), with pairwise distinct 32-byte entries in branches in committed wire order (an output that lists the same 32-byte entry twice rejects). Path structure depends on IS_BURN (flags & 0x02):

Output well-formedness is checked on creation and on imported state, not deferred to its first spend.

C10 — Positional witnesses. A consuming input MUST have 0 <= path_index < path_count before dereferencing it. Its witness count MUST equal the selected path length. Witness j proves and invokes branch paths[path_index][j]. No spare, missing or wildcard witnesses exist. Every required branch must succeed, and even an OP_SUCCESS_N invocation requires a valid membership proof.

C11 — Branch inclusion. Start with r=Leaf(script); for each supplied sibling in bottom-up order set r=Node(r,sibling); require r == expected_branch_root. Zero siblings is the one-leaf case using exactly the same leaf hash. Bound proof length and charge all supplied hashes. This is unordered membership: there is no leaf index, direction mask or claim about method position. A branch commits to an owner's binary tree, not a numbered method table. It does not prove leaf count or uniqueness of hidden leaves. Wallets may use a deterministic construction convention, but validators cannot enforce hidden-tree properties from one inclusion proof.

Adding a method generally changes the branch root and address. Domain separation does not preserve addresses across contract refactors. Distinct tags remove structural ambiguity in hash inputs under the hash security assumptions; they do not make hash collisions mathematically impossible.

Transaction order and state-key direction MUST NOT use this sorted-child operation. An ordered transaction vector and an authenticated key/value map have different proof obligations from branch membership.

4. UTXO resolution and conservation

C12 — Two-phase outputs-then-inputs resolution (CTOR invariance). Ordinary transactions in a block are committed in strict ascending TxID order (CTOR, C07). Because a child transaction's TxID may sort lexicographically before its parent's TxID within the same block, block UTXO resolution uses two-phase outputs-then-inputs set semantics (P02):

  1. Phase 1 (Coinbase Maturity Insertion & Intra-Block Output Registration): For block height $h \ge 1$, insert the spendable coinbase outputs ((flags & 0x02) == 0) of parent block $h-1$ into the candidate UTXO view, and register all spendable outputs ((flags & 0x02) == 0) created by block $h$'s ordinary transactions into the block-created output map (rejecting any duplicate TxID or outpoint collision).
  2. Phase 2 (Input Resolution, Deletion & Immutable Context Evaluation): Resolve and consume every ordinary transaction's spending inputs against PreBlockUTXOSet ∪ BlockCreatedOutputs (rejecting any missing outpoint, any duplicate spend of the same outpoint within or across transactions, any immature coinbase spend under C13, or any expired coin where expiration_height != 0 && expiration_height <= h). Because every spending input commits to its parent's TxID inside InputsRoot, any dependency cycle among intra-block transactions would require a 256-bit BLAKE3 cycle and is cryptographically impossible. Resolution fetches only the compact Coin record ($\le 900\text{ bytes}$ native, or up to $917\text{ bytes}$ with Coin-v2 lifespan provenance), never the full parent transaction. Each transaction then evaluates its scripts and C12a deferred checks in parallel against its immutable resolved Coin vector.

C12a — Deferred transaction checks. Input invocations may run in parallel, but successful script execution alone does not accept a transaction. Collect invocation records only on success; after every required input succeeds, enforce transaction-wide state-output authorization and joint ENFORCEOUTPUT claim feasibility. Failed, incomplete or abandoned runs MUST NOT enter the accepted mempool or committed chain state. All validation paths must preserve these rules, including cache hits and speculative admission. Deferred checks defines record lifetime, the 4096 claim-pair bound, finalization and conformance cases.

C13 — No read-only inputs. A transaction cannot read a coin without spending it. The input kinds are 01 spend, 02 coinbase and 03 mint, and every other flags value rejects; the read-only reference kind of earlier drafts is gone. Every coin a script can inspect is one the transaction consumes, so each such coin has been authorized by its own policy, and a coin's data cannot be used by a transaction its owner did not approve. Shared data that many transactions need is carried by spending the coin that holds it and recreating it in the same transaction. The coinbase maturity height check applies to spends; the maturity constant remains a parameter to freeze.

C14 — Accounting. Let I_a be the sum of consuming-input values for asset a, and O_a the sum of all output values (including IS_BURN outputs with flags 0x02 or 0x03) for asset a. Compute with checked arithmetic. For native XPI, ordinary transactions require I_native >= O_native; the transaction fee is F = I_native - O_native. Because O_native includes 0x02 (IS_BURN) outputs, 100% of the value placed on a native IS_BURN output is permanently and provably burned rather than included in F or claimable by miners; value = 0 is also valid for zero-value data commitments. Tokens never pay native fees. For each token, if O_a <= I_a, the difference (along with any value placed on a 0x03 token IS_BURN output) is burned; if O_a > I_a, C15 must authorize precisely the positive delta. Spending still requires every branch under C10, regardless of whether accounting balances.

C14a — Token output burn (candidate, pending D10). Let n be the number of token-bearing outputs (HAS_TOKEN, i.e. flags 0x01 or 0x03) that an ordinary transaction creates. Require F >= 2 × DUST_LIMIT × n. That amount is burned: it is part of B in C16 and is never collectable by a coinbase, so a miner cannot create token outputs for free. A token output holds no native value, so this adds a token-specific native burn in addition to byte fees and resource charges, and it does not depend on any judgment of what the token is worth. The rule deliberately charges every token output created, including transfers, change and 0x03 commitment burns, not only minted ones. A matching consensus minimum value for native outputs remains to evaluate. DUST_LIMIT is a consensus minimum, frozen at genesis: it is the lowest value the network will ever accept and the only one a syncing node checks. A higher working value may be chosen later by a non-consensus process, such as a coin vote, and enforced as policy by online nodes, for example by Avalanche declining to finalize blocks that violate it. Such policy can only tighten this rule, never loosen it, so every block it accepts also satisfies consensus. Consensus burns only the minimum; a policy that wants the surplus burned must require the coinbase to leave it unclaimed (C16's underclaim).

C14b — Minimum native fee. Every ordinary transaction MUST pay at least ceil(MIN_FEE_PER_KB * len(Tx) / 1000) atoms, with MIN_FEE_PER_KB = 1000 and complete serialized transaction bytes (including witnesses). This is 1 native atom per byte. C14a and this floor both apply. Coinbase pays its own byte/envelope charge by reducing the claim under C16/P05, not by inventing an input fee.

C15 — Minting proposal, pending D05. Token ID is mint_root, a branch root (C11) over the token's mint scripts, used directly; zero is forbidden. Execute exactly one matching mint input (P01) for each positive delta in a dedicated mint context binding that asset and delta. No native mint input exists. Program-derived identity allows the same policy to authorize later mints; it is not intrinsically unique issuance. One-time policies require a uniquely consumed anchor. Supply caps, revocation and circulating-supply claims need explicit authenticated state or conserved authority, not an assumption that an off-chain certificate disappears when replaced.

C16 — Native issuance and mandatory fee burn. Coinbase is the only native issuance exception (with native denomination 1 XPI = 10^6 atoms; P06). From Block 1, the block subsidy entitlement $S_n$ (u64 atoms) is the additive sum of the telescoping bootstrap issuance $B_n$ and the work-responsive adaptive tail $T_n$ derived from authenticated parent work and immutable genesis anchors, with a checked cache in the parent's 56-byte MonetaryState ($R_n, T_n, W_{n-1}, E_n$; P02, P06):

$$S_n = B_n + T_n, \qquad B_n = \begin{cases} 0 & \text{if } R_n = 0 \ \max!\big(1,, R_n \gg k_{\text{boot}}\big) & \text{if } R_n > 0 \end{cases}, \qquad R_{n+1} = R_n - B_n$$

(with candidate decay shift $k_{\text{boot}} = 20$, initial $B_0 = T_0 = 250{,}000\text{ XPI} = 2.5 \times 10^{11}\text{ atoms}$, and $R_0 = 2^{20} \cdot B_0 = 262{,}144{,}000{,}000\text{ XPI} = 2.62144 \times 10^{17}\text{ atoms}$, so $\sum_{n=0}^{\infty} B_n = R_0$ to the exact atom; after issuance step $n$ with per-block work $W_n$, $T_{n+1} = \min(T_{\max}, \max(T_{\min}, \text{isqrt}(\lfloor T_g^2 W_n / W_g \rfloor)))$). Let total native fees of issuance step $n$'s ordinary transactions be $F$, mandatory token-output burn under C14a be $T_{\text{tok}}$, remaining native fees be $G = F - T_{\text{tok}}$, mandatory burned share of remaining fees be $\text{BurnedFees}n = G - \lfloor G/2 \rfloor$, total mandatory fee burn be $B = T{\text{tok}} + \text{BurnedFees}_n$, actual coinbase output sum be $C$, and underclaim be $U = S_n + F - B - C \ge 0$. The total coinbase entitlement before resource deductions is $S_n + \lfloor G/2 \rfloor$, computed once per block. P06 selects Avalanche-controlled distribution using upstream staking-reward coordination policy; there is no treasury contract or faucet state. Distribution never increases this total. Furthermore, P05 defines the coinbase/envelope byte charge K and parabolic burn requirement R. Require U >= U_required = max(K, max(0, R - BurnedFees)); equivalently the coinbase payout is at most S_n + floor(G/2) - U_required. Reject insufficient entitlement before subtraction. Coinbase-only blocks pay from subsidy. Explicit burn outputs do not satisfy this underclaim. Letting Burn_explicit be the sum of value across all native IS_BURN outputs in the block, net spendable native supply change is $C - F - \text{Burn_explicit} = S_n - B - U - \text{Burn_explicit}$.

C17 — Atomicity, Genesis UTXO initialization, pipelined coinbase UTXO insertion ($h \to h+1$), and UTXO pruning. Validate all required branches, mints, conservation and contextual rules before committing a transaction or block. At Genesis ($h = 0$), insert every spendable output (flags & 0x02) == 0 in Block 0's coinbase into the initial UtxoRoot (height = 0, coinbase = 1; Unlike Bitcoin 0.1.0, Lotus v2 has no special case skipping Block 0 UTXO insertion, while any Genesis headline/timestamp commitment uses an IS_BURN output). For every post-genesis block ($h \ge 1$), coinbase output insertion into UtxoRoot is pipelined by one block ($h \to h+1$, D02, D13, P02): block $h$'s UtxoRoot inserts the spendable coinbase outputs of parent block $h-1$ (height = h - 1, coinbase = 1) together with block $h$'s ordinary transaction outputs (minus block $h$'s spent inputs), while block $h$'s own coinbase outputs are inserted into UtxoRoot at block $h + 1$. This one-block coinbase pipeline allows UtxoRoot at height $h$ to be pre-computed purely from the parent state and ordinary transaction set before mining or adjusting the coinbase payout. Burn/commitment outputs ((flags & 0x02) != 0, which have path_count == 0) MUST NOT be inserted into UtxoRoot in any block (Genesis or non-Genesis); they are permanently unspendable and occupy zero UTXO state forever. Validate block roots and total budgets before committing a block. Failure leaves no consensus state changes. Disconnect MUST restore coins and all monetary metadata exactly. State import MUST reproduce the same rules and root; a matching root is not evidence that unverified history was executed.

5. VM, signatures and optimization

C18 — Invocation. Every execution has an immutable context: core transaction, complete witnesses if introspection exposes them, resolved coin records in input order, chain domain, invocation kind (spend/mint), the index of the input the script is running for, its path and branch indices in a spend or its token ID and delta in a mint, active leaf bytes/hash, and arguments. No block-context field is available to opcodes (C22a). Undefined context reads reject. A mint script runs for its own mint input: INPUTINDEX returns that input's index and CHECKSIG uses the mint selector, never a spending input's context.

P01 defines the exact FULL message: ChainID, mode, TxID, CoinsRoot and a typed spend/mint selector (binding input_index, branch_index and Leaf(script) in a spend), and two spend-only partial-mode messages selected by a 65-byte signature using 32-byte per-input (OwnInputHash(i)) and per-output (OutputsRoot or OutputLeaf(i)) digests so every signature check hashes at most 4 BLAKE3 blocks in $O(1)$ time. Resolved output policies and all selected scripts and membership proofs are committed through InputsRoot (TxID) and CoinsRoot; confirmation metadata, current block hash/time and witness argument bytes (including signatures) are excluded. Contextual locks/maturity still validate separately. BIP340 verification uses that message without replacing its internal hash algorithm.

C19 — Scalar execution. Apply P03's success scan after the outer witness/proof checks. If it returns unconditional success, no VM stack is initialized or executed. Otherwise arguments initialize a fresh stack in wire order, last argument at top. In a mint invocation the node then pushes the positive delta (P03); it is a validator-supplied value, not witness data. The token ID is read with BRANCHROOT. The alternate stack starts empty. Branch invocations share no mutable VM state. The proposal uses byte strings with explicit signed two's-complement little-endian numerical operands of 16..1024 bytes (128-bit int128 baseline up to 8,192-bit big-ints, with automatic zero-padding of shorter operands in bitwise and unsigned limb operations) and canonical 16-byte booleans, as detailed in the ABI. Ordinary executions finish with exactly one true value and empty alternate stack. Arithmetic overflow, invalid operand encoding, invalid index and stack underflow reject. P03 supplies assigned instructions, generic success bytes, control/arithmetic semantics and explicitly selected crypto profiles. Independent vectors, review and costs remain required before D07 closes.

C20 — Cache equivalence. Reference validation executes each invocation. An implementation may reuse a result only when all observable context and invocation inputs are equivalent and all proof/well-formedness checks still occur. At minimum include actual leaf identity, canonical argument vector, invocation context, resolved coins, rule set and all observable transaction/block data. Hashing concatenated arguments without lengths is not a unique vector encoding. Root alone does not identify an executed MAST leaf, and TxID omits witness arguments. Include unambiguous invocation-kind tags rather than overloading input index zero as a “pure” sentinel.

The absence of OP_INPUTINDEX is not a purity proof: CHECKSIG, relative locks, implicit spent-coin fields, active script, mint context and future introspection may depend on the invocation. Conservatively disable cross-input result caching until a closed opcode dependency analysis proves equivalence. Cache identity and invalidation are daemon details, not a new consensus hash formula. Static charges never shrink on hits.

C21 — Covenant aggregation. A companion must not treat another coin's branch commitment as proof that its invariant ran. A permitted optimization must establish a consuming designated master, its selected path and executed leaf, noncircular obligation to perform the invariant, and coverage of every companion and relevant output. With the currently proposed introspection surface, that proof is not specified; the Master/Companion shortcut is excluded from reference examples. Repeated independent checks remain valid. An output's covenant is preserved only if its spending program enforces the required successor policy; conservation alone does not preserve governance.

6. Structured control flow and resources

C22 — Loops. Only structurally matched enumeration loops are allowed, at lexical nesting depth at most two. All combinations, including inputs × outputs, are allowed. Input/output bounds are validated transaction counts; generic bounds are runtime integers 0..256. Each iteration pushes a fresh index from zero upward. Zero iterations execute no body. Code without an unassigned success opcode is decoded once, including skipped regions; pushed data is not decoded as instructions. No dynamic jumps, recursion, or script-generated executable code exists.

depth OP_BREAK requires an integer in [1, active_loop_depth]. It exits the named enclosing loop and any inner loops, landing after its matching end; it does not roll back stack effects. Conditional/loop frames crossed by the jump must unwind consistently. P03 defines structured ExitLoops propagation, canonical Boolean conditions and decoding of unexecuted regions; those semantics must not be replaced by assumptions about C++ pointer arithmetic.

C22a — Monotone script validity and lifespan margin. Once a transaction's scripts and lock conditions are valid against a chain tip, its script evaluation remains valid on every extension of that chain until one of its inputs is spent by another transaction (or, in profiles where Coin-v2 UTXO lifespan expiration_height is active, reaches expiration_height). Minimum locks, relative locks and coinbase maturity only ever become satisfied. No script operation reads block height, block time, block hashes or any other state that advances with the chain. A reorganization that removes an input's creating block (or an unspent input reaching its expiration_height) is the only other cause of invalidation. To preserve zero-re-execution mempool and Snowstorm overlay invariants when expiration_height is enabled, mempool and epoch admission require every spent coin's expiration_height to exceed tip_height + K_expiry_margin (tracked via min_expiration_height on MempoolOverlay subtree nodes), and block connection prunes any overlay entry with min_expiration_height <= next_height in $O(\log N)$ time. This is transaction/script validity, not a guarantee that a fixed-fee transaction fits every later block burn floor: template builders recheck aggregate fees against the current EMA. A node therefore need not re-execute scripts for mempool transactions when a block arrives; it only removes those whose inputs the block consumed (or whose min_expiration_height expired). The assignment of an extension point (C02) is the one event that requires a script re-check. Block-dependent script operations (OP_BLOCKHEIGHT, OP_BLOCKTIME, OP_BLOCKHASH) and historical-state proof opcodes (OP_UTXOPROOFVERIFY) are rejected; see rationale for the engineering record and how time-sensitive contracts, auctions, expiring offers and shared state are built while preserving C22a.

C23 — Static bound. Invocations accepted by the success scan pay P03's structural scan/byte charge and all outer charges; they have no AST execution charge. For other invocations, compute a conservative deterministic upper bound from decoded syntax before execution. Sequence costs add. A conditional includes its condition/control cost and the maximum of both arms. A loop with bound b costs setup plus b × (iteration_control + body_bound); generic loops use 256 even when runtime N is smaller. Input/output loops use I/O. Early termination, false predicates and BREAK do not lower the charge. Use checked arithmetic; overflow or excess budget rejects. The pass traverses syntax, not expanded iterations. Size-dependent charges use the per-operand bounds of P05's size pass, which tracks an upper bound on each stack item's size through the same traversal and falls back to MAX_ELEMENT_BYTES (working value 8192) wherever the stack's shape is not determined by the syntax. That pass selects charges only; it rejects nothing.

C24 — Unified Cost Units (cu) and parabolic transaction cost. All wire bytes (1 wire byte = 1 cu), proof verifications, commitment hashes, state updates, and branch/mint VM invocations are charged in unified integer Cost Units (cu) (P05), summing to a linear base cost $L(\text{tx})$ (u64) for each transaction, including coinbase. An I×O scan repeated by I spending invocations has I²O body work; charges are independent of caches, batch verification and execution ordering. Rather than imposing a hard MAX_TX_BYTES step-function wall, each transaction's effective accounting cost is parabolic:

$$C_{\text{tx}} = L(\text{tx}) + \big((L(\text{tx}) \cdot L(\text{tx})) \gg S_{\text{tx_knee}}\big)$$

(with candidate knee shift $S_{\text{tx_knee}} = 17$, i.e. $2^{17} = 131{,}072\text{ cu}$), keeping normal payments and consolidations in the flat linear regime while penalizing mega-transactions super-additively.

C25 — Structural framing bounds, rolling ema_block_cost, and parabolic block burn floor. Every operation requires a conservative cu charge covering maximum permitted operand size, signature/curve work, hashing, copies, concatenation and memory use. Structural framing limits bound counts (u16 inputs/outputs, MAX_OUTPUT_BRANCHES = 16, MAX_OUTPUT_PATHS = 16), proof depth, syntax depth, operand bytes (MAX_ELEMENT_BYTES = 8192), script bytes, stack/altstack entries and total VM bytes before allocation. Rather than a hard MAX_BLOCK_BYTES ceiling, let $C_{\text{block}} = C_{\text{envelope}} + \sum_{\text{tx} \in \text{block}} C_{\text{tx}}$ include all transactions (coinbase included) plus C_envelope under P05's frozen accounting view and $E_n$ (ema_block_cost:u64 in MonetaryState) be the rolling integer EMA updated after issuance step $n$ via $E_{n+1} = E_n - (E_n \gg w) + (C_{\text{block}} \gg w)$ (candidate $w = 10$). With mandatory burned fee share $\text{BurnedFees}_n = G_n - \lfloor G_n / 2 \rfloor$ and coinbase underclaim $U$ (C16), require:

$$\text{BurnedFees}n + U \ge \left(\big(C{\text{block}} \cdot \max(E_n,, E_{\min})\big) \gg S_{\text{linear}}\right) + \left(\big(C_{\text{block}} \cdot C_{\text{block}}\big) \gg S_{\text{quad}}\right)$$

Because $\text{BurnedFees}_n$ is permanently burned, not even a miner mining their own transactions can stuff a block without burning real XPI.

7. Blocks, time and genesis blockers

After an opcode extension, the burn-floor inequality uses C_enforce, while the EMA always uses frozen C_account = C_block (P05). The coinbase byte floor U >= K also applies. Header/coinbase/framing work is included; an empty ordinary-transaction set is not a free block.

C26 — Block transition. P04 specifies a 134-byte recursive header using pure tagged BLAKE3 (H_headerbody, H_headerwork, H_blockid) for both header commitments and Proof-of-Work (BlockID), keeping BLAKE3 as the single hash primitive across the entire protocol (including the HeaderHistoryTree commitment in P02). The validation order must cover parsing, parent/context (including exact coinbase parent BlockID, derived u32 height and overflow), target/PoW, complete transaction/root checks (CoinbaseLeaf and TxID-keyed SubtreeA in ascending CTOR order), first-and-only coinbase, two-phase outputs-then-inputs ordinary transitions (C12) and deferred checks (C12a), total block cost $C_{\text{block}}$ and mandatory fee-burn floor against $E_n$, and the post-state MonetaryState (56 bytes at genesis $h = 0$; 88 bytes with 32-byte history_root at $h \ge 1$) and StateRoot envelope. Commit only after all checks pass. P01's parent/height-derived coinbase identity and P02's dependency order avoid embedding the containing block hash in its own coin records.

C27 — Time and issuance. Lotus v1 already uses a six-byte unsigned timestamp. The older v2 draft regressed to 32 bits; P04 retains the 48-bit timestamp in a new-header design. Width does not determine truthful timestamps. P01 fixes proposed absolute/relative lock clocks and boundaries; P06 specifies the candidate additive subsidy $S_n = B_n + T_n$ (height-based telescoping bootstrap reserve $R_n$ plus integer work-responsive tail $T_n$) and separates its exact integer recurrences from economic timestamp-honesty claims. Target/ASERT anchors, future-time eligibility and final monetary/cost constants must be confirmed by simulation before launch.

C28 — Freeze. Before genesis, confirm every parameter and constant below via simulation and benchmarks, generate reference vectors, and obtain independent conformance/review evidence. Unknown values are blockers, not implementation defaults.

Required parameter or algorithm family Status
Versions/byte grammar/ranges; structural count and framing limits P01 candidate; mainnet limits and vectors pending (MAX_TX_BYTES/MAX_BLOCK_BYTES replaced by parabolic cost curves in P05)
Opcode map, conversions, arithmetic, shifts, fixed-point math, crypto profiles P03 candidate (225 assigned opcodes / 31 OP_SUCCESS_N bytes); independent vectors/review/costs pending
Signature domain and sighash preimage P01 exact candidate; independent vectors/acceptance pending
TxID-keyed Merklix SubtreeA, state map, hash domains, MonetaryState (56B core + 32B history_root) P02/P04 candidates; vectors/acceptance pending
Header/PoW/compact target and ASERT P04 pure tagged BLAKE3 candidate; ASERT vectors and future-time rule pending
Unified cu schedule, parabolic $C_{\text{tx}}$, ema_block_cost $E_n$ and block burn floor P05 cost algebra & parabolic curves specified; primitive cu weights and shift constants ($S_{\text{tx_knee}}, w, E_{\min}, S_{\text{linear}}, S_{\text{quad}}$) pending calibration
Locktime/sequence and coinbase P01 candidate; maturity value pending
Additive issuance ($S_n = B_n + T_n$), fee burn, MonetaryState P06 telescoping bootstrap ($k_{\text{boot}} = 20$) + adaptive tail specified (1 XPI = 10^6 atoms, candidate $B_0 = T_0 = 250{,}000\text{ XPI}$, $R_0 = 2^{20} B_0$); simulation confirmation pending; Avalanche payouts use coordination policy (D11)
Genesis allocations, empty state, chain identity and launch manifest OPEN

A complete genesis package must contain no OPEN rows and no dependence on unspecified behavior inherited from Bitcoin ABC.

8. Relay and mempool (not consensus)

Mechanics not described here are inherited from the Bitcoin ABC base: peer-to-peer framing, block and transaction propagation, orphan handling, reorganization, RPC and Avalanche. Five areas differ because the transaction model differs.

Absolute tail: T_g=genesis_tail, W_g=genesis_work>0, and formula version 1 are immutable profile inputs. C16 pays F(parent_work) directly, rejects a cached tail/work mismatch, and stores F(current_work) for the next payment. See P06 for bounds, rounding and explicit profile migration.


References

  1. [Nakamoto 2008] Satoshi Nakamoto, "Bitcoin: A Peer-to-Peer Electronic Cash System", October 2008 (https://bitcoin.org/bitcoin.pdf).
  2. [Chancellor 2026] Shammah Chancellor, "Adaptive PoW Monetary Policy Without Oracles: A Constructive Mechanism for Pseudo-Stability via Work-Coupled Tail Emission and Burn", Lotus Network Technical Paper, 2026.
  3. [O'Connor, Aumasson, Neves, & Wilcox-O'Hearn 2020] Jack O'Connor, Jean-Philippe Aumasson, Samuel Neves, and Zooko Wilcox-O'Hearn, "BLAKE3: One Function, Fast Everywhere", January 2020 (https://github.com/BLAKE3-team/BLAKE3-specs).
  4. [Wuille, Nick, & Ruffing 2020] Pieter Wuille, Jonas Nick, and Tim Ruffing, "BIP 340: Schnorr Signatures for secp256k1", Bitcoin Improvement Proposals, January 2020.
  5. [Wuille, Nick, & Towns 2020a] Pieter Wuille, Jonas Nick, and Anthony Towns, "BIP 341: Taproot: SegWit version 1 spending rules", Bitcoin Improvement Proposals, January 2020.
  6. [Wuille, Nick, & Towns 2020b] Pieter Wuille, Jonas Nick, and Anthony Towns, "BIP 342: Validation of Taproot Scripts", Bitcoin Improvement Proposals, January 2020.
  7. [Vermorel, Séchet, Chancellor, & van der Wansem 2018] Joannes Vermorel, Amaury Séchet, Shammah Chancellor, and Tomas van der Wansem, "Canonical Transaction Ordering for Bitcoin", June 12, 2018.
  8. [Vermorel, Séchet, Chancellor, & Cox 2018] Joannes Vermorel, Amaury Séchet, Shammah Chancellor, and Jason Cox, "Merklix Tree for Bitcoin", July 2018.
  9. [Dahlberg, Pulls, & Peeters 2016] Rasmus Dahlberg, Tobias Pulls, and Roel Peeters, "Efficient Sparse Merkle Trees: Caching Strategies and Secure (Non-)Membership Proofs", in Proceedings of the 21st Nordic Conference on Secure IT Systems (NordSec 2016), LNCS vol. 10014, pp. 199–215, 2016 (IACR ePrint 2016/683).
  10. [Lundeberg 2020] Mark B. Lundeberg, "ASERT (aserti3-2d): Absolutely Scheduled Exponentially Rising Targets", Bitcoin Cash Specification, July 2020.
  11. [Crosby & Wallach 2009] Scott A. Crosby and Dan S. Wallach, "Efficient Data Structures for Tamper-Evident Logging", in Proceedings of the 18th USENIX Security Symposium, pp. 317–334, August 2009.