Protocol specification · Source at 93ba635c

Lotus 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 lifespan provenance (fee_per_output:u64, expiration_height:u64, always present in the one canonical Coin encoding of P02) 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 (h32) are 32 bytes in digest order, on the wire and in display. Every V2 interface shows an h32 value as the hex of its 32 bytes in digest order, with no byte reversal. This covers JSON-RPC, REST, Chronik, wallets, block explorers, URIs and logs, and every hash they show, including TxIDs, TxHashes, block IDs, token IDs and roots. The same form is accepted as input, so the hex a user copies is the hex of the wire bytes. 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. Every amount, native XPI or token, is encoded as u64 and limited to MAX_MONEY = 2^62 (C16a), so it also fits a signed 64-bit integer. Consensus does not bound a token's total supply across mints; indexers sum supply with unbounded integers. Aggregate arithmetic uses checked unsigned 128-bit or equivalently bounded mathematical integers. Token units are never interchangeable with native atoms.

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 885 bytes (917 bytes with HAS_STATE; both include the 17-byte lifespan suffix encoding_version:u8 (=2) || fee_per_output:u64 || expiration_height:u64 that every Coin carries under P02; 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, and a v7 input spends it as P01 "Spending a legacy coin" specifies). 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 transaction has at most 256 inputs, spends and mints together, and at most 256 outputs (MAX_INPUTS = MAX_OUTPUTS = 256); the u16 count fields carry these values, and a larger set is expressed as chained transactions. 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, prefix-compressed 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 (at $h = 1$ this set is empty: Genesis's spendable outputs are already in the genesis UtxoRoot under C17), 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). Mint inputs (flags 03) resolve and consume no coin, so their (token_id, 0) field never enters the spent-outpoint set or any block, mempool or Snowstorm conflict check: two transactions minting the same token do not conflict through their mint inputs. 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. The token burn uses the fixed DUST_LIMIT base from the current schedule. Ordinary native output dust has its own indexing decision in C14c. A tighter online fee policy can require extra underclaim if that policy intends the surplus to burn.

C14b — Minimum native fee, indexed by subsidy per unit of work. Let v = ceil(MIN_FEE_PER_KB * len(Tx) / 1000), with MIN_FEE_PER_KB = 1000 and complete serialized transaction bytes (including witnesses). Every ordinary transaction in the block at height h MUST pay at least ByteFee = ceil_isqrt(floor(floor(v² · S_a · W_g / W_(a-1)) / T_g)) atoms, the ceiling integer square root of that integer radicand, where a = max(1, h - COINBASE_MATURITY), S_a is block a's subsidy B + T (C16) and W_(a-1) its parent's per-block work. This is v · √I_sub for the subsidy index I_sub = S · W_g / (T_g · W) of P05, read COINBASE_MATURITY blocks back so that every reorg shallower than coinbase maturity sees the same floor (a transaction paying exactly the floor must not become invalid in a reorg, and the lag costs nothing); at the calibration point I_sub = 1 it is exactly v. The rounding is fixed as stated: it can be one atom below ceil(v · √I_sub). C14a and this floor both apply. Coinbase pays its own byte/envelope charge K by reducing the claim under C16/P05, not by inventing an input fee; K is not indexed.

C14c — Native output minimum. Under the current rule, a spendable native output (flags 0x00 or 0x04) requires value >= DUST_LIMIT. Coinbase dust stays fixed. Ordinary native dust will be indexed to the cost of spending a coin once the derivation is specified. A native burn output may carry zero. Token outputs use the native fee burn in C14a.

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 decay shift $k_{\text{boot}} = 20$ and, approved as starting values that may change before genesis (owner decision 2026-11-18, launch plan; derivation in the issuance calibration), $B_0 = 150{,}000\text{ XPI} = 1.5 \times 10^{11}\text{ atoms}$, $R_0 = 2^{20} \cdot B_0 = 157{,}286{,}400{,}000\text{ XPI} \approx 1.5729 \times 10^{17}\text{ atoms}$, genesis tail $T_g = 378\text{ XPI}$ (approved), at genesis work $W_g = 1{,}800{,}000{,}641{,}450{,}944$ (target bits 0x1a280830, still recommended), 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} = \text{isqrt}(\lfloor T_g^2 W_n / W_g \rfloor)$, computed exactly (P06). The tail has no floor and no ceiling). 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}}$, cleaning-crew bounty for the $m$ expired coins selected by the expiry sweep be $\text{Bounty}_n = \min(m \cdot \text{CLEANING\_CREW\_REWARD},\ \lfloor F/2 \rfloor,\ G - \lfloor G/2 \rfloor)$, mandatory burned share of remaining fees be $\text{BurnedFees}_n = G - \lfloor G/2 \rfloor - \text{Bounty}_n$, 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 + \text{Bounty}_n$, computed once per block; the bounty moves part of the burned half of the fees to the coinbase, which can compensate the miner for sweep work. 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) + Bounty - U_required. Reject insufficient entitlement before subtraction. Coinbase-only blocks pay from subsidy. Explicit burn outputs do not satisfy this underclaim. Let Burn_explicit be the sum of value across all native IS_BURN outputs in the block and $\text{Burn}_{\text{expired}}$ the native value removed by the expiry sweep. The net spendable native supply change is $C - F - \text{Burn}_{\text{explicit}} - \text{Burn}_{\text{expired}} = S_n - B - U - \text{Burn}_{\text{explicit}} - \text{Burn}_{\text{expired}}$.

