On this page
  1. §0 The area in one paragraph
  2. 1. The registry row, the three statuses and the reads the protocol makes of them
  3. 2. Proof of ownership
  4. 3. NodeRegistration (2)
  5. 4. NodeRegistrationUpdate (258)
  6. 5. RemoveNodeRegistration (514): the exit
  7. 6. ClaimNodeRegistration (770)
  8. 7. QueueAttendance (59)
  9. 8. The admission timer
  10. 9. Queue order and the attendance gate
  11. 10. Admission, and the resume admission
  12. 11. Expulsion and the return of the stake
  13. 12. Maturity
  14. 13. Status transitions, and what is consensus here
  15. 14. RollCall (61): the roll call at a chain's start

09 — The node registry: registration, update, removal, claim, the admission queue and maturity

Edition 0.6.1 · verified against the reference implementation, version 0.6.1

Out of scope genesis registrations and the genesis admission row (06 §9); the blocksmith draw, the liveness counters, suspension and the floor as applied per block (20, 36); participation-score changes, the coinbase lottery and the longevity pool (21); the survival flag itself (19, 36); the gateway, archival and relay registries (17); receipts (23); the spine's view of registry changes (25); the HTTP routes that show the registry (31)

§0 The area in one paragraph

A node is a 32-byte Ed25519 key that an owner account registers by locking a stake of at least the queue's entry minimum and proving, with a signature made by that key over the owner's account and a recent block, that it holds the key. The registration enters a queue; a chain-wide admission timer fires at intervals set by the genesis parameters and the number of counted registered nodes (registered and not suspended, genesis registered nodes counted at most eleven), and each firing admits at most one queued node, the one with the largest stake × blocks waited. An admitted node is active: it is drawn to produce blocks, scored, paid once it is mature, and expelled when its score reaches zero on the score road of 36. Every way out of the registry is consensus and none destroys ZBC: an expulsion returns 90 % of the lock at once and gives 10 % to the longevity pool; an owner's exit of an active registered node keeps the node registered and producing for a hold of exit_cooldown_blocks and then returns the whole lock, or 90 % when the registered node was missing, suspended or missed a turn; leaving the queue by any door costs 10 % and returns the rest after the same hold; a stranger's claim with the node key executes 40,320 blocks after it is announced. An owner may rotate a registered node's key, which takes effect 120 blocks after its block. A queued node must attend every 5,760-block window (any on-chain sign counts) or be dropped; a registered node that is suspended may send the same type-59 transaction as a fee-free ping. At a chain's start each genesis registered node answers a roll call (type 61) in the first roll_call_blocks blocks or leaves the registry. Owners are typed accounts (07 §3.1); a node signs its duties (attendance, ping, roll call) as its typed node-key account 00000000 ‖ node key. Every decision here is consensus: the registry rows are carried by snapshots, the active set at a height decides who may have produced a block, and the registry step runs on every node after every block; a read or write that fails in it refuses the block on that node.

1. The registry row, the three statuses and the reads the protocol makes of them

Purpose. The state every other mechanism of this area writes and reads.

Inputs. The node key, the owner account, the locked stake, the block height.

Output and effect. Record set node_registry, versioned per 07 §2, key id, version column height, one row per (id, height) (a second write of the same id in one block replaces the row at that height). The current row is the one marked latest; the row in effect at height h is the newest with height ≤ h.

Column Type Meaning
id i64 node_id = the little-endian u64 of the first 8 bytes of the node key with the top bit cleared (& 0x7FFFFFFFFFFFFFFF)
node_public_key 32 bytes the node key, as given
account_address bytes the owner: the typed account of the registering transaction's executing sender (a member registers for its group, 18), or the body's account at genesis
registration_height u32 the height of the (re-)registering transaction; 0 for a genesis registered node
locked_balance i64 the stake, atomic units; 0 once Deleted
registration_status u32 0 Registered (active), 1 Queued, 2 Deleted
latest 0/1 07 §2
height u32 version height