Expiry sweep

Coin lifespan applies from genesis. Each stored coin carries its fixed expiration_height from the Coin record rule. A coin cannot be spent in a block whose height is greater than or equal to its expiration height, including when an earlier block left it in the tree because of the sweep limit.

A block at height h takes its sweep from the parent's committed UTXO tree, excluding outpoints consumed by its own inputs. Consider coins with expiration_height <= h in ascending order of expiration height, breaking ties by the lexicographic bytes of OutpointKey. Erase the first 1,024 eligible coins, or all of them if fewer are due. An unswept coin stays in the tree for a later sweep. The state root commits to the resulting deletions, and disconnect restores the exact coin records.

Each removed coin counts toward the bounty. The base reward is 2,000 native atoms per coin (CLEANING_CREW_REWARD in the formula above), subject to the fee caps. Staking and treasury shares use a reward basis that excludes the bounty. The removed value of a native coin counts as expired native burn. A token coin's amount belongs to its asset. Current block validation requires the aggregate swept native value to fit MoneyRange. Confirm that bound against long-run supply before freezing it. Expired amounts contribute to neither the transaction fees nor the resource burn floor. The current cost calculation gives sweep erasures no separate cost-unit charge. A charge for that work remains an open pricing decision.

C16a — Per-amount money limit (recommended, awaiting owner sign-off). MAX_MONEY = 2^62 atoms (4,611,686,018,427,387,904 atoms, about 4.61 trillion XPI), replacing the inherited Bitcoin ABC limit of 21000000 * COIN. MoneyRange(v) holds when 0 <= v <= MAX_MONEY. A native output (spendable or IS_BURN) with value outside MoneyRange is invalid before any input is resolved, because its value counts in the transaction's checked output sum, and every native fee and stake amount must also be in MoneyRange. Every token amount in an output or mint is limited the same way, and an amount outside MoneyRange is invalid (owner decision 2026-11-19: 2^62 is enough for any token, and one limit for every amount keeps implementations simple). Consensus still keeps no total supply for a token across mints. This limits amounts, not supply: consensus keeps no supply total and never caps or clips issuance. Every sum of native amounts (transaction inputs and outputs, block fees, coinbase entitlement and payouts, stake totals) uses checked arithmetic and rejects on overflow; two amounts of MAX_MONEY already add to one past the signed 64-bit range. No parameter bounds total issuance, because the tail has no cap: with nothing burned, gross issuance after $Y$ years is at most $R_0 + 262{,}980 \cdot Y \cdot T(W_{\max})$, where $T(W_{\max})$ is the tail at the largest per-block work in that time. For the recommended values one block's tail reaches MAX_MONEY only at about $1.5 \times 10^{20}$ times the genesis work, and the 1,000-year total stays below MAX_MONEY while per-block work stays below about 2,000 times the genesis work (P06; the issuance calibration gives the numbers). A tail or entitlement that does not fit u64 is an open item in P06.

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 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. Every loop's bound is a runtime integer 0..256; a loop over inputs or outputs takes the transaction's count as its bound (TXINPUTCOUNT ENUMERATE, TXOUTPUTCOUNT ENUMERATE), and because C06 caps both counts at 256, one loop always covers the whole transaction. 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. cond depth OP_COND_BREAK checks the same depth, then exits likewise when the canonical Boolean cond is true and continues when it is false. 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. Advancing the chain does not change script evaluation. Minimum locks, relative locks and coinbase maturity remain satisfied on chain extensions. A transaction can become unspendable when a block consumes one of its inputs, an input reaches its expiration_height, or a reorganization removes its creating block. Admission checks whether the inputs are spendable at the next block height. The intended mempool and Snowstorm epoch policy would track the earliest input expiration to remove entries before selection. Its forward admission margin remains open.

A new block does not by itself call for script re-execution. Template builders still check inputs and aggregate fees against the candidate block's context, and assigning an extension point (C02) 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 the rationale for how time-sensitive contracts preserve this behavior.

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). P05 reads b from the instruction immediately before ENUMERATE in the same sequence: the input or output count after TXINPUTCOUNT or TXOUTPUTCOUNT, the value of a numeric literal in 0..256, and otherwise 256 even when the runtime bound is smaller. 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. One cu is one tagged BLAKE3 hash of a two-compression message, and every other weight is $\lceil 1.5 \times$ its worst measured ratio to that hash$\rceil$ (P05). All wire bytes (2 cu per wire byte), 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 knee shift $S_{\text{tx\_knee}} = 18$, i.e. $2^{18} = 262{,}144\text{ cu}$, approved), 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 (C06's 256 inputs and 256 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)$ ($w = 10$, $E_0 = E_{\min} = 2^{34}$ cu, $S_{\text{linear}} = S_{\text{quad}} = 32$, approved). 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 R_n = L_{\text{own}} + L_{\text{tx}} + Q$$

with $M = \max(E_n, E_{\min})$, $C_{\text{own}}$ the envelope of a coinbase-only block ($N = 1$, $F = $ the coinbase's frame prefix) plus the coinbase's $C_{\text{tx}}$, $C_{\text{txs}} = C_{\text{block}} - C_{\text{own}}$, and:

A block with $C_{\text{block}} \ge 2^{64}$ is invalid: $Q \ge 2^{96}$ there, more than any block can burn. Every other block's radicand is below $2^{308}$ and is computed in u384 (P05). There is no fee EMA, no clamp and no new MonetaryState field. 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 (split into its own and transaction parts the same way), 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 (226 assigned opcodes / 30 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; cu unit, primitive weights and shift constants ($S_{\text{tx\_knee}} = 18, w = 10, E_0 = E_{\min} = 2^{34}, S_{\text{linear}} = S_{\text{quad}} = 32$) approved; burn floor and C14b byte fee indexed by $\sqrt{I_{\text{sub}}}$ (subsidy per unit of work), decided; state-key price a placeholder pending measurement; ratio cross-check on a second machine pending; indexing ordinary dust, the token burn and rent open
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; approved starting values $B_0 = 150{,}000\text{ XPI}$, $R_0 = 2^{20} B_0$, $T_g = 378\text{ XPI}$, owner decision 2026-11-18, may change; the 0x1a280830 genesis target and the per-amount limit MAX_MONEY = 2^62 with no supply cap (C16a) still recommended, awaiting owner sign-off); simulation confirmation and a measured discrete-GPU hash rate 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 with 0 < W_g < 2^128, 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 rounding, the open u64 overflow item 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.