The reads the protocol makes:

  • active now: the latest rows with status 0, in id order.
  • active at height h: of the newest row per id with height ≤ h, those with status 0, in id order (for h ≤ 1 the bound is height ≤ 1). A failed read is an error that fails the block; current state is never substituted for the state at h.
  • queued now / at h: status 1, the latest rows or the newest per id at or below h.
  • counted at height h: the active rows at h less the nodes suspended at h (36), in id order: the admission pace (§8), the price votes (17), the bridge and oracle two-thirds counts.
  • by key at H: the newest row with that node_public_key and height ≤ H (two rows at one height: the one with the greater id, rule one_node_per_owner); it does not resolve when the same id has a newer row at or below H naming another key (the old key of a rotated registered node, §4, stops resolving from the rotation's due height); a failed read of that newer row is an error, never a resolution.
  • by owner at H: the newest row whose account_address equals the given typed account byte for byte, height ≤ H; two rows at one height: the one with the greater id (rule one_node_per_owner, so every node answers the same row). A bare 32-byte key names no owner. Under one_node_per_owner an owner holds at most one non-Deleted node (§3), so the tiebreak only ever decides between a node's Deleted rows and a re-registration in one block.
  • changes in a height range (the spine, 25): rows with height in the range, status ≠ 1, latest, by height.

Companion record sets of this area (full schema in 07 §1):

Set Key Versioned Columns and meaning
queue_state node_id yes, by height misses, waited_from_height, last_window: a queued node's attendance record (§9)
queue_attendance (node_id, window) no height: one row per attended window; the ping uses windows from 2³⁰ up (§7)
node_admission_timestamp block_height yes (keyless: the newest row is current) timestamp: the next admission instant (§8)
node_claim (node_id, height) no node_public_key, claimer, tx_id, fee, due_height, status 0 announced / 1 executed or void (§6)
lock_release (node_public_key, height) no, indexed by release_height account_address, amount, fee, slashed, transaction_id, release_height: a queued node's held exit (§5)
node_exit (node_id, height) no account_address, tx_id, announced_height, leave_height, missing_at_exit 0/1, status 0 leaving / 1 left / 2 ended (§5)
seat_change (node_id, height) no new_node_public_key (empty = unchanged), new_account_address (empty = unchanged), tx_id, due_height, status 0 announced / 1 applied / 2 void (§4)
roll_call node_id no answered 0/1, height (§14)
liveness_expulsion (node_public_key, height) no node_id, score: an expulsion at score zero (§11)
participation_score, node_liveness node_id yes written here at admission (§10); rules in 21, 36

For the append-only sets the state at height h of one node is its newest row at or below h; a rollback deletes every row above the target (07 §10).

How to compute it. As stated; the id derivation is the only arithmetic.

Rule activation. one_node_per_owner (the same-height tiebreak): active from height 0 on every chain.

Rejections and errors. None here; the writers of §3–§14 decide.

Vector. computed from the TestNet genesis file (06 §6): eleven node entries, each a node_registry row with registration_height 0, locked_balance 0, registration_status 0, height 0. Its first entry ZNK_OFPKRYXV_DO6LO6FC_NZU5OO6R_ARH6HJB5_O3FRZ5WL_YOU2MYNC_7OWAOVEQ decodes (01 §5) to the key 715EA8E2F51BBCB778A26E69D73BD1044FE3A43D76CB1CF6CBC3A9A661A2FBAC → EXPECTED id 4,016,115,710,591,262,321 (= LE u64 of 715EA8E2F51BBCB7 = 0xB7BC1BF5E2A85E71 with the top bit cleared, 0x37BC1BF5E2A85E71); its second entry ZNK_QHQ776AK_Z7IM5FCA_QOB4VUHF_YUKBQKMY_XWI6S5FQ_REXZZSH6_H3OYYGWA = key 81E1FFF80ACFD0CE94408383CAD0E5C514182998BD91E974B0892F9CC8FE3EDD → 5,679,266,776,148,337,025 (0xCED0CF0AF8FFE181 with the top bit cleared). computed: the keys 715EA8E2F51BBCB7 ‖ 24 × 00 and 715EA8E2F51BBC37 ‖ 24 × 11 both give id 4,016,115,710,591,262,321 (they differ only in the top bit of byte 7): a collision (§3 refuses the second).

Test cases · §1

5 cases · 5 valid · 1 reference

The eleven node entries of the TestNet genesis file as registry rows09-1-genesis-rowsvalidreference

A stated value: there is nothing to compute. A compatible node shows the same value.

rows
11
registration_height
0
locked_balance
0
registration_status
0
height
0
The node id of the TestNet genesis file's first node key09-1-id-715evalid

Loading the test widget…

The node id of the TestNet genesis file's second node key09-1-id-81e1valid

Loading the test widget…

A key 715EA8E2F51BBCB7 ‖ 24 × 0009-1-collision-avalid

Loading the test widget…

A key differing only in the top bit of byte 7 has the same id09-1-collision-bvalid

Loading the test widget…

Defects to match. (1) Two keys sharing their first 8 bytes (or differing only in the top bit of byte 7) collide on id; the second registration is refused at admission and is a paid no-op in a block (§3). (2) A Deleted row keeps the old registration_height and account_address; a re-registration overwrites both (§3).

2. Proof of ownership

Purpose. The node key's attestation that it belongs to the sender, carried in the bodies of NodeRegistration, NodeRegistrationUpdate and ClaimNodeRegistration.

Inputs. The raw bytes after the fixed fields of those bodies; the transaction's sender; the validating node's main chain.

Output and effect. Layout (n = the account payload length of the type, 01 §4.1):

Offset Length Field Encoding
0 4 account_type i32 LE; a type that can sign: 0, 1, 4, 5, 6, 7, 9, 11, 12, 13, 14, 15, 16 (08 §3)
4 n account_key 32 for types 0, 9, 11, 12; 28 for 13; 20 for 1, 4, 5, 6, 7, 14, 15, 16
4+n 32 block_hash hash of a recent main-chain block
36+n 4 block_height u32 LE, that block's height
40+n 64 signature Ed25519 by the node key over bytes 0 … 39+n, raw (no prefix, no hash)

The proof is exactly 40 + n + 64 bytes; for a ZBC owner the message is 72 bytes and the proof 136. It is accepted when all of these hold, checked in this order:

  1. the proof is at least 68 bytes, and its length equals 4 + n + 32 + 4 + 64 for the type in its first 4 bytes;
  2. the message is non-empty, the signature is 64 bytes, the node key is 32 bytes, and the signature verifies for the node key over the raw message;
  3. account_type is a type that can sign, and the message holds 4 + n + 36 bytes;
  4. the account in the message (bytes 0 … 3+n) equals the transaction's sender byte for byte;
  5. with tip = the validating node's highest main-chain height: not (tip > block_height and tip − block_height > 720) (POOWN_EXPIRATION_BLOCKS = 720); every path that judges a block (sync, fork resolution after its pop, block selection, the catch-up after a fast sync, the blocksmith) runs with the tip at the judged block's parent, so tip = h − 1 for a block at h;
  6. the main-chain block at block_height exists locally and its hash equals block_hash.

How to compute it. The node signs the 40 + n message bytes with its Ed25519 secret key (detached signature). Presence: under rule poown_required a NodeRegistration and a NodeRegistrationUpdate must carry a proof; a ClaimNodeRegistration must at every height. A sender equal to the genesis account 00000000 042643FD5C5F3B64BD6B38882F7727FDC5D6EEE3C354F3AB9D7B8FF7C1840140 skips the whole NodeRegistration and NodeRegistrationUpdate validation, proof included.

Rule activation. poown_required: active from height 0 on every chain.

Rejections and errors. Admission and block validation alike: "NodeRegistration: proof of ownership required (rule poown_required)" (or UpdateNodeRegistration: …), "Proof of ownership too short", "Proof of ownership has the wrong size for its account type (expected N bytes, got M)", "POOWN message is empty", "Invalid POOWN signature", "Invalid node public key size", "InvalidAccountType", "InvalidProofOfOwnershipMessage", "ProofOfOwnership account does not match transaction sender", "ProofOfOwnershipExpired", "InvalidBlockHash", "Proof of ownership required for claim". Node-local: a competing block received by broadcast at a height at or below the local tip is pre-judged against that higher tip, so a proof exactly 720 blocks old can be refused there; fork resolution judges the same block against its parent.

Vector. computed (a chain whose main-chain block 12,000 has the hash 9E64FF1D61634290A9D43E076AE7CFEB27F22E8EA803EFD15064888080D954B5; the node key is the Ed25519 public key of the seed 01 × 32). INPUT node key 8A88E3DD7409F195FD52DB2D3CBA5D72CA6709BF1D94121BF3748801B40F6F5C (ZNK_RKEOHXLU_BHYZL7KS_3MWTZOS5_OLFGOCN7_DWKBEG7T_OSEADNAP_N5OFMWVV), sender 000000007D8BD8A41DCEEA4986D1E99DFE99CA9303874B7C3AAC7EEECD60A82F61902572, validating tip 12,466, proof (136 bytes) = message 000000007D8BD8A41DCEEA4986D1E99DFE99CA9303874B7C3AAC7EEECD60A82F61902572 9E64FF1D61634290A9D43E076AE7CFEB27F22E8EA803EFD15064888080D954B5 E02E0000 ‖ signature 22B41BD55E92A5B4F4AEBA93AC5635E0D64EC7E01781AEFBF2AF5E61349DAD13DB6FF2A4A284D6E1D7CFE67C39A46B1D7905AAB621BC0A5C497786550CB1980A → EXPECTED accepted (the signature verifies over the 72 raw bytes; 12,466 − 12,000 = 466 ≤ 720). INVALID: the same proof with sender 00000000 ‖ 32 × 11 → "ProofOfOwnership account does not match transaction sender"; the same proof judged at tip 12,721 → "ProofOfOwnershipExpired"; the same proof with the last signature byte 0B → "Invalid POOWN signature"; the proof cut to 135 bytes → "Proof of ownership has the wrong size for its account type (expected 136 bytes, got 135)"; the same proof on a chain whose block 12,000 has another hash → "InvalidBlockHash".

Test cases · §2

7 cases · 2 valid · 5 invalid

A proof signed over the 72 raw message bytes, 466 blocks old09-2-acceptedvalid

Loading the test widget…

The same proof with another sender is refused09-2-other-senderinvalid

Loading the test widget…

The same proof judged at tip 12,721 is expired09-2-expiredinvalid

Loading the test widget…

The same proof judged at tip 12,720 (720 blocks) is accepted09-2-at-720valid

Loading the test widget…

The same proof with its last signature byte changed is refused09-2-bad-siginvalid

Loading the test widget…

The proof cut to 135 bytes is refused09-2-shortinvalid

Loading the test widget…

The same proof on a chain whose block 12,000 has another hash is refused09-2-wrong-blockinvalid

Loading the test widget…

Defects to match. None.

3. NodeRegistration (2)

Purpose. Lock a stake and put a node key in the queue (at genesis, straight into the active set, 06 §6).

Inputs. Body:

Offset Length Field Encoding
0 32 node_public_key the node's Ed25519 key
32 4 account_type i32 LE (01 §4)
36 n account_key the type's payload; this account is the owner only at genesis
36+n 8 locked_balance i64 LE, the stake
44+n rest proof of ownership §2

Envelope recipient: empty. Fee ≥ 2,500,000 (MIN_NODE_REGISTRATION_FEE; the floor of 04 §2 is never lower). Genesis parameters: min_node_registration_balance (the voted queue minimum's start; TestNet 10,000,000,000 = 100 ZBC, DevNet 100,000,000 = 1 ZBC), its ceiling min_node_registration_balance_ceiling (TestNet 25,000,000,000, DevNet 250,000,000) and queue_median_fraction_bps (5,000 on both).

Output and effect. Sender: balance −(fee + locked_balance); a ledger row event 2 for −(fee + locked); a new node_registry row at this height with id from the key, owner = the executing sender (the group for a member; the body's account is ignored above genesis), registration_height = this height, the stake, status 1 Queued (status 0 only at height 0); a previous Deleted row of the same id loses latest. When the key re-registers over a Deleted row a fresh queue_state row is written for the id (misses 0, wait from this height; rule queue_state_reset). Then the fee settlement of 04 §5 (declared − floor back as event 22).

How to compute it.

  1. Stateless (admission and block validation; skipped for the genesis account): the fee floor of 04 §2 comes first, as for every type ("Transaction fee too low"; at the starting fee scale this floor is never below 2,500,000 for a registration, so a fee below 2,500,000 gets this text); then fee ≥ 2,500,000 ("Node registration fee too low", reached only when a voted fee scale puts the floor below 2,500,000); body ≥ 32 ("Invalid NodeRegistration transaction body"); parse ("NodeRegistration body too short" below 36 bytes, "NodeRegistration body too short for account address + balance"); locked_balance ≥ 1 ("Node registration locked balance must be at least one atomic unit"); the proof per §2.
  2. Admission only, as of the target height: the key has no non-Deleted row ("NodeRegistration: node public key already registered"); no other key holds this key's node id ("NodeRegistration: the node id N (this key's first 8 bytes) is held by another node key; use another node key"); the owner — the sender's balance holder, its group for a member — has no non-Deleted node ("NodeRegistration: this account already has a registered node"); locked_balance ≥ the entry minimum ("NodeRegistration: the stake (S) is below the queue's entry minimum (M): the voted queue minimum or half the median queued stake, whichever is higher"). A body that does not parse: "NodeRegistration: invalid body".
  3. The entry minimum at height h = max(V, ceil(f × median / 10,000)), where V = the voted queue minimum (the stored min_node_registration_balance held to 1 … the ceiling; 17), f = queue_median_fraction_bps held to 0 … 10,000, and median = the median locked_balance of the nodes queued as of h (a negative stake reads as 0; an even count takes the mean of the two middle stakes: the result is ceil(twice_median × f / 20,000) in 128-bit arithmetic); an empty queue or f = 0 gives V. A queue that cannot be read is an error that fails the block.
  4. Execution: parse; locked_balance ≤ 0 → block invalid ("Invalid locked balance"); at height > 0, each a paid no-op checked before any debit, in this order: a non-Deleted row for the key as of this height; a non-Deleted node owned by the sender's balance holder as of this height (rule one_node_per_owner: one owner, one node); another key holding this key's node id; locked_balance < the entry minimum as of this height. Then total = fee + locked (an overflow is refused: block invalid); the sender row must exist ("Sender account not found", block invalid); the confirmed balance ≥ total ("Insufficient balance for node registration", block invalid); debit; ledger row; register.

Rule activation. state_answer_noop, poown_required, queue_state_reset, one_node_per_owner: active from height 0 on every chain. The type has no gate.

Rejections and errors. As listed.

Vector. computed (the keys and the proof of §2). INPUT body (212 bytes): 8A88E3DD7409F195FD52DB2D3CBA5D72CA6709BF1D94121BF3748801B40F6F5C 000000007D8BD8A41DCEEA4986D1E99DFE99CA9303874B7C3AAC7EEECD60A82F61902572 00E40B5402000000 (10,000,000,000 = 100 ZBC) ‖ the 136-byte proof of §2; sender 000000007D8BD8A4…61902572; fee 5,000,000; floor F (from 04 §2); empty queue; V = 10,000,000,000. EXPECTED: sender −10,005,000,000 (event 2), +(5,000,000 − F) (event 22); registry row id 1,581,055,341,727,287,434 (= LE u64 of 8A88E3DD7409F195 = 0x95F10974DDE3888A with the top bit cleared), owner 000000007D8BD8A4…61902572, stake 10,000,000,000, status 1, registration_height = the block's height. INVALID: the same body with stake FFE30B5402000000 (9,999,999,999) → admission "NodeRegistration: the stake (9999999999) is below the queue's entry minimum (10000000000): the voted queue minimum or half the median queued stake, whichever is higher", and in a block a paid no-op (fee charged, nothing locked). INPUT a second registration by the same sender while that node is Queued or Registered, with another key → admission "NodeRegistration: this account already has a registered node"; mined anyway → a paid no-op (fee charged, nothing locked, no row). Entry minimum, computed: with three nodes queued at 10,000,000,000, 15,000,000,000 and 40,000,000,000 and V = 10,000,000,000 → median 15,000,000,000 → minimum max(10,000,000,000, 7,500,000,000) = 10,000,000,000; queued at 40,000,000,000, 50,000,000,000 and 60,000,000,000 → 25,000,000,000; queued at 40,000,000,000 and 50,000,000,001 (even count) → ceil(90,000,000,001 × 5,000 / 20,000) = 22,500,000,001.

Test cases · §3

18 cases · 9 valid · 9 invalid · 2 reference

A NodeRegistration body staking 100 ZBC09-3-bodyvalid

Loading the test widget…

The registered node's id from its key09-3-id-8a88valid

Loading the test widget…

The registration passes the stateless checks09-3-validvalid

Loading the test widget…

A registration without a proof is refused09-3-no-proofinvalid

Loading the test widget…

A registration staking nothing is refused09-3-zero-stakeinvalid

Loading the test widget…

A registration with a fee below 2,500,000 is refused09-3-fee-lowinvalid

Loading the test widget…

The registration is admitted on an empty queue09-3-first-nodevalid

Loading the test widget…

A second registration by the same owner, its first node queued, is refused at admission09-3-second-nodeinvalid

Loading the test widget…

A second registration by the same owner, its first node registered, is refused at admission09-3-second-node-registeredinvalid

Loading the test widget…

A registration by an owner whose only node is Deleted is admitted09-3-after-deletedvalid

Loading the test widget…

A registration of a key another account holds is refused at admission09-3-key-registeredinvalid

Loading the test widget…

The same body staking 9,999,999,999 is refused at admission09-3-below-minimum-admissioninvalid

Loading the test widget…

The registration's effect09-3-effectvalidreference

A stated value: there is nothing to compute. A compatible node shows the same value.

sender
−10,005,000,000 (event 2), +(5,000,000 − F) (event 22)
id
1581055341727287434
status
1
A second registration by the same owner mined anyway09-3-second-node-minedinvalidreference

A stated value: there is nothing to compute. The statement is a refusal: what a compatible node does with this input.

result
paid no-op: the fee charged, nothing locked, no row
A stake of 9,999,999,999 below an entry minimum of 100 ZBC is refused at admission09-3-below-minimuminvalid

Loading the test widget…

Entry minimum over three queued stakes of 100, 150 and 400 ZBC09-3-min-oddvalid

Loading the test widget…

Entry minimum over three queued stakes of 400, 500 and 600 ZBC09-3-min-highvalid

Loading the test widget…

Entry minimum over an even queue rounds up09-3-min-evenvalid

Loading the test widget…

Defects to match. (1) The body's owner account is parsed to find the stake's offset and otherwise ignored above genesis: a body naming someone else's account registers the node to the sender. (2) The admission checks run in the order key, id, owner, minimum; the executor's in the order key, owner, id, minimum: only the refusal text at admission depends on it.

4. NodeRegistrationUpdate (258)

Purpose. Raise a node's stake, and rotate its node key.

Inputs. Body:

Offset Length Field Encoding
0 32 node_public_key the key the proof of a plain update is checked against
32 8 locked_balance i64 LE, the new total stake
40 m proof of ownership §2; m = message_size(type) + 64, fixed by the account type at its head
40+m 0 or 32 new_node_public_key present iff exactly 32 bytes follow the proof (rule node_key_rotation)

The split is unambiguous: when at least 68 bytes follow offset 40, the proof length m is read from the type; a remainder of exactly m + 32 carries a new key, a remainder above m that is not m + 32 is refused ("UpdateNodeRegistration: trailing bytes after the proof are not a 32-byte node key").

Output and effect. delta = new − current; sender −(delta + fee), ledger event 3 for −(delta + fee) (no row when the sum is 0); a new version row of the sender's node at this height with the new stake (key, status and registration_height unchanged); then 04 §5. delta may be 0: a rotation that does not raise the stake costs only the fee; a genesis registered node (which locks nothing) rotates its key with locked_balance 0.

Key rotation. The update's block also writes the key change row seat_change(node_id, new_node_public_key, new_account_address = empty, tx_id, due_height = this height + SEAT_CHANGE_DELAY_BLOCKS (120), status 0, height). At due_height, first in that block's registry step (before the claims), the change is applied: a versioned node_registry row naming the new key (merged with any row this block already wrote at that height) and the change's status 1. It is void (status 2) when the registered node was Deleted at any height since the announcement, or another non-Deleted registered node holds the new key by then. Until the due block the registered node keeps its old key everywhere a key is read (the draw, block signatures, receipts, duties, claims). The id (from the old key) is kept: the registered node keeps its identity, score, queue state and admission. One change may be pending per registered node.

How to compute it.

  1. Stateless (genesis account exempt): body ≥ 40 ("UpdateNodeRegistration body too short"); the split above. Without a new key: the proof per §2, signed by node_public_key. With one: rule node_key_rotation active ("UpdateNodeRegistration: a new node key needs rule node_key_rotation"), the new key 32 bytes ("UpdateNodeRegistration: the new node key must be 32 bytes"), different from node_public_key ("UpdateNodeRegistration: the new node key is the current one"), and the proof verifies under the new key and names the sender (§2 steps 1–6).
  2. Admission only, as of the target height: the sender owns a node ("UpdateNodeRegistration: sender does not own a registered node"), not Deleted ("UpdateNodeRegistration: cannot update a deleted node"), new ≥ current ("UpdateNodeRegistration: cannot decrease locked balance"), not leaving (§5; "UpdateNodeRegistration: the registered node is leaving (it leaves the registry at height H)"); for a new key different from the registered node's: no change pending ("UpdateNodeRegistration: a key change is already pending for this registered node (it takes effect at height H)") and no non-Deleted registered node holding the key ("UpdateNodeRegistration: the new node key is already registered").
  3. Execution (rule one_node_per_owner): the node that the body's node_public_key names, as of this height, by key (§1); its account_address must equal the executing sender's balance holder (the group for a member). Not found, owned by another account, Deleted, leaving, new < current, a change already pending, or a new key another registered node holds → paid no-op of the whole update (the fee charged; an unpayable fee → nothing happens). Otherwise the version row is written (and, for a rotation, the seat_change row), then deduct = delta + fee (overflow → block invalid); a confirmed balance < deduct → "Insufficient balance for update", block invalid; debit; ledger row.

Rule activation. poown_required, node_key_rotation, one_node_per_owner: active from height 0 on every chain. The 120-block delay is a constant of the protocol.

Rejections and errors. As listed.

Vector. computed (the keys and the proof message of §2). INPUT (stake raise): sender 000000007D8BD8A4…61902572 owns node 8A88E3DD…B40F6F5C with stake 10,000,000,000; body (176 bytes) 8A88E3DD7409F195FD52DB2D3CBA5D72CA6709BF1D94121BF3748801B40F6F5C 00D6117E03000000 ‖ the 136-byte proof of §2 (new total 15,000,000,000); fee 5,000,000, floor F. EXPECTED: sender −5,005,000,000 (event 3), +(5,000,000 − F) (event 22); the node's row at this height: stake 15,000,000,000. INPUT (rotation, delta 0; the new key is the Ed25519 public key of the seed 02 × 32): body (208 bytes) 8A88E3DD7409F195FD52DB2D3CBA5D72CA6709BF1D94121BF3748801B40F6F5C 00E40B5402000000 ‖ message 000000007D8BD8A4…61902572 9E64FF1D…80D954B5 E02E0000 ‖ signature by the new key A8616202FEF28E2E2FAE9465BEAF1763C5D0DAED3FE2771A676A66870E66E354459E37775E74612F996CE44755BA7919D54930CC5405CBA6D095009F86BE4B01 ‖ new key 8139770EA87D175F56A35466C34C7ECCCB8D8A91B4EE37A25DF60F5B8FC9B394 (ZNK_QE4XODVI_PULV6VVD_KRTMGTD6_ZTFY3CUR_WTXDPIS5_6YHVXD6J_WOKL2FHE); mined in block h. EXPECTED: a seat_change row due at h + 120; at block h + 120 the registry row names the new key at id 1,581,055,341,727,287,434 (the id never changes: the new key's own first 8 bytes, 6,852,083,518,818,171,265, play no part). INVALID: the same body with 31 bytes after the proof → "UpdateNodeRegistration: trailing bytes after the proof are not a 32-byte node key"; with the new key equal to 8A88E3DD…B40F6F5C → "UpdateNodeRegistration: the new node key is the current one"; the stake-raise body mined from an account that is not the node's owner → a paid no-op.

Test cases · §4

11 cases · 7 valid · 4 invalid · 1 reference

A stake raise to 150 ZBC09-4-bodyvalid

Loading the test widget…

The stake raise passes the stateless checks09-4-raisevalid

Loading the test widget…

The stake raise mined from the node's owner09-4-raise-minedvalid

Loading the test widget…

The stake raise mined from an account that is not the node's owner is a paid no-op09-4-raise-not-ownerinvalid

Loading the test widget…

A key rotation that keeps the stake09-4-rotation-bodyvalid

Loading the test widget…

The rotation, its proof signed by the new key, passes the stateless checks09-4-rotationvalid

Loading the test widget…

The new key's own node id, which the rotation does not use09-4-id-8139valid

Loading the test widget…

A rotation with 31 bytes after the proof is refused09-4-rotation-31invalid

Loading the test widget…

A rotation to the current key is refused09-4-rotation-sameinvalid

Loading the test widget…

An update body of 39 bytes is refused09-4-shortinvalid

Loading the test widget…

The rotation takes effect 120 blocks after its block09-4-effectvalidreference

A stated value: there is nothing to compute. A compatible node shows the same value.

value
a seat_change row due at h + 120; at h + 120 the registry row names the new key at id 1,581,055,341,727,287,434

Reference behaviour to match

Defects to match. (1) ⚠ DEFECT: admission judges the update against the sender's own node (the newest row whose owner is the raw sender), not the node the body names, and without group resolution: a member's update of its group's node is refused at admission ("UpdateNodeRegistration: sender does not own a registered node") and applied when mined, and a body naming another owner's key passes admission on the sender's node and is a paid no-op when mined. (2) A new key whose first 8 bytes equal an unrelated registered node's id is not refused (the check is by key, not by id).

5. RemoveNodeRegistration (514): the exit

Purpose. The owner takes the node out of the registry or the queue and recovers the stake after the hold.

Inputs. Body: node_public_key (32 bytes; longer bodies are accepted, the rest ignored). Genesis parameters exit_cooldown_blocks (TestNet 40,320, DevNet 1,680; a stored value below 1 reads as 1) and node_lock_at_risk_bps (1,000 = 10 % on both). F = the transaction's minimum fee (04 §2) clamped to 0 … fee; the lock pays F when F > 0 and lock − F > 0.

Output and effect. Two roads, by the node's status as of this block.

An active (Registered) node whose owner sends it — the exit hold (owner = the registry row's account equals the sender byte for byte). The registered node is leaving: it stays Registered, selectable, drawn, scored and paid like any registered node until leave_height = this height + exit_cooldown_blocks. In the exit's block:

  • when the lock pays F: a new registry row at this height carries locked_balance − F, F is credited to the longevity pool (event 80, naming the exit) and the sender's rows are 22 +fee / 47 −fee (04 §5: the balance pays nothing); otherwise (a genesis registered node locks nothing) the owner's balance pays the fee as for any type, with the refund of 04 §5 (an unpayable fee → an unpaid no-op);
  • a node_exit row (node_id, owner, tx_id, announced_height = h, leave_height, missing_at_exit, status 0, height = h), where missing_at_exit = the registered node's newest liveness row at or below h shows it missing or suspended (36; a miss charged earlier in this block's own steps counts; no row: not missing).

At block leave_height, after that block's liveness step and its expulsions, every registered node whose newest node_exit row is leaving and due leaves: when it is still Registered, missed = missing_at_exit, or its liveness row's last_miss_height ≥ announced_height; share = missed ? floor(lock × node_lock_at_risk_bps / 10,000) : 0 of the lock as the leave block finds it; the share is credited to the longevity pool (event 76, naming the exit); lock − share is credited to the owner by a plain credit (no split policy; event 4, the exit's transaction id, the block's timestamp); a registry row Deleted with stake 0; the node_exit row status 1. A registered node that left another way during the hold (expelled, removed by the roll call) has its exit ended (status 2) and nothing more: the other road's rule alone applies. During the hold the registered node refuses a second exit, any update and any claim; a key change announced before the exit still takes effect at its due block.

A queued node. A registry row Deleted with stake 0 is written. When the lock pays F: the at-risk share floor(lock × node_lock_at_risk_bps / 10,000) (a queued node always pays it, capped at lock − F) goes to the longevity pool (event 76), F goes to the pool (event 80), held = lock − share − F is written into lock_release(node_public_key, owner, amount = held, fee = F, slashed = share, transaction_id, release_height = h + exit_cooldown_blocks, height = h); the sender's rows are 22 +fee / 47 −fee; no balance moves in this block. The block at release_height (registry step, in key order) credits each owner its amount (plain credit, event 4, the removal's id, the block's timestamp). When the lock cannot pay F: the declared fee is netted from the lock and the owner's balance is debited fee − lock when the fee exceeds it; the rows are 4 +lock and 1 −fee; the fee counts as collected, so the settlement of 04 §5 returns everything above the minimum. When the fee exceeds the lock and the owner's confirmed balance is below fee − lock, the removal is an unpaid no-op, decided before anything is written.

How to compute it.

  1. Stateless: nothing beyond the envelope.
  2. Admission only (as of the target height): parse ("RemoveNodeRegistration: invalid body"), the key is registered ("RemoveNodeRegistration: node not registered"), owner = sender ("RemoveNodeRegistration: sender is not the node owner"), not Deleted ("RemoveNodeRegistration: node already deleted"), not leaving ("RemoveNodeRegistration: the registered node is leaving (it leaves the registry at height H)").
  3. Execution: parse (< 32 bytes → block invalid, "RemoveNodeRegistration body too short"); the node by key as of this height. Registered and owned by the sender → the exit hold (already leaving → paid no-op). Queued, owned by the sender, a lock that cannot pay F, fee > lock and a balance below fee − lock → unpaid no-op. Otherwise the removal: not found, owner ≠ executing sender, or Deleted → paid no-op (an unpayable fee → nothing happens); else the queued road. A failed read or write fails the block.

Rule activation. None.

Rejections and errors. As listed; a leave, a release or a hold whose credit cannot be made fails the block.

Vector. computed (TestNet; INPUT a registered node locking 10,000,000,000, exit at height 1,000, fee 5,000,000, F = 2,500,016). EXPECTED: at 1,000 the lock becomes 9,997,499,984, the pool +2,500,016 (event 80), the owner rows 22 +5,000,000 / 47 −5,000,000; the registered node produces until height 41,320; at 41,320 with no miss in the hold the owner gets +9,997,499,984 (event 4); with one miss (or missing at the exit) the pool gets 999,749,998 (event 76) and the owner 8,997,749,986. INPUT a queued node with the same lock and fee: EXPECTED at 1,000 the pool +1,000,000,000 (event 76) and +2,500,016 (event 80), lock_release amount 8,997,499,984 due at 41,320. INPUT a queued node locking 2,000,000 with fee 5,000,000 and F = 2,500,016: the lock cannot pay F; with the owner's balance ≥ 3,000,000 EXPECTED rows 4 +2,000,000 and 1 −5,000,000, then the refund of 2,499,984 (event 22); with a balance of 2,999,999 an unpaid no-op. INVALID (admission): a body naming a key whose owner is another account → "RemoveNodeRegistration: sender is not the node owner"; a 31-byte body in a block → block invalid.

Test cases · §5

8 cases · 6 valid · 2 invalid

A registered node's exit with no miss in the hold09-5-exit-cleanvalid

Loading the test widget…

A registered node's exit with a miss in the hold09-5-exit-missedvalid

Loading the test widget…

A queued node's removal09-5-queuedvalid

Loading the test widget…

A queued node locking less than the minimum fee09-5-queued-smallvalid

Loading the test widget…

A queued node locking less than the fee whose owner cannot pay the rest: an unpaid no-op09-5-queued-unpaidinvalid

Loading the test widget…

A 31-byte removal body passes the stateless checks (the length is checked in a block only)09-5-short-bodyvalid

Loading the test widget…

A removal by another account than the owner is refused at admission09-5-not-ownerinvalid

Loading the test widget…

The owner's removal is admitted09-5-ownervalid

Loading the test widget…

Defects to match. (1) The body length is not checked statelessly: a blocksmith can mine a short body and fail its own block. (2) lock_release and node_exit rows carry no latest; a rollback across a release or leave height relies on the rows above the target being deleted and the blocks re-applied.

6. ClaimNodeRegistration (770)

Purpose. The holder of a node key moves the node's stake to any account that proves it holds the key (the "owner unreachable" path); announced, it executes 40,320 blocks later. The owner's own claim is its exit.

Inputs. Body: node_public_key (32) ‖ proof of ownership (§2, naming the claimer's account, the sender). NODE_CLAIM_DELAY_BLOCKS = 40,320. Envelope: a claim by anyone but the node's owner names the owner's account as the recipient and carries a non-empty message (rule claim_notifies_owner: the claim then appears in the owner's account history, 31); the owner's own claim has no such requirement.

Output and effect (rule claim_two_step). The node by key as of this block:

  • not found, Deleted, or a claim already pending (the newest node_claim row at or below this height has status 0) → paid no-op; a stranger's claim whose recipient is not the row's owner account (byte for byte) or whose message is empty → paid no-op, judged before the pending test (rule claim_notifies_owner);
  • leaving (§5) → paid no-op;
  • the owner's own claim of a Registered node (sender = the row's account) → the exit hold of §5;
  • a stranger's claim (sender ≠ owner) → nothing moves now: a node_claim row with status 0, due_height = h + 40,320, fee = F (§5) and tx_id; the sender's rows are 22 +fee / 47 −fee. At due_height the registry step (after the due key changes, the seat_change rows of §4) runs it: if the node was removed, claimed or expelled meanwhile the claim is void (status 1, nothing paid); else the at-risk share is taken as for an exit (10 % when the node was queued as the block found it, or missing or suspended as of the due height), the fee (at most what remains) goes to the longevity pool (event 80), the claimer is credited the rest (event 5, the block's timestamp), the node is Deleted and the node_claim row set to status 1. The owner cancels a pending stranger's claim by exiting before due_height.
  • the owner's own claim of a Queued node → the queued road of §5 when the lock pays F; else the whole lock is credited now and the fee charged.

How to compute it. Stateless: parse (< 32: "ClaimNodeRegistration body too short"); the proof is required and fully checked at every height (§2); then (rule claim_notifies_owner, judged against the registry as of the target height, so at admission and in block validation alike) when the sender is not the node's owner: the recipient equals the owner account ("ClaimNodeRegistration: the recipient must be the node's owner account") and the message is non-empty ("ClaimNodeRegistration: a non-owner claim must carry a non-empty notice message"); a registry read that fails refuses. Admission only: "ClaimNodeRegistration: invalid body", "ClaimNodeRegistration: node not found", "ClaimNodeRegistration: node already deleted", "ClaimNodeRegistration: the registered node is leaving (it leaves the registry at height H)", "ClaimNodeRegistration: a claim on this node is pending (rule claim_two_step)". Execution as above; a failed read fails the block.

Rule activation. claim_two_step, claim_notifies_owner: active from height 0 on every chain.

Rejections and errors. As listed.

Vector. computed (INPUT a stranger's claim, body (168 bytes) 8A88E3DD7409F195FD52DB2D3CBA5D72CA6709BF1D94121BF3748801B40F6F5C ‖ the 136-byte proof of §2 (naming the claimer 000000007D8BD8A4…61902572), recipient = the node's owner account 00000000 ‖ K, message claim (5 bytes), fee 5,000,000, F = 2,500,081, the node Registered, locking 10,000,000,000, owned by 00000000 ‖ K, not missing at the due block, mined at height 2,000). EXPECTED: at 2,000 a node_claim row due at 42,320, the claimer's rows 22 +5,000,000 / 47 −5,000,000; at 42,320 the pool +2,500,081 (event 80) and the claimer +9,997,499,919 (event 5), the node Deleted. Were the registered node missing at 42,320: the pool also +1,000,000,000 (event 76) and the claimer +8,997,499,919. INVALID: a body of 32 bytes (no proof) → "Proof of ownership required for claim"; the same claim with an empty message → "ClaimNodeRegistration: a non-owner claim must carry a non-empty notice message", and with the recipient empty or any account but 00000000 ‖ K → "ClaimNodeRegistration: the recipient must be the node's owner account"; either one mined anyway (the owner changed earlier in the block) → a paid no-op.

Test cases · §6

10 cases · 5 valid · 5 invalid · 1 reference

A stranger's claim body09-6-bodyvalid

Loading the test widget…

A stranger's claim naming the owner as its recipient, with a notice message, is accepted09-6-validvalid

Loading the test widget…

The same claim with an empty message is refused09-6-no-messageinvalid

Loading the test widget…

The same claim with an empty recipient is refused09-6-no-recipientinvalid

Loading the test widget…

The same claim naming another account as its recipient is refused09-6-other-recipientinvalid

Loading the test widget…

The owner's own claim needs no recipient and no message09-6-owner-claimvalid

Loading the test widget…

The claim executed at its due block09-6-executedvalid

Loading the test widget…

The claim of a registered node missing at its due block09-6-missingvalid

Loading the test widget…

A claim body of 32 bytes is refused09-6-no-proofinvalid

Loading the test widget…

A stranger's claim without its notice mined anyway09-6-no-notice-minedinvalidreference

A stated value: there is nothing to compute. The statement is a refusal: what a compatible node does with this input.

result
paid no-op

Defects to match. None. By design, a claim by the node key works on every node that holds a stake, queued or registered: whoever lost the owner key recovers the node with the node key. The claim executes 40,320 blocks after its announcement unless the owner exits first, and it pays the claimer the stake as it stands at due_height (a top-up made in between is included), less the 10 % share a queued node pays to the longevity pool, and the fee. A node key is therefore as valuable as the stake behind it: an operator keeps it as safe as the owner key.

7. QueueAttendance (59)

Purpose. A queued node's proof that it is online during a window, paid from its stake; and a suspended active node's fee-free ping.

Inputs. Body, exactly 36 bytes:

Offset Length Field Encoding
0 4 block_height u32 LE, a recent main-chain height (ref_height)
4 32 block_hash that block's hash

Sender: the node's typed node-key account 00000000 ‖ node key. Category NodeInfra (08 §11). Constants: QUEUE_ATTENDANCE_WINDOW_BLOCKS 5,760, QUEUE_ATTENDANCE_MAX_AGE_BLOCKS 120, LIVENESS_ATTESTATION_WINDOW_BASE 2³⁰ = 1,073,741,824, LIVENESS_ATTESTATION_WINDOW_BLOCKS 120.

Output and effect (queued node). The node's stake −fee' (a new registry version row) with fee' = max(0, min(F, locked − V)) (rule attendance_fee_floor: never below the voted queue minimum V of §3; F as in §5, so the overpay stays in the stake); a row queue_attendance(node_id, window = ref_height div 5,760, height); when fee' > 0 a ledger row event 1 with change 0 on the node account and fee' credited to the longevity pool (event 80, naming the attendance). The node account always books the declared fee as not collected (rows 22 +fee / 47 −fee, once, on every road): its balance never pays. The node is never dropped for its fees.

Output and effect (registered node: the ping, rule liveness_attestation). Valid only from a node suspended before this block, with ref_height ≥ its suspended_height. Nothing is debited (fee must be 0). A queue_attendance row with window = 2³⁰ + ref_height div 120, one per node per 120-block window. In the same block the liveness step (36) reads the ping and returns the node to the draw on probation.

How to compute it. Validation (admission and block validation, the registry and liveness read as of the block): rule queue_attendance active; body exactly 36; the sender's node key = bytes 4 … 35 of a 36-byte sender starting 00000000; the node by key. Then:

  • the node is Registered and rule liveness_attestation is on → fee 0; its liveness row as of h − 1 shows suspended_height ≠ 0; ref_height ≥ suspended_height; window = the ping window;
  • else the node must be Queued and stake ≥ fee; window = ref_height div 5,760.

Both: with tip = h − 1 (the validating node's highest block at admission), ref_height ≤ tip and tip − ref_height ≤ 120; the main-chain block at ref_height exists with that hash; no queue_attendance row for (node, window) at or below h − 1. Execution: body ≠ 36, fee < 0, a sender that is no node key's account, a node neither pinging under the rule nor Queued, a window already attended, a stake short of fee', or a failed insert → a no-op that still books the 22/47 pair; otherwise the effects above. A failed registry read fails the block.

Rule activation. queue_attendance, liveness_attestation, attendance_fee_floor: active from height 0 on every chain.

Rejections and errors. "QueueAttendance is not active until height H", "QueueAttendance body must be block_height(4) | block_hash(32)", "QueueAttendance must be signed by the node key", "QueueAttendance: the node is not in the admission queue", "QueueAttendance: the stake does not cover the fee", "QueueAttendance: block height is in the future", "QueueAttendance: block older than 120 blocks", "QueueAttendance: referenced block not found", "QueueAttendance: block hash does not match", "QueueAttendance: this window is already attended", "Liveness attestation: duty transactions are fee-free (fee must be 0)", "Ping: valid only from a suspended node (LV6); this node is in the draw and proves itself by its blocks", "Ping: its reference block R is older than the node's suspension at S (LV6: dated at its reference block)", "Liveness attestation: one per node per 120-block window"; a bare 32-byte sender is refused by the envelope (07 §3.1).

Vector. computed (a chain whose main-chain block 12,000 has the hash 9E64FF1D…80D954B5 of §2). INPUT body E02E0000 9E64FF1D61634290A9D43E076AE7CFEB27F22E8EA803EFD15064888080D954B5, sender 00000000 ‖ <queued node key>, judged in block 12,050, fee 5,000,000, F = 2,500,018, stake 20,000,000,000, V = 10,000,000,000. EXPECTED: window 2 (12,000 div 5,760); stake −2,500,018; pool +2,500,018 (event 80); node account rows 1 (change 0), 22 +5,000,000, 47 −5,000,000; row queue_attendance(node_id, 2, 12,050). The same body from a suspended Registered node with fee 0 and suspended_height ≤ 12,000: window 1,073,741,924 (2³⁰ + 100). INVALID: the same body judged in block 12,200 → "QueueAttendance: block older than 120 blocks" (12,199 − 12,000 = 199); a ping from a Registered node that is not suspended → "Ping: valid only from a suspended node (LV6); this node is in the draw and proves itself by its blocks".

Test cases · §7

5 cases · 2 valid · 3 invalid

A queued node's attendance09-7-queuedvalid

Loading the test widget…

A suspended registered node's ping09-7-pingvalid

Loading the test widget…

An attendance judged in block 12,200 is too old09-7-too-oldinvalid

Loading the test widget…

A ping from a node that is not suspended is refused09-7-not-suspendedinvalid

Loading the test widget…

A QueueAttendance body of 35 bytes is refused09-7-bodyinvalid

Loading the test widget…

Defects to match. (1) The ping window 2³⁰ + h div 120 and the queue window h div 5,760 share the one window column; they cannot collide for any real height. (2) The executor reads the node's current registry row (not the row as of the block) to choose the road.

8. The admission timer

Purpose. The chain-wide clock that decides at which blocks queued nodes are admitted.

Inputs. node_admission_timestamp; the block's timestamp and height; the genesis parameters below; the counted registered nodes (§1).

Parameter TestNet DevNet
node_admission_genesis_delay 604,800 (7 days) 600
node_admission_base_delay 51,840,000 (600 days) 180
node_admission_min_delay 604,800 (7 days) 60
node_admission_max_delay 7,776,000 (90 days) 300
max_node_admittance_per_cycle 1 1
admission_genesis_seat_cap 11 11
min_registry_size 7 3

Output and effect. The seed row (genesis timestamp + genesis_delay, block_height 0, latest) is written by the genesis builder (06 §9). After every block except the genesis block, once the block is stored and its coinbase paid (21), the registry step runs, in this order: the due key changes (§4, the seat_change rows), the due claims (§6), the roll call's close (§14), the queued nodes' held exits due (§5), the attendance evaluation at a window boundary (§9), the resume admission (§10), then, when block.timestamp ≥ next.timestamp: a new row (anchor + delay, height, latest) replaces the current one (the old row loses latest), and up to max_node_admittance_per_cycle queued nodes are admitted (§9, §10). anchor = next.timestamp, or block.timestamp when block.timestamp − next.timestamp ≥ delay (rule admission_timer_reanchor).

How to compute it. delay = clamp(base_delay div pace_count, min_delay, ceiling), integer division. pace_count = min(G, admission_genesis_seat_cap) + M over the counted registered nodes at this height, G the counted genesis registered nodes (registration_height 0) and M the counted others; 1 when 0. ceiling = max_delay, or min(max_delay, 604,800) (ADMISSION_SMALL_REGISTRY_MAX_DELAY_SECONDS) when min_registry_size > 0, the counted registered nodes number fewer than min_registry_size and rule admission_small_registry_cap is on. The row is keyed by block_height; a second write at one height replaces it.

Rule activation. admission_timer_reanchor, admission_small_registry_cap: active from height 0 on every chain.

Rejections and errors. A failure in the registry step (a read or a write, the count of registered nodes included) refuses the block on that node.

Vector. computed (TestNet, genesis timestamp 1,793,509,027, 11 counted genesis registered nodes, none suspended). INPUT seed row timestamp 1,793,509,027 + 604,800 = 1,794,113,827; the first block with timestamp ≥ 1,794,113,827 at height h. EXPECTED: delay = clamp(51,840,000 div 11, 604,800, 7,776,000) = 4,712,727; new row (1,794,113,827 + 4,712,727 = 1,798,826,554, h), or (block.timestamp + 4,712,727, h) when that block is ≥ 4,712,727 s late; one queued node admitted if any is eligible. With 6 counted registered nodes (below min_registry_size 7): pace_count 6, delay = clamp(8,640,000, 604,800, 604,800) = 604,800. DevNet with 11 counted registered nodes: clamp(180 div 11 = 16, 60, 300) = 60.

Test cases · §8

4 cases · 4 valid · 1 reference

The TestNet delay with 11 counted genesis registered nodes09-8-testnetvalid

Loading the test widget…

Six counted registered nodes, below min_registry_size 709-8-smallvalid

Loading the test widget…

The DevNet delay with 11 counted registered nodes09-8-devnetvalid

Loading the test widget…

The admission row after the first cycle09-8-next-rowvalidreference

A stated value: there is nothing to compute. A compatible node shows the same value.

seed
1794113827
next
1798826554

Defects to match. The counted registered nodes are read as of the block being applied, after its transactions and the registry step's earlier parts (the score road's expulsions run later, in the liveness step, so they do not change this block's pace).

9. Queue order and the attendance gate

Purpose. Which queued node a cycle admits, and how a queued node is dropped for not attending.

Inputs. The queued rows, queue_state, queue_attendance, the block height. Window w = blocks w × 5,760 … w × 5,760 + 5,759. QUEUE_ATTENDANCE_MISSES_ALLOWED 2 (the floor).

Output and effect. At a cycle at height h (§8) the queued rows are ordered and the first limit eligible ones admitted (§10). Order: weight = max(stake, 0) × waited descending (unsigned 128-bit), then registration_height ascending, then id ascending, where waited = h − max(registration_height, waited_from_height) (0 when negative) and waited_from_height is the node's queue_state as of h (0 without a row); a top-up keeps the wait. A queue state that cannot be read fails the step. Eligibility: registration_height < h; and, under rule queue_attendance, the node holds an attendance row (as of h) for the newest evaluated window LastEvaluatedWindow(h) = (h − 121) div 5,760 − 1 (rule attendance_tail), unless it registered within that window.

The evaluation step runs at h = k × 5,760 + 121 (rule attendance_tail: a full 120-block tail after window k − 1 closes). The closed window is c = (h − 121) div 5,760 − 1. For every queued node in store order with registration_height < c × 5,760: take its queue_state (fresh when none); skip when last_window ≥ c + 1; set last_window = c + 1, height = h; when it attended c (as of h) write the row; else misses += 1, waited_from_height = h, write, and when misses > AllowedAttendanceMisses the node is dropped through §11 (10 % of its lock to the longevity pool, the rest back to the owner at once). AllowedAttendanceMisses = max(2, node_admission_max_delay div (5,760 × smithing_period)) (rule attendance_any_sign). Any on-chain sign attends: besides a type-59 transaction, every published-receipt signer and liveness attester that is a queued node gets an attendance row for its current window in the liveness step (36).

How to compute it. As stated.

Rule activation. queue_attendance, attendance_any_sign, attendance_tail: active from height 0 on every chain.

Rejections and errors. None (a block step; a failure refuses the block).

Vector. computed. INPUT at h = 100,000: node A stake 10,000,000,000 registered at 90,000 (waited 10,000, weight 10¹⁴); node B stake 40,000,000,000 registered at 98,000 (waited 2,000, weight 8 × 10¹³); both attended. EXPECTED order A, B. With B registered at 97,000 (weight 1.2 × 10¹⁴): B, A. AllowedAttendanceMisses: TestNet max(2, 7,776,000 div 86,400) = 90; DevNet max(2, 300 div 86,400) = 2. Evaluation heights: 5,881 (closes window 0), 11,641 (window 1).

Test cases · §9

4 cases · 4 valid

A waited longer outweighs B's larger stake09-9-ordervalid

Loading the test widget…

B registered at 97,000 outweighs A09-9-order-bvalid

Loading the test widget…

TestNet allowed misses and the first evaluation heights09-9-testnetvalid

Loading the test widget…

DevNet allowed misses09-9-devnetvalid

Loading the test widget…

Defects to match. (1) The evaluation walks the queue in store order and drops through the involuntary expulsion of §11 (10 % to the pool, not a full return). (2) AllowedAttendanceMisses reads node_admission_max_delay and smithing_period from the live parameters.

10. Admission, and the resume admission

Purpose. Turning a queued row into an active one.

Inputs. The selected rows, the block height, default_participation_score (2,000,000,000,000 on both live chains; the protocol default when the parameter is 0).

Output and effect. For each admitted node, at the block's height, together: a registry row with status 0, the same registration_height and stake (replacing any row of the id at that height; every other row of the id loses latest); a participation_score row with score = default_participation_score (20 % of the maximum), replacing the node's current score row; a fresh liveness row (no misses, nothing produced, its unseen time, its suspension floor and its maturity clock counted from this block, 36). A failure to write the score or the liveness row undoes the admission and fails the step. A key that registers again starts at the default score like every newcomer.

The resume admission (rule liveness_miss_rule): after every block with height ≠ 0, if the block's blocksmith key belongs to a node whose current row is Queued, that node is admitted by this block regardless of the timer. A queued node produces such a block in two ways (20): when every active node is suspended, the first queued node of the §9 order joins the draw set; and (rule resume_by_queue) a block stamped more than the recovery limit after its parent is drawn over the attended queue too (the queued nodes with an attendance row for the current or previous window, in the §9 order). A failed queue or attendance read is an error that fails the draw set and the block, never an empty queue.

How to compute it. As stated.

Rule activation. liveness_miss_rule, resume_by_queue: active from height 0 on every chain.

Rejections and errors. None (a failure refuses the block, §8).

Vector. computed. INPUT: node id 8,742,866,279,265,121,657 queued since height 5,000 with stake 10,000,000,000, admitted by the cycle at height 40,000. EXPECTED: registry row (id, …, registration_height 5,000, stake 10,000,000,000, status 0, height 40,000); participation_score(id, 2,000,000,000,000, height 40,000); a liveness row at 40,000.

Test cases · §10

1 case · 1 valid · 1 reference

A queued node admitted by the cycle at height 40,00009-10-admittedvalidreference

A stated value: there is nothing to compute. A compatible node shows the same value.

registry
(id 8742866279265121657, registration_height 5000, stake 10000000000, status 0, height 40000)
participation_score
2000000000000
liveness
a fresh liveness row at 40,000

Defects to match. The resume admission reads the blocksmith's current row, not the row as of the block.

11. Expulsion and the return of the stake

Purpose. The ways a node leaves the registry without a transaction of its own, and what its lock does. Every share lost goes to the longevity pool.

Inputs. The current rows, the score road's outcome (36), the attendance evaluation of §9, the survival flag of the block (19).

Output and effect. For each expelled node: refund starts at the stake; when the expulsion is involuntary and refund > 0: share = floor(refund × node_lock_at_risk_bps / 10,000), credited to the longevity pool (event 76, transaction_id = the node id, the block's timestamp) and refund −= share. Then the owner is credited refund by a plain credit (no split policy), one ledger row event 4, transaction_id 0, the block's timestamp; a credit that cannot be made fails the block. Then a registry row at h with status 2 and stake 0 (replacing any row of the id at h), and the registered node's exit, if it was leaving, is ended (§5). A voluntary expulsion loses nothing.

The callers, in block order:

  1. Attendance (§9, in the registry step): more than AllowedAttendanceMisses missed windows (involuntary).
  2. Zero score (the score road, 36, in the liveness step after the registry step): every node the road expels at score zero (never below LIVENESS_FLOOR_ACTIVE = 3 active nodes, least recently seen first); each also gets a liveness_expulsion row (node_public_key, node_id, score, h). In a block whose survival flag is true (rule survival_mode) this scan is skipped entirely: nobody is expelled and no candidate's row is reset; such nodes are expelled at the first later block whose flag is false (36).
  3. A queued node's own fees ending its entry (voluntary): unreachable while attendance_fee_floor is on (§7).

The roll call's removal (§14) is not an expulsion: no share, no expulsion row.

How to compute it. As stated; share is an i64 product then floor division.

Rule activation. survival_mode (the pause): active from height 0 on every chain; both chains set survival_min_producers to 5, so the pause is reachable on both (19, 36).

Rejections and errors. A credit or a row write that fails fails the step and the block.

Vector. computed. INPUT a node locking 10,000,000,000 expelled at score zero at height 50,000. EXPECTED: pool +1,000,000,000 (event 76, transaction_id = node id), owner +9,000,000,000 (event 4, transaction_id 0), registry row status 2 stake 0 at 50,000, a liveness_expulsion row. A genesis registered node (lock 0) expelled: only the Deleted row and the expulsion row.

Test cases · §11

2 cases · 2 valid

A node locking 100 ZBC expelled at score zero09-11-expelvalid

Loading the test widget…

A genesis registered node (lock 0) expelled09-11-expel-genesisvalid

Loading the test widget…

Defects to match. (1) A node that has never been scored cannot be expelled by score. (2) The expulsion's ledger row carries transaction_id 0 and the pool's row the node id: a client joining them must use the height.

12. Maturity

Purpose. The delay between a node's admission and its first income.

Inputs. registration_height, the node's liveness row and the unit clock (36) at the payout instant, the genesis parameter maturity_units (4 on both live chains); the unit clock's scale, one unit = 10¹² (36 §1).

Output and effect. A node is mature at the payout instant (the previous block, rule payout_instant) when registration_height = 0 (a genesis registered node), or when its liveness row shows at least one block produced since its admission and clock − admitted_clock ≥ maturity_units × 10¹² (four score units on the unit clock since its admission; below 2,880 registered nodes a unit is 2,880 blocks). A node earns when it is mature and not missing or suspended, and, during the roll call, not an unanswered genesis registered node (§14). Earning covers every income: the coinbase lottery with the block fees and the longevity slice (21), the storage and archive rewards (11), the taker fee of a block it produces (15); an immature node's share stays in its pool or waits in the lottery carry.

How to compute it. The liveness rows and the unit clock as of the payout instant (a failed read fails the payout), then the two tests per node.

Rule activation. payout_instant: active from height 0 on every chain.

Rejections and errors. None.

Vector. computed. INPUT TestNet, 11 registered nodes, a node admitted at height a, first own block at a + 100, never missing. EXPECTED: mature once the unit clock has advanced 4 units (4 × 10¹² ticks) since a: 11,521 blocks at 347,222,222 ticks per block (11,520 blocks give 3,999,999,997,440 ticks); a genesis registered node is mature from height 0 (computed from the TestNet genesis file: its eleven nodes have registration_height 0, so every one of them earns from block 1 on).

Test cases · §12

1 case · 1 valid

A node's maturity on the TestNet with 11 registered nodes09-12-maturityvalid

Loading the test widget…

Defects to match. The unit clock counts, not blocks: when a unit grows above 2,880 blocks (more selectable nodes than 2,880), maturity takes proportionally longer (36).

13. Status transitions, and what is consensus here

From To By
(none) 0 Registered genesis registration (06 §6)
(none) or 2 Deleted 1 Queued NodeRegistration at or above the entry minimum (§3); a re-registration keeps the id and gets a fresh queue_state
1 Queued 0 Registered an admission cycle (§8–§10); the resume admission (§10)
0 Registered 0 Registered, suspended the score road (36): status stays 0
0 Registered 0 Registered, leaving the owner's RemoveNodeRegistration or own ClaimNodeRegistration (§5, §6)
0 Registered (leaving) 2 Deleted the leave block (§5)
0 Registered 2 Deleted expulsion at score zero (§11); a stranger's claim at its due block (§6); the roll call's close (§14)
1 Queued 2 Deleted removal or the owner's claim (§5, §6); a stranger's claim at its due block; too many missed windows (§9)
0 Registered same status, new key update with new_node_public_key (§4), 120 blocks later
any same status, new stake update (§4); attendance debit (§7); the exit's fee from the lock (§5)

Consensus: every registry, score, admission-timer, attendance, queue-state, node_claim, lock_release, node_exit, seat_change, roll_call, liveness_expulsion and liveness row; the accept/refuse decisions of §2–§7 and §14; the order and arithmetic of §8–§12; the longevity-pool credits (events 76, 80). Local: the admission-only refusals (a blocksmith may skip them; the executor's no-ops are what the chain agrees on).

Vector. none.

Test cases · §13

1 case · 1 valid · 1 reference

Status transitions: no vector09-13-nonevalidreference

A stated value: there is nothing to compute. A compatible node shows the same value.

value
none

Defects to match. None.

14. RollCall (61): the roll call at a chain's start

Purpose. Every genesis registered node proves, in the first blocks of a chain, that it runs this chain's genesis; a registered node that does not is not drawn and leaves the registry.

Inputs. A transaction of type 61: sender = a node's typed node-key account (00000000 ‖ node key), empty body, fee exactly 0 (a fee-free duty, 04), recipient empty. Its chain-bound signature (02) is the proof. The genesis parameter roll_call_blocks W (20 on both live chains; a stored value below 2 reads as 2).

Output and effect.

  • Validity (admission and block validation alike, judged as of the block before the one it is in): the block height h is in 1 … W; the sender's key holds a genesis registered node (a registry row with registration_height 0 and status Registered as of h − 1); the registered node has not answered (no roll_call row as of h − 1; a failed read refuses). Executed: roll_call(node_id, answered = 1, height = h); anything else in the executor records nothing. Nothing is debited.
  • The draw (20): for blocks 2 … W, once at least half of the genesis registered nodes have answered in earlier blocks (2 × answered ≥ genesis_seats, genesis_seats the number of genesis registered nodes), a genesis registered node with no answer in an earlier block is left out of the draw set (a registered node answering in block k is drawable from k + 1; when that would leave nobody the set stays whole). Block 1 is drawn over every registered node. A registered node out of the draw earns nothing (§12).
  • The close, in block W's registry step (after its key changes and claims): every genesis registered node still Registered with no answer up to W is removed — a Deleted row with stake 0, its lock (if any) credited back in full (event 4, transaction_id 0, the block's timestamp), a roll_call(node_id, answered = 0, height = W) row, no expulsion row, no share — unless fewer than LIVENESS_FLOOR_ACTIVE = 3 registered nodes would remain, in which case nobody is removed.

How to compute it. As stated; every read is as of a height, so the draw, the validation and the fork weigher's branch replay (24) agree.

Rule activation. None.

Rejections and errors. A fee other than 0 is refused first by the duty-fee rule of 04 ("Transaction fee must be exactly 0: a node duty declares a fee of exactly zero (this one declares N)"), so the type's own "RollCall: duty transactions are fee-free (fee must be 0)" is not reached by a fee; then "RollCall: the body must be empty (the signature is the answer)", "RollCall must be sent by a node key's account (00000000 + the node public key)", "RollCall: the roll call is blocks 1 to W; block h is outside it", "RollCall: only a genesis registry node answers the roll call, and this key is not one", "RollCall: genesis registry node N has answered the roll call already".

Vector. computed from the TestNet genesis file (06 §6, §1): a RollCall in block 1 of version 3, sender 00000000715EA8E2F51BBCB778A26E69D73BD1044FE3A43D76CB1CF6CBC3A9A661A2FBAC (the typed node-key account of the first genesis node), empty recipient, fee 0, empty body, expiry 86,400 → EXPECTED roll_call(node_id 4,016,115,710,591,262,321, answered 1, height 1). computed: 11 genesis registered nodes, W = 20; RollCalls of 6 registered nodes in block 1 and of 2 more in block 5: block 2 is drawn over the 6 (2 × 6 ≥ 11), blocks 6–20 over the 8; at block 20 the 3 that never answered leave (8 ≥ 3 remain), each with answered = 0. With only 2 answered by block 20 nobody is removed. INVALID: the same RollCall in block 21 → "RollCall: the roll call is blocks 1 to 20; block 21 is outside it"; a second one from the same registered node in block 2 → "RollCall: genesis registry node 4016115710591262321 has answered the roll call already"; fee 1 → "Transaction fee must be exactly 0: a node duty declares a fee of exactly zero (this one declares 1)".

Test cases · §14

6 cases · 3 valid · 3 invalid

The first genesis node's RollCall in block 1 records its answer09-14-genesis-answervalid

Loading the test widget…

Six registered nodes answer in block 1 and two more in block 509-14-drawvalid

Loading the test widget…

Only two registered nodes answered: nobody is removed09-14-too-fewvalid

Loading the test widget…

A RollCall in block 21 is refused09-14-lateinvalid

Loading the test widget…

A second RollCall of the same registered node is refused09-14-twiceinvalid

Loading the test widget…

A RollCall with fee 1 is refused09-14-feeinvalid

Loading the test widget…

Defects to match. None.

A question about this chapter, or a statement that does not match the network? Discuss on zoobc.pro.