On this page
- §0 The area in one paragraph
- 1. The consensus state tables and their schemas
- 2. Versioning: the one rule behind every table
- 3. Accounts
- 3.1 Typed account addresses and accepted forms
- 3.2 System pools and rent-exempt addresses
- 4. Tokens and token balances
- 5. The ledger
- 6. Objects with a lifetime: datasets, files, longevity, escrow, streams, schedules, multisig
- 7. Exchange and apps
- 8. Registry, consensus and governance tables
- 9. History and node-local tables
- 10. What a reorganisation does to the state
- 11. What a snapshot carries
- 12. Touched accounts of a transaction
- 13. The node's spendable-balance view
07 — The state model
Out of scope the rules that change each object (its own chapter, named per table below); the snapshot file encoding, its windows of history and the fast sync (26); when a reorganisation happens and in what order (24); the registry's state machine (9, 20); the HTTP forms (31); the schemas of the spine tables (25) and of the receipt tables (23); the local prune's horizons in full (13, 26)
§0 The area in one paragraph
ZooBC's state is a set of tables, each keyed by an object identity plus the block height at which
a version of the object was written. Almost every consensus object is versioned: a change never
overwrites, it adds a new row at the current height and marks it latest; the newest row per key
is the object's current value, and the rows at or below a height are its value as of that height.
This single convention gives the chain its reorganisation rule (drop every row above the common
height and re-mark the newest survivors), its as-of reads for clients, and its snapshot rule (carry
the newest row per key at or below the snapshot height, without the latest flag, which the
loading node recomputes). Three kinds of table exist: consensus state (the 65 tables of §1,
which every node holds identically at every height and which a snapshot carries in full),
history (blocks, transactions, published receipts and the ledger: kept in a window and pruned,
read by consensus only within that window), and node-local tables (the mempool, the node's own
receipts, API indexes, peer addresses, the storage audit ledger, the spine co-signing promises),
which an implementation may shape as it likes. An account is one row family keyed by its typed
account address (a 4-byte little-endian account type, then the key or hash, 01 §4); a bare
32-byte key is a node key and never an account. An account's balance is consensus; its
spendable_balance is that balance less this node's own mempool reservations, so only the former
travels. A linked group member's money lives on its group's row, and three keyless system pools
(longevity, storage, lottery carry), the apps pool and every ZBS_ deposit address are exempt from
rent. Five tables and one column are gated by a rule, which every chain lists at height 0: a
snapshot names them only while the rule is active, so on every chain it names them all. The rest of
the protocol takes from this chapter the exact row shapes it reads and writes, the account
vocabulary (§3), and what a reorganisation and a snapshot do to the state.
1. The consensus state tables and their schemas
Purpose. The complete list of state an implementation must hold, with every column.
Inputs. None: declared.
Output and effect. 65 tables, in the order a snapshot writes them (§11). Value types: I =
signed 64-bit integer (heights, timestamps, amounts, ids, flags and enumerations are all stored
as I; a height is a u32 value), T = UTF-8 text, B = a byte string. =v is the value a
row holds when its writer gives none (the default); a column without a default holds null
until written, and null is a value of its own (it is not 0, not the empty text and not the empty
byte string: a snapshot carries it as null, §11). "PK" is the primary key: a second row with the
same PK values is impossible (an append-only insert of an existing PK is an error, an
insert-or-replace write replaces the row). "Key" is the object identity a version is newest for
(the snapshot's key, §11); "H" the height column; "V" = yes when rows carry latest (versioned,
§2). "By" names the chapters that specify the writes.
Accounts
| Table | Columns | PK | Key | H | V | By |
|---|---|---|---|---|---|---|
account_balance |
account_address B, block_height I, spendable_balance I, balance I, pop_revenue I, latest I, dataset_storage_bytes I=0, prepaid_storage_balance I=0, last_billing_height I=0, nonce I=0, rent_due_height I=0, transact_policy I=0 |
account_address, block_height | account_address | block_height | yes | 04 08–18 21 22 |
account_token_balance |
account_address B, token_id I, balance I, spendable_balance I, block_height I, latest I |
account_address, token_id, block_height | account_address, token_id | block_height | yes | 12 14–17 |
account_split_policy |
account_address B, block_height I, latest I=1, entries B |
account_address, block_height | account_address | block_height | yes | 08 |
account_group |
group_address B, block_height I, latest I=1, controller_address B, link_seq I=0, status I=1, created_height I=0 |
group_address, block_height | group_address | block_height | yes | 18 |
account_group_member |
member_address B, block_height I, latest I=1, group_address B, active I=0, flags I=0, spend_limit I=0, period_blocks I=0, window_start I=0, window_spent I=0, linked_height I=0 |
member_address, block_height | member_address | block_height | yes | 18 |
spent_foreign_message |
msg_hash B, block_height I |
msg_hash | msg_hash | block_height | no | 08 (02 §9) |
Tokens, datasets, files, longevity
| Table | Columns | PK | Key | H | V | By |
|---|---|---|---|---|---|---|
token |
token_id I, issuer_address B, symbol T, name T, decimals I, total_supply I, backing_asset I, backing_amount I, flags I, persist_height I, block_height I, latest I |
token_id, block_height | token_id | block_height | yes | 14 22 |
account_dataset |
setter_account_address B, recipient_account_address B, property T, value T, is_active I, latest I, height I, creating_tx_hash B, last_billing_height I=0, object_id B, added_by B |
setter, recipient, property, height | setter_account_address, recipient_account_address, property | height | yes | 10 22 |
dataset_object |
object_id B, owner_account B, pending_owner B, manage_mode I=0, height I, last_billing_height I=0, latest I |
object_id, height | object_id | height | yes | 10 22 |
dataset_delete_vote |
object_id B, voter_address B, height I, latest I |
object_id, voter_address, height | object_id, voter_address | height | yes | 10 |
stored_file |
file_root B, owner_address B, total_size I, piece_size I, piece_ids B, deposit I, status I=0, last_billed_height I=0, block_height I, latest I, access_mode I=0, allowed_addresses B |
file_root, block_height | file_root | block_height | yes | 11 22 |
storage_proof |
piece_id B, epoch I, prover_address B, proof B, block_height I |
piece_id, epoch, prover_address | piece_id, epoch, prover_address | block_height | no | 11 |
longevity |
target_tx_id I, sponsor_address B, deposit I, paid_through_height I, payload_bytes I=0, cost_per_mib_locked I=0, free_until_height I=0, block_height I, latest I, owner_address B, funded_total I=0 |
target_tx_id, block_height | target_tx_id | block_height | yes | 13 22 |
longevity_funder |
target_tx_id I, funder_address B, total I, block_height I, latest I |
target_tx_id, funder_address, block_height | target_tx_id, funder_address | block_height | yes | 13 |
longevity_deposit |
target_tx_id I, seq I, payer_address B, amount I, block_height I, latest I |
target_tx_id, seq, block_height | target_tx_id, seq | block_height | yes | 13 |
longevity_vote |
target_tx_id I, voter_address B, voted I, block_height I, latest I |
target_tx_id, voter_address, block_height | target_tx_id, voter_address | block_height | yes | 13 |
file_deposit |
object_id B, seq I, payer_address B, amount I, block_height I, latest I |
object_id, seq, block_height | object_id, seq | block_height | yes | 10 13 |
Payments, escrow, multisig
| Table | Columns | PK | Key | H | V | By |
|---|---|---|---|---|---|---|
escrow_transaction |
id I, sender_address B, recipient_address B, approver_address B, amount I, commission I, timeout I, status I, block_height I, latest I, instruction T, token_id I=0, decline_reason T='' |
id, block_height | id | block_height | yes | 12 22 |
escrow_request |
id I, requester_address B, proposed_sender B, proposed_amount I, approver_address B, commission I, timeout I, instruction T, expiry I, status I, escrow_transaction_id I, block_height I, latest I, decline_reason T='' |
id, block_height | id | block_height | yes | 12 |
liquid_payment_transaction |
id I, sender_address B, recipient_address B, amount I, applied_time I, complete_minutes I, status I, block_height I, latest I, token_id I=0 |
id, block_height | id | block_height | yes | 08 22 |
trigger_schedule |
trigger_id I, owner_address B, recipient_address B, amount I, fire_height I, status I, block_height I, latest I, event_id T, fire_time I=0, interval_seconds I=0, remaining_fires I=0, end_time I=0, per_fire_amount I=0, token_id I=0, funding_mode I=0, locked_remaining I=0, cancel_policy I=0, kind I=0, consecutive_skips I=0, creator_address B |
trigger_id, block_height | trigger_id | block_height | yes | 06 08 22 |
pending_transaction |
sender_address B, transaction_hash B, transaction_bytes B, status I, block_height I, latest I |
transaction_hash, block_height | transaction_hash | block_height | yes | 12 |
pending_signature |
transaction_hash B, account_address B, signature B, block_height I, latest I |
account_address, transaction_hash, block_height | account_address, transaction_hash | block_height | yes | 12 |
multisignature_info |
multisig_address B, minimum_signatures I, nonce I, block_height I, latest I |
multisig_address, block_height | multisig_address | block_height | yes | 12 |
multisignature_participant |
multisig_address B, account_address B, account_address_index I, latest I, block_height I |
multisig_address, account_address, block_height | multisig_address, account_address | block_height | yes | 12 |
Exchange, apps
| Table | Columns | PK | Key | H | V | By |
|---|---|---|---|---|---|---|
swap_offer |
id I, maker_address B, give_token_id I, give_amount I, want_token_id I, want_amount I, counterparty_address B, expiry I, status I, block_height I, latest I |
id, block_height | id | block_height | yes | 15 |
market |
id I, base_token_id I, quote_token_id I, creator_address B, deposit I, status I, block_height I, latest I, paid_through_height I=0 |
id, block_height | id | block_height | yes | 15 |
order_book |
id I, market_id I, maker_address B, side I, price I, amount I, remaining I, status I, block_height I, latest I, expiry I=0 |
id, block_height | id | block_height | yes | 15 22 |
trade |
market_id I, taker_order_id I, maker_order_id I, price I, amount I, taker_fee I, timestamp I, block_height I |
taker_order_id, maker_order_id | taker_order_id, maker_order_id | block_height | no | 15 |
app |
id I, app_type I, status I, seats I, creator_address B, players B, opponent_address B, stake_token_id I, stake_amount I, pot I, state_blob B, turn I, created_height I, last_move_height I, deadline_height I, resolve_height I, winner_address B, persist_height I, channel I=0, pending_move B, block_height I, latest I, owed_payout I=0, paid_payout I=0 |
id, block_height | id | block_height | yes | 16 22 |
app_settlement |
app_id I, claimant_address B, final_seq I, outcome I, winner_seat I, turn I, state_blob B, challenge_deadline_height I, resolved I, block_height I, latest I |
app_id, block_height | app_id | block_height | yes | 16 22 |
Registry, liveness, consensus
| Table | Columns | PK | Key | H | V | By |
|---|---|---|---|---|---|---|
node_registry |
id I, node_public_key B, account_address B, registration_height I, locked_balance I, registration_status I, latest I=1, height I |
id, height | id (plus recent history, §11) | height | yes | 9 22 |
participation_score |
node_id I, score I, latest I=1, height I |
node_id, height | node_id | height | yes | 20 21 23 |
node_admission_timestamp |
timestamp I, block_height I, latest I |
block_height | (none: every row) | block_height | yes | 9 |
skipped_blocksmith |
blocksmith_public_key B, pop_change I, block_height I, blocksmith_index I |
(none) | blocksmith_public_key, blocksmith_index | block_height | no | 20 |
node_liveness |
node_id I, misses I=0, produced I=0, suspended_height I=0, last_seen_height I=0, latest I=1, height I, suspension_since I=0, last_block_height I=0, missing_clock I=0, admitted_clock I=0, last_miss_height I=0 |
node_id, height | node_id | height | yes | 20 36 |
queue_attendance |
node_id I, window I, height I |
node_id, window | node_id, window | height | no | 9 |
queue_state |
node_id I, misses I=0, waited_from_height I=0, last_window I=0, latest I=1, height I |
node_id, height | node_id | height | yes | 9 |
liveness_expulsion |
node_public_key B, node_id I, score I, height I |
node_public_key, height | node_public_key, height | height | no | 36 |
score_unit_clock |
height I, clock I, unit I |
height | height | height | no | 36 |
survival_state |
height I, active I |
height | height | height | no | 19 36 |
readiness_bundle_decision |
bundle_id I, effective_height I, height I, latest I=1 |
bundle_id, height | bundle_id | height | yes | 29 |
lock_release |
node_public_key B, account_address B, amount I, fee I, slashed I=0, transaction_id I, release_height I, height I |
node_public_key, height | node_public_key, height | height | no | 9 22 |
node_claim |
node_id I, node_public_key B, claimer B, tx_id I, fee I, due_height I, status I=0, height I |
node_id, height | node_id, height | height | no | 9 |
node_exit |
node_id I, account_address B, tx_id I, announced_height I, leave_height I, missing_at_exit I=0, status I=0, height I |
node_id, height | node_id, height | height | no | 9 |
seat_change |
node_id I, new_node_public_key B, new_account_address B, tx_id I, due_height I, status I=0, height I |
node_id, height | node_id, height | height | no | 9 |
roll_call |
node_id I, answered I, height I |
node_id | node_id | height | no | 9 |
equivocation_charge |
node_id I, equivocated_height I, reporter B, height I |
node_id, equivocated_height | node_id, equivocated_height | height | no | 35 |
spine_equivocation_charge |
node_id I, spine_height I, reporter B, height I |
node_id, spine_height | node_id, spine_height | height | no | 35 |
archival_registry |
node_public_key B, owner_address B, domain T, url T, status I=0, block_height I, latest I |
node_public_key, block_height | node_public_key | block_height | yes | 17 |
gateway_registry |
gateway_key B, owner_address B, domain T, url T, locked_stake I, last_heartbeat_height I, verified_count I=0, status I=0, block_height I, latest I |
gateway_key, block_height | gateway_key | block_height | yes | 17 22 |
relay_registry |
relay_key B, owner_address B, gateway_key B, domain T, url T, status I=0, block_height I, latest I |
relay_key, block_height | relay_key | block_height | yes | 17 |
release_authority |
id I, authority_address B, pending_address B, block_height I, latest I |
id, block_height | id (always 1) | block_height | yes | 17 |
release_registry |
version T, manifest_hash B, release_address B, revoked I=0, block_height I, latest I |
version, block_height | version | block_height | yes | 17 |
consensus_parameters |
parameter_name T, parameter_value I (never null), description T |
parameter_name | parameter_name | (none) | no | 06 17 |
consensus_parameter_change |
id I (assigned 1, 2, 3, … in insertion order), parameter_name T, had_row I, old_value I, new_value I, block_height I |
id | id | block_height | no | 17 |
fee_scale |
fee_scale I, block_height I, latest I |
block_height | (none: every row) | block_height | yes | 04 §3 17 |
fee_vote_commitment_vote |
vote_hash B, voter_address B, block_height I |
voter_address, vote_hash, block_height | voter_address | block_height | no | 17 |
fee_vote_reveal_vote |
recent_block_hash B, recent_block_height I, fee_vote I, voter_address B, voter_signature B, block_height I |
block_height, voter_address | voter_address | block_height | no | 17 |
oracle_attestation |
event_id T, attester B, value T, block_height I, latest I=1 |
event_id, attester, block_height | event_id, attester | block_height | yes | 17 34 |
oracle_result |
event_id T, value T, resolved_height I |
event_id | event_id | resolved_height | no | 17 34 |
bridge_withdrawal_request |
trigger_hash B, custody_address B, token_id I, amount I, destination T, block_height I, latest I=1 |
trigger_hash, block_height | trigger_hash | block_height | yes | 14 34 |
network_topology |
period_height I, topology_seed B, node_count I |
period_height | period_height | period_height | no | 28 |
bridge_coin |
token_id I, symbol T, chain T, asset T, deposit_address T, decimals I |
token_id | token_id | (none) | no | 06 only |
chain_metadata |
key T, value T (never null) |
key | key | (none) | no | 06 only |
The meaning of every column with a rule is in §3–§8 and in the chapter named in "By". Indexes
are not part of the protocol: an implementation needs fast access by each table's key with
latest = 1, by height, and by the selections each chapter describes, and may build them as it
likes. Every address column holds a typed account address (§3.1) except these: node_public_key,
blocksmith_public_key, gateway_key, relay_key and new_node_public_key hold 32-byte node
keys; multisig_address of multisignature_info and multisignature_participant holds the
32-byte multisignature hash H, a table key and not an account (the account is 00000000 ‖ H,
12); reporter of the two equivocation tables holds the typed account of the node that filed the
report.
Gated tables and the gated column. Five tables are written, read and carried only while a
rule is active: survival_state under survival_mode, readiness_bundle_decision under
readiness_decision_state, spine_equivocation_charge under spine_equivocation_report,
bridge_withdrawal_request under bridge_withdrawal_credit, chain_metadata (in the snapshot)
under escrow_commission_nonnegative; and one column, dataset_object.last_billing_height, exists
in the snapshot only under dataset_rent_object_clock. A snapshot at height S leaves a gated table
out of its state section (no entry at all, not an empty one) when the gate is not active at S, and
drops the gated column from dataset_object the same way (§11). All six rules are at height 0 in
both genesis files and in the template, so on every chain every snapshot names all 65 tables and
every column; the gate is the machinery of 29, stated here so that a snapshot's content is
derivable from the rule table alone.
How to compute it. Not computed: declared. An implementation that keeps these tables with these keys can apply the rules of §2, §10 and §11 mechanically.
Rule activation. None: every table exists from genesis on a chain built from 0.6.1 (an
implementation may create a table on first use; §11 says how a snapshot treats a table a node has
not created). The deposit tables (longevity_deposit, file_deposit) and the votes
(longevity_vote, dataset_delete_vote) are never pruned. survival_state holds rows only on a
chain whose genesis sets survival_min_producers above 0 (both relaunched chains set 5; the
mainnet template leaves it unset = 0; 19, 36).
Rejections and errors. None.
Vector. computed: INPUT the table list above → EXPECTED OUTPUT 65 tables, 62 with a height
column, 3 without (consensus_parameters, bridge_coin, chain_metadata); 42 versioned (V =
yes, two of them keyless: node_admission_timestamp, fee_scale), 20 append-only with a height
column, and the 3 without. INPUT a snapshot at height S of a chain whose rule table lists every
rule at 0 → every one of the 65 tables is named, dataset_object with its six columns.
Test cases · §1
2 cases · 2 valid
The consensus state tables by kind
Loading the test widget…
A snapshot of a chain that lists every rule at 0 names all 65 tables, dataset_object with six columns
Loading the test widget…
Defects to match. The description column of consensus_parameters is free text that no rule
reads, yet it is state that travels: every snapshot carries it (§11, 26 §2), so a node whose rows
hold other texts writes snapshots whose hash no other node's matches. The genesis builder's exact
texts are in 06 §13 (and coinbase_total_distribution holds null there); a governance change
and its rollback change the value only, so the row keeps its text (§8). verified_count of gateway_registry is
carried unchanged on every write
and incremented by nothing. skipped_blocksmith has no primary key: two identical rows may exist.
2. Versioning: the one rule behind every table
Purpose. How a current value, an as-of value, a reorganisation and a snapshot are defined for every versioned object.
Inputs. A versioned table of §1 (a key, a height column, latest); the height h of the block
being applied.
Output and effect.
- Write at height h. Every row of the key with
latest = 1getslatest = 0; the new row is stored with height h andlatest = 1. A second write of the same key in the same block replaces the row at h (the object has at most one row per height). - Current value. The row of the key with
latest = 1. Node-local: a database imported from another node may hold severallatestrows for one key; the node then takes the one with the greatest height. - As-of value at height H. The row of the key with the greatest height ≤ H. The height
sentinel 0xFFFFFFFF means "current". Clients are served confirmed state at
tip − CONFIRMATION_DEPTH(3) this way (31). - Reorganisation to height T (§10): every row with height > T is deleted; every row of the table
gets
latest = 0; then the row with the greatest height per key getslatest = 1. - Snapshot at height S (§11): the row with the greatest height ≤ S per key travels without
latest; the loading node recomputeslatestas a reorganisation does.
Append-only tables (V = no) have one row per PK for ever; a reorganisation deletes rows above T
and a snapshot carries rows at or below S. A keyless versioned table (node_admission_timestamp,
fee_scale) keeps every row; its current value is the row with the greatest height. Tables with
no height column (consensus_parameters, bridge_coin, chain_metadata) travel whole;
consensus_parameters is rolled back through consensus_parameter_change (§8); the other two are
never written after genesis.
How to compute it. As stated. All heights are u32 block heights of the main chain
(spine_equivocation_charge is keyed by a spine height but versioned and rolled back by the main
chain height height that wrote it).
Rule activation. None.
Rejections and errors. An append-only insert whose PK already exists is an error that fails
the transaction and its block (used as a rule: spent_foreign_message, §6).
Vector. computed. INPUT: account A credited at height 100 to balance 50, then at 250 to 80.
EXPECTED OUTPUT: two rows (A, 100, balance 50, latest 0) and (A, 250, balance 80, latest 1);
as-of 199 → 50; as-of 250, 300 or 0xFFFFFFFF → 80; as-of 99 → no row. Reorganisation to T = 200 →
one row (A, 100, 50, latest 1). Snapshot at S = 300 → (A, 250, 80); at S = 200 → (A, 100, 50).
INVALID: inserting a second spent_foreign_message row with an existing msg_hash → the
transaction fails and its block is invalid.
Test cases · §2
5 cases · 4 valid · 1 invalid
An account credited at 100 and 250, read as of several heights
Loading the test widget…
The same account after a reorganisation to 200
Loading the test widget…
The account's row carried by a snapshot at 300
Loading the test widget…
The account's row carried by a snapshot at 200
Loading the test widget…
A second spent_foreign_message row with an existing msg_hash fails the transaction and its block
Loading the test widget…
Defects to match. None.
3. Accounts
Purpose. The ZBC balance and the per-address counters of every account, and the vocabulary every other chapter uses for accounts.
Inputs. A typed account address (§3.1); the writes of every chapter that moves ZBC.
Output and effect. The account_balance row:
| Column | Meaning |
|---|---|
account_address |
the typed account address (§3.1) |
block_height |
version height |
spendable_balance |
balance less this node's mempool reservations (node-local, 04 §7); equal to balance in a snapshot and after a reorganisation |
balance |
the consensus balance, atomic units (1 ZBC = 10⁸), never negative |
pop_revenue |
carried forward unchanged by every write; nothing increments it (0 on every account) |
latest |
§2 |
dataset_storage_bytes |
bytes of dataset records the account owns (10) |
prepaid_storage_balance |
prepaid storage (10, AddPrepaidStorage); it pays the account's own rents first (13) |
last_billing_height |
dataset billing clock (10) |
nonce |
transactions sent by this address (08 §1; the Ethereum carrier nonce, 02 §9, 31) |
rent_due_height |
next account-rent height; 0 = not on the clock (13) |
transact_policy |
opt-out mask, 9 category bits (08 §11) |
Terms used by every chapter:
- Balance holder. For an address that is a linked member of an account group (
18), its group's address; for any other address, the address itself. - The same account. Two addresses are the same account when they are equal byte for byte or when one is a linked member of the other (a member and its group are one account).
- Credit of
a ≥ 0to an address at height h: the holder's row is read; a missing row is created withbalance = spendable_balance = a,pop_revenue0 and every counter 0; otherwise both balances grow byawith a checked 64-bit add ("Balance overflow"refuses the write). When the row then hasrent_due_height = 0,balance > 0and the address is not rent-exempt (§3.2),rent_due_height = h + L(L= the snapshot cycle,main_snapshot_interval: one cycle free). A new version row is written at h. When the address is a deposit address0A000000 ‖ object_idof a stored DFS file (an activeaccount_datasetrow withobject_id= that id and apropertystartingdfs:/) or of a live dataset (adataset_objectrow of that id withlatest = 1and a non-emptyowner_account) anda > 0, the credit is also booked as the nextfile_depositrow of that object (seq= the number of rows already booked for it,payer_address= the payer the crediting path names, else null;10,13); a read of those two tables that fails is a storage fault of the block apply. - Incoming payment. A credit followed by the holder's split policy (
08§10); refunds and holds released are plain credits. - Debit of
aat height h: no row →"Account not found";a < 0→"SubtractBalance: negative amount";balance < a→"Insufficient balance"(only the confirmed balance decides; the spendable balance is never consulted); otherwise both balances shrink bya,spendable_balancefloored at 0; a new version row at h. - Nonce. Every transaction but Empty adds 1 to
nonceon the sender address's own row (no group resolution,08§1), and puts that row on the rent clock (h + L) the first time unless the address is a linked member or rent-exempt. A version row at h. An Ethereum carrier whose signed nonce is not this value makes the block that carries it invalid ("ForeignCarrierNonce: carrier nonce N, account nonce M (a block carrying it is invalid)"): nothing is charged, the nonce does not move and the carrier id is not marked spent (08§1). - Prune (
13): a tombstone version at h withbalance = spendable_balance = pop_revenue = nonce = rent_due_height = 0; the split policy is cleared by a versioned empty row; a pruned group account dissolves its group (18). A re-funded address starts at nonce 0. - Transact policy:
mask & 0x1FFwritten as a version row (nothing when the account has no row). - Group resolution: every balance read and write, token balance, ledger row and incoming credit on a linked member lands on its balance holder; the member's own row keeps only its nonce.
- Rent (
13): requiresprepaid_storage_balance + balance ≥ period_cost("Insufficient prepaid storage and balance for rent"), takes the rent from the prepaid storage first and the balance for the rest (spendable floored at 0), and advancesrent_due_heightby whole periods until it is above h. - Genesis arming (rule
genesis_rent_clock): after the genesis account rows are written, everyaccount_balancerow withlatest = 1,rent_due_height0 andbalance > 0is visited in byte order ofaccount_address; a rent-exempt address and a linked member whose holder is another account are skipped; every other row getsrent_due_height = 0 + Lat height 0. So every funded genesis account (node owners, treasury, release authority, market maker, test accounts) is on the clock from height 0 (06§5,13).
A read of an account row that fails for any reason other than "no row" is a fault of the block apply: the block is refused on that node.
3.1 Typed account addresses and accepted forms
Rule typed_accounts_only: an account is always its 4-byte little-endian type followed by its key
or hash, and the state keys it by exactly those bytes; no read tries a second form and no row is
an alias of another. A bare key is a value of exactly 32 bytes whose first four bytes are not
0D 00 00 00 (a 32-byte value that starts 0D000000 is a type-13 Cardano account, 4 + 28 bytes).
A bare key is a node key (node_public_key fields, ZNK_ text), never an account: it is
refused wherever an account is expected with the one text
accounts are typed: a bare 32-byte key is not an account on this chain. A node signs its duties
as its typed node-key account 00000000 ‖ node key; the node key of a sender is its last 32
bytes when the sender is exactly 36 bytes of type 0, and "no node" otherwise (09).
An address is well-formed when, by the type in its first 4 bytes (01 §4), its total length
is one of these:
| Type | Accepted total lengths |
|---|---|
| (bare key) | refused: "accounts are typed: a bare 32-byte key is not an account on this chain" |
0 ZBC, 3 Estonia eID, 10 DataSet (ZBS_), 11 Solana, 12 Polkadot |
36 |
| 1 BTC legacy, 5 P2PKH, 7 P2WPKH | 24, 37 (4 + 33-byte key), 69 (4 + 65) |
| 6 P2SH | 24 |
| 8 P2WSH, 9 P2TR | 36 |
| 4 ETH, 15 Tron | 24, 68 (4 + 64-byte key) |
| 13 Cardano | 32 (4 + 28) |
| 14 Ripple, 16 Tezos | 24 |
| 2 Empty, any other type | refused ("Invalid account address type") |
Other refusals: an empty value → "Empty account address"; 1–3 bytes, or a length the type does
not accept → "Invalid account address size". This is looser than the envelope's fixed-layout
parser (03 §3), which only ever produces the first length of each row; the longer forms exist
for addresses embedded in bodies.
Canonical forms (rule canonical_account_forms). An Ethereum or Tron account is its type and
the 20 Keccak bytes (24 bytes in all); a Bitcoin legacy, P2PKH or P2WPKH account is its type and the
20 HASH160 bytes (24 bytes). The longer lengths of those two rows — type 4 or 15 followed by a
64-byte key (68), type 1, 5 or 7 followed by a 33- or 65-byte key (37, 69) — are the full-key
forms. They are well-formed, but the envelope carries only the 24-byte form of these types (03 §3), so no transaction can ever be sent from a full-key form and whatever reaches one is stranded.
Wherever a transaction names an account — the envelope's sender, recipient and escrow approver, and
in a body a payee, member, controller, consent participant, player, escrow party, counterparty, new
owner, authority, release address, allow-list entry or split recipient — a full-key form is
refused, at admission and in a block, with "a full-key account form (an Ethereum or Tron key, a Bitcoin key) is not an account: no transaction can be sent from it; name the 20-byte address (rule canonical_account_forms)", which a body site prefixes with its own location (for example
"SplitPolicy: a recipient: "; the sites are in 08, 10, 11, 12, 14–18). A full-key
form is also not spendable (08 §3). A stored entry that no validation judged is never paid to a
full-key form (a split share stays with the holder, 08 §10), and a bridge deposit naming one is
not minted (34).
Custody accounts (rule bridge_withdrawal_credit). Each bridge coin (34 §1) has a derived
type-0 account, 00000000 ‖ SHA3-256("ZBC-BRIDGE-CUSTODY" ‖ token id as 8 bytes LE) (34 §1a; ZETH,
token 5: 00000000b070ddf68c3270c38319c7c4c76166a2c76d8e9a75c368c6769d0fe5cf4f4df2). Its 32 bytes are a
hash output, so no key signs for it: it is never a sender, and what it holds leaves only through
the registry's burn of a withdrawal. It receives nothing but a withdrawal of its own coin: a
transaction naming it as sender, recipient or escrow approver, or carrying its 32 bytes anywhere
in its body, is refused at admission and makes a block invalid (34 §5a), and a deposit minted to
it waits (34 §4). Being never credited with ZBC and never spending, it never arms a rent clock
(13).
A type can sign when it is one of 0, 1, 4, 5, 6, 7, 9, 11, 12, 13, 14, 15, 16. An address cannot sign when it is shorter than 4 bytes, a bare key, or of a type that cannot sign.
3.2 System pools and rent-exempt addresses
Three keyless accounts are the system pools, by exact 36-byte match: the longevity pool
00000000 ‖ "ZBCLONGV" ‖ 24 × 00, the storage pool 00000000 ‖ "ZBCSTORE" ‖ 24 × 00 (13,
11) and the lottery carry 00000000 ‖ "ZBCCARRY" ‖ 24 × 00 (01 §7, 21). None of them may
join a group. An address is rent-exempt when it is a system pool, the apps pool
00000000 ‖ "ZBCAPPS" ‖ 25 × 00 (16; not a system pool, and it may not join a group either), or
any 36-byte address of type 10 (0A000000 ‖ 32 bytes, a ZBS_ deposit address). A rent-exempt
address never gets a rent_due_height (not on its first credit, not on a nonce bump, not at the
genesis arming), and the rent sweep skips one even if it had a clock: it is never charged or pruned.
The longevity pool is also where every credit the rules refuse for a deterministic reason lands
(rule failed_credit_to_pool: a fired trigger, a schedule remainder, a pruned gateway's stake, a
token's returned backing; 08, 14, 17), so no ZBC is ever destroyed (01 §7).
How to compute it. As the rules above; integer arithmetic i64, checked on credit, guarded on debit.
Rule activation. typed_accounts_only, canonical_account_forms, genesis_rent_clock,
balance_credit_full_row and failed_credit_to_pool are active from height 0 on every chain; the
group rules belong to 18 and the writers.
Rejections and errors. As listed; each is a state refusal that the calling chapter turns into a paid no-op or a failed transaction; a storage fault fails the block on that node.
Vector. computed from the TestNet genesis file (06): its release authority
ZBC_PWF5RJA5_Z3VETBWR_5GO75GOK_SMBYOS34_HKWH53WN_MCUC6YMQ_EVZAAFOQ decodes (01 §5) to the
payload 7D8BD8A41DCEEA4986D1E99DFE99CA9303874B7C3AAC7EEECD60A82F61902572, so its row is keyed by
the 36 bytes 000000007D8BD8A41DCEEA4986D1E99DFE99CA9303874B7C3AAC7EEECD60A82F61902572; its
genesis allocation is 100,000,000,000 and the chain's main_snapshot_interval is 172,800.
EXPECTED OUTPUT at height 0, after the genesis arming: (account_address 000000007D8B…2572, block_height 0, spendable_balance 100,000,000,000, balance 100,000,000,000, pop_revenue 0, latest 1, dataset_storage_bytes 0, prepaid_storage_balance 0, last_billing_height 0, nonce 0, rent_due_height 172,800, transact_policy 0). INVALID: a read or write naming the 32 bytes
7D8BD8A4…2572 alone (the bare key) → accounts are typed: a bare 32-byte key is not an account on this chain, no row.
computed. Well-formedness: 00000000 ‖ 32 × 11 (36 bytes) → well-formed, can sign;
0A000000 ‖ 32 × 22 → well-formed, cannot sign, rent-exempt; 0D000000 ‖ 28 × 33 (32 bytes) →
well-formed Cardano; 32 × 44 (32 bytes) → "accounts are typed: a bare 32-byte key is not an account on this chain"; 00000000 ‖ 20 × 55 (24 bytes, type 0) → "Invalid account address size"; 02000000 → "Invalid account address type"; 11000000 ‖ 32 bytes (type 17) →
"Invalid account address type"; 04000000 ‖ 64 × 66 (68 bytes) and 05000000 ‖ 02 ‖ 32 × 77
(37 bytes) → well-formed, but full-key forms: named by a transaction they are refused with "a full-key account form (an Ethereum or Tron key, a Bitcoin key) is not an account: no transaction can be sent from it; name the 20-byte address (rule canonical_account_forms)"; 04000000 ‖ 20 × 66 (24 bytes) → the canonical Ethereum account, accepted.
Credit and rent clock: INPUT a new account 00000000 ‖ K credited 500,000,000 at height 1,000 on
a chain with main_snapshot_interval 172,800 → EXPECTED a row (balance 500,000,000, spendable 500,000,000, nonce 0, rent_due_height 173,800, block_height 1,000, latest 1). The same
credit to 0A000000 ‖ X → rent_due_height 0. A debit of 600,000,000 from the first account at
height 1,001 → "Insufficient balance", no row written. Genesis arming: every funded genesis
account of the TestNet file carries rent_due_height 172,800 at height 0 (172,800 = 0 + L); an
account the file lists with balance 0 carries 0.
Test cases · §3
26 cases · 15 valid · 11 invalid
The TestNet release authority's text address decodes to its typed account
Loading the test widget…
The TestNet release authority's account row at height 0, after the genesis arming
Loading the test widget…
A write naming the release authority's bare 32-byte key is refused
Loading the test widget…
A ZBC account is well-formed and can sign
Loading the test widget…
A ZBS_ deposit address is well-formed, cannot sign and is rent-exempt
Loading the test widget…
A 32-byte Cardano account is not a bare key
Loading the test widget…
The longevity pool is rent-exempt
Loading the test widget…
The apps pool is rent-exempt
Loading the test widget…
A bare 32-byte key is not an account
Loading the test widget…
A 24-byte type-0 address has the wrong size
Loading the test widget…
The Empty type is not an account
Loading the test widget…
An unknown type is not an account
Loading the test widget…
A 3-byte address has the wrong size
Loading the test widget…
An empty address is refused
Loading the test widget…
A 68-byte Ethereum full-key form is well-formed and is a full-key form
Loading the test widget…
A 37-byte P2PKH full-key form is well-formed and is a full-key form
Loading the test widget…
A transaction naming a 68-byte Ethereum full-key form is refused
Loading the test widget…
A transaction naming a 37-byte P2PKH full-key form is refused
Loading the test widget…
The 24-byte Ethereum account is the canonical form
Loading the test widget…
A transaction naming the 24-byte Ethereum account is accepted
Loading the test widget…
A first credit puts a new account on the rent clock one cycle ahead
Loading the test widget…
A credit to a ZBS_ address starts no rent clock
Loading the test widget…
A debit above the confirmed balance is refused
Loading the test widget…
A debit from an account without a row is refused
Loading the test widget…
A funded genesis account is on the rent clock from height 0
Loading the test widget…
A genesis account listed with balance 0 stays off the rent clock
Loading the test widget…
Defects to match. pop_revenue is a dead column (carried on every version row, never
incremented; the coinbase lottery credits through the ordinary balance path).
4. Tokens and token balances
Purpose. Every asset that is not ZBC (14).
Output and effect. token row: token_id (genesis 1–14, else derived by 14),
issuer_address (a typed account), symbol, name, decimals (0–18 at genesis, 0–8 for user
tokens, 14), total_supply, backing_asset (0 = ZBC), backing_amount, flags (bit 0
redeemable, bits 1–2 mint mode, bit 3 unbacked), persist_height (0 = never expires), versioned.
account_token_balance row: (account_address, token_id), balance, spendable_balance
(always written equal to balance: token holds are not reserved in the mempool, 04 §7),
versioned. Rules: a token credit is a checked add ("Token balance overflow"); a token
debit refuses a negative amount and balance < amount ("Insufficient token balance"); both
land on the balance holder (§3); several writes of one (account, token) in one block leave one
row at that height.
How to compute it. As stated.
Rule activation. 14.
Rejections and errors. As listed.
Vector. computed from the TestNet genesis file (06 §5): genesis token 1 is ZUSD, "Zoo US
Dollar", decimals 8 (the default), and the treasury
ZBC_CIHOJSU5_EWGXKZLJ_AHWEQNZX_HYDXMM3J_VV263DLD_7IY4PYFX_5ADSND7R (typed
00000000120EE4CA9D258D75656901EC4837373E07763369AD75ED8D63FA31C7E0B7E807) is allocated
100,000,000,000,000 of it. EXPECTED OUTPUT at height 0: an account_token_balance row
(00000000120EE4CA…E807, token_id 1, balance 100,000,000,000,000, spendable_balance 100,000,000,000,000, block_height 0, latest 1) and a token row with token_id 1, symbol
"ZUSD", name "Zoo US Dollar", decimals 8, flags 8, persist_height 0, block_height 0.
computed: INPUT a token debit of 101 units from a holder of 100 → "Insufficient token balance", nothing written; a token credit of 1 to a holder of 9,223,372,036,854,775,807 →
"Token balance overflow".
Test cases · §4
4 cases · 2 valid · 2 invalid
The TestNet genesis token 1 and the treasury's balance of it at height 0
Loading the test widget…
A token debit above the balance is refused
Loading the test widget…
A token credit past the 64-bit range is refused
Loading the test widget…
A token debit within the balance
Loading the test widget…
Defects to match. None.
5. The ledger
Purpose. One row per ZBC movement, so a client can rebuild a balance from movements, and the one consensus read of the block's own refunds.
Inputs. Every balance-moving write names the row it books.
Output and effect. Table account_ledger (history): account_address B, balance_change I,
block_height I, transaction_id I (may be null), event_type I, timestamp I; append-only,
no key (two identical rows are possible and meaningful). account_address is the balance holder
(§3) of the address the writer names; transaction_id is the id of the transaction that caused
the row, or of the object a block step settles (0 for a block-level credit with no reference);
timestamp is the row's own time, else the transaction's or the block's being applied, else 0 —
never the node's clock, so every node writes the same row. A row whose address is not well-formed
(§3.1) is refused (and not written; the node counts such refusals). Invariant: for every account
and every height interval, Σ balance_change over (h1, h2] = balance(h2) − balance(h1), on every
success path, no-op path and block step. Consensus reads only the current block's rows: the
reward pool subtracts the sum of the block's event-22 rows and adds the (negative) sum of its
event-70 rows (21). Whether a fee was collected is not read from the ledger or from the
sender's balance: under rule fee_collected_explicit every debit of the declared fee reports
itself, and the "not collected" rows (event 47) are written only when nothing was debited (04 §5). The table is history: pruned with the block window and not carried by a snapshot.
Event ids (event_type): 1 SendZBC / fee debit, 2 NodeRegistration, 3 UpdateNodeRegistration, 4
RemoveNodeRegistration, 5 ClaimNodeRegistration, 6 SetupAccountDataset, 7 RemoveAccountDataset, 8
reward, 9 ApprovalEscrow, 10 MultiSignature, 11 FeeVoteCommit, 12 FeeVoteReveal, 13
LiquidPayment, 14 LiquidPayment paid, 15 LiquidPaymentStop, 16 escrowed transaction, 17 dataset
storage fee, 18 dataset pruned, 19 rent to pool (dataset and account rent to the longevity pool,
13 10), 20 token expired, 21 token backing returned, 22 fee refund, 23 trigger fired, 24
account rent paid, 25 account pruned, 28 vesting release, 29 schedule paid, 30 schedule skipped,
31 gateway pruned, 32 dataset deposit refund, 33 dataset transferred, 34 schedule cancelled, 37
longevity funded, 38 longevity rent, 39 longevity payout, 40 longevity refund, 41 split out, 42
split in, 45 survival paid, 46 fee refund in token, 47 fee not collected, 48 group join out, 49
group join in, 50 survival to pool (also every refused credit the rule failed_credit_to_pool
sends to the longevity pool), 51 stored file funded, 52 token backing locked, 53 token
redeemed, 54 swap offer locked, 55 swap offer released, 56 exchange trade, 57 market creation
cost, 58 order locked, 59 order released, 60 exchange taker fee, 61 trigger locked, 62 trigger
cancelled, 63 schedule locked, 64 gateway stake locked, 65 gateway stake returned, 66 app stake,
67 app rake, 68 prepaid storage funded, 69 stored file rent, 70 multisig inner fee, 71 market
deposit refunded, 72 market rent fed (15), 75 lottery carry (21: + on the carry when a reward
waits, − when the next lottery takes it), 76 the 10 % at-risk share of a lock, to the longevity
pool (09), 77 snapshot archive reward, from the longevity pool (11), 80 a fee a lock paid, to
the longevity pool (04 §5), 83 prepaid storage spent (positive on the account: what its prepaid
storage paid of a rent row that carries the whole rent, so the rows still sum to the balance's
movement, 13), 84 an unstarted app's kept share, to the longevity pool (16), 100 app payout.
Reserved, never written: 26 oracle resolved, 27 bridge mint, 35 consensus parameter changed,
36 bridge burn, 43, 44, 73 market pruned and 74 burn (ZBC is never burned; the burn address of
01 §7 carries no rows). The full set with each row's sign is in 32.
How to compute it. One row per movement as each chapter specifies.
Rule activation. uniform_fee_refund, survival_field, market_rent, fee_collected_explicit
and failed_credit_to_pool: active from height 0 on every chain.
Rejections and errors. None visible outside the node.
Vector. computed. INPUT: a RegisterRelease by the release authority in block 348 with
transaction id −4,947,378,636,926,510,782, timestamp 1,793,514,635, declared fee 5,000,000 and a
floor of 2,500,484 (04 §5). EXPECTED OUTPUT, two rows for that account:
(balance_change −5,000,000, block_height 348, event_type 1, transaction_id −4947378636926510782, timestamp 1793514635) and (balance_change +2,499,516, block_height 348, event_type 22, transaction_id −4947378636926510782, timestamp 1793514635) (the fee debit and the
overpay refund; the account's balance moved by −2,500,484, the sum of the two rows). INVALID: a
row naming the address 02000000 → refused, not written.
Test cases · §5
2 cases · 1 valid · 1 invalid
The release authority's two ledger rows for a RegisterRelease in block 348
Loading the test widget…
A ledger row naming the Empty type is refused
Loading the test widget…
Defects to match. None.
6. Objects with a lifetime: datasets, files, longevity, escrow, streams, schedules, multisig
Purpose. The state objects a transaction creates and a later transaction or block step settles; their keys and the status conventions an implementation must keep.
Inputs. The chapters named in §1.
Output and effect. Keys and status fields:
account_dataset: one row family per record, key (setter, recipient, property); the setter is the record's owner. A record of a dataset object hasrecipient_account_address= the dataset'sZBS_address0A000000 ‖ object_id; a write to any other recipient is its own one-record dataset.is_active0/1;creating_tx_hashandobject_id= the object id (the deposit address is0A000000 ‖ object_id,01§4);added_by= the account that wrote the row (for a DFS file held by a group, the member that brought or created it);last_billing_heightis the record's own clock, read only when a dataset object has no clock of its own (10§12).dataset_object: keyobject_id;owner_account(empty = deleted),pending_owner,manage_mode0 private / 1 open / 2 public,last_billing_height= the object's rent clock (ruledataset_rent_object_clock: one clock per object, advanced by each rent charge without rewriting the records;10§12).dataset_delete_vote: key (object, voter); one row per standing vote to delete a dataset, the voter as a typed account; the deletion itself does not remove them (10).stored_file: keyfile_root;piece_ids= concatenated 32-byte ids;deposit;status0 active / 1 pruned;access_mode0 public / 1 private withallowed_addressesin the list encodingcount (u8) ‖ count × (len (u8) ‖ address)(11).storage_proof: one row per (piece, epoch, prover);proof32 bytes (11).longevity: keytarget_tx_id;deposit(0 = prunable again),paid_through_height,payload_bytes,cost_per_mib_locked,free_until_height,owner_address,funded_total;longevity_funder: running total per funder;longevity_deposit: every payment in order,seqfrom 0, written once (the payer is the balance holder of the paying address); what a payer still has is arithmetic over the rows, oldest consumed first (13);longevity_vote:voted1 standing, 0 withdrawn by a top-up (13).file_deposit: every payment into the deposit address of a stored DFS file or a live dataset, in order (seqfrom 0,payer_addressnull when no payer was named), so each payer's unconsumed part is defined at every height: a DFS file's deletion refunds it, a dataset's delete vote is weighed by it (10,11,13).escrow_transaction: keyid= the creating transaction's id;status;token_id(0 = ZBC);commission(never negative: ruleescrow_commission_nonnegative,12);decline_reason.escrow_request: keyid;escrow_transaction_idonce funded (12).liquid_payment_transaction: keyid;applied_time= the timestamp of the block that created the stream (ruleliquid_chain_clock,08§4),complete_minutes,status0 pending / 1 completed.trigger_schedule: keytrigger_id;kind0 trigger / 1 scheduled transfer / 2 vesting;status0 pending / 1 fired or done / 2 cancelled;funding_mode0 pre-locked / 1 pull;locked_remaining;fire_time(0 = height-driven);event_id(set = fires on an oracle result);creator_address(08,06§9).pending_transaction(keytransaction_hash;transaction_bytes,status),pending_signature(key (account, hash)),multisignature_info(keymultisig_address= the 32-byte hash H;minimum_signatures,nonce),multisignature_participant(key (H, account);account_address_index); the multisignature account itself is the type-0 account00000000 ‖ H(12).spent_foreign_message: keymsg_hash= a foreign carrier's native transaction id (08§1,02§9): for an Ethereum carrier the Keccak-256 of its canonical signed encoding (32 bytes), for a Solana carrier its signature (64 bytes), for a Bitcoin carrier its txid (32 bytes). A block that carries a carrier whose id is already in the table, or two carriers with one id, is invalid (ForeignCarrierReplayed,19); the row is inserted at h by the carrier's own execution.
How to compute it. Each chapter's rules; all through the versioned write of §2.
Rule activation. Per chapter.
Rejections and errors. Per chapter; the one table-level rule is the replay guard above.
Vector. computed from the TestNet genesis file (06 §9): its first vesting entry is the
faucet schedule, funder = the treasury 00000000120EE4CA…E807 (§4), recipient = the faucet
ZBC_ELBIB5B3_UOEFOFEK_W7YICC7B_PL4HD7ED_RPF3TULW_HS667KIA_7A7XAJUC =
0000000022C280F43BA38857148AB7F0810BE17AF871FC838BCBB9D1763CBDEFA900F83F, token_id 0,
per_fire_amount 160,000,000,000, interval_seconds 86,400, remaining_fires 600,
cliff_seconds 0, cancel_policy 1, funding_mode 1, index 0; the genesis timestamp is
1,793,509,027. trigger_id = the little-endian i64 of the first 8 bytes of
SHA3-256(funder36 ‖ recipient36 ‖ LE64(0) ‖ LE64(0) ‖ "VEST") with the sign bit cleared =
9,216,412,776,157,539,296 (E0EB3DDA9646E77F as i64 LE). EXPECTED OUTPUT, the trigger_schedule
row at height 0: (trigger_id 9216412776157539296, owner_address 00000000120E…E807, recipient_address 0000000022C2…F83F, amount 0, fire_height 0, status 0, block_height 0, latest 1, event_id "", fire_time 1793509027, interval_seconds 86400, remaining_fires 600, end_time 0, per_fire_amount 160000000000, token_id 0, funding_mode 1, locked_remaining 0, cancel_policy 1, kind 2, consecutive_skips 0, creator_address null).
Test cases · §6
1 case · 1 valid
The TestNet faucet's genesis vesting schedule row
Loading the test widget…
Defects to match. None recorded here; each object's own chapter lists its defects.
7. Exchange and apps
Inputs. Their chapters.
Output and effect. swap_offer (key id; status; counterparty_address the typed account
as given, empty for an open offer), market (key id; deposit = the market's rent balance;
paid_through_height = the height rent is paid to), order_book (key id; side 0 buy / 1
sell; price, amount, remaining, status, expiry), trade (one row per (taker order, maker
order); taker_fee, timestamp), app (key id; players = the players in joining order, each
u8 length ‖ the player's typed account (4–255 bytes); opponent_address = the invited opponent's
typed account, or empty; pot, state_blob, heights, winner_address, persist_height,
channel; pending_move = a dice move waiting for the next block's seed; owed_payout = a won
solo bet's payout the pool still owes; paid_payout = what the pool has paid this solo bet's
winner so far, read by the payout cap), app_settlement (key app_id). Open orders are read
"asks by price ascending then id ascending; bids by price descending then id ascending" — the
matching order (15).
How to compute it. Per chapter.
Rule activation. Per chapter.
Rejections and errors. Per chapter.
Vector. computed: INPUT a players value 24 00000000‖K1 18 04000000‖E1 (K1 32 bytes, E1 20
bytes) → EXPECTED OUTPUT two players, the 36-byte ZooBC account and the 24-byte Ethereum account,
in that order; INPUT 24 00000000‖K1 00 → one player (a length 0 ends the list); INPUT
24 00000000‖(20 bytes) → no player (the entry overruns the value, the list ends).
Test cases · §7
3 cases · 3 valid
Two players: a ZooBC account and an Ethereum account
Loading the test widget…
A length of 0 ends the list
Loading the test widget…
An entry that overruns the value names no player
Loading the test widget…
Defects to match. None recorded here.
8. Registry, consensus and governance tables
Purpose. The state the block rules read.
Output and effect.
node_registry: keyid(06§6 derivation: the first 8 bytes of the node key as a little-endian u64 with the sign bit cleared);node_public_key32 bytes;account_address= the owner's typed account;registration_height;locked_balance;registration_status0 registered, 1 queued, 2 deleted (9); versioned byheight. A snapshot also carries every row from the safe height to the snapshot height (the window blocksmith selection reads,20).participation_score: keynode_id,score(may go negative), versioned byheight(23).node_admission_timestamp: every row is kept; the newest is the next admission time (9).skipped_blocksmith: append-only (20);node_liveness,queue_state(versioned byheight),queue_attendance(one row per (node, window)) (9,20).node_livenesscarriessuspension_since(the first height of the current unbroken suspension, read by the suspension clock in preference tosuspended_height), the score road'slast_block_height(the node's last own block),missing_clockandadmitted_clock(the unit clock's reading when the node went missing and when it was admitted) and the exit'slast_miss_height(36,09).score_unit_clock: one row per height at which the unit clock was read and advanced (clock,unit), pruned below the receipt horizon (36).survival_state: the survival-mode flag of each height,active0/1, one row per applied block (heights ≥ 1) while the genesis parametersurvival_min_producersis above 0; a missing row reads as false. Height 0 has no row and its flag is false by definition; the flag of height h is computed from the stored flag of h − 1 and the producers of the 120 blocks before h (19,36), and the block that applies h stores exactly that value. Rows are kept for the rollback depth plus the 120-block window and for as long as a pending oracle event or release vote counts them (§11).readiness_bundle_decision(rulereadiness_decision_state,29): one version row per readiness-gated bundle, written by the block atheight= h* − 1 whose tally passes, witheffective_height= h*, the height the bundle's rules switch on; a restart or a snapshot joiner reads the latest row per bundle (valid only wheneffective_height = height + 1); a chain state without a row for a bundle has not activated it.- The liveness and registry tables, all keyed and rolled back by
height:liveness_expulsion(an expulsion at score zero, the API'sexpelled_height);lock_release(a queued node's held exit: itsrelease_height,amount,feeand the 10 % share, to the longevity pool);node_claim(an announced node-key claim, itsclaimer,due_heightandstatus, ruleclaim_two_step);equivocation_charge(one row per (blocksmithnode_id,equivocated_height) with thereporter, ruleequivocation_miss,35);spine_equivocation_charge(one row per (voternode_id,spine_height) with thereporter, rulespine_equivocation_report, type 62,35: a spine height has its own table because it is not a main chain height);node_exit(a registered node leaving: announced and leave heights, whether it was missing at the exit,status);seat_change(a node-key or owner change waiting 120 blocks for itsdue_height; a null key or address means that part stays);roll_call(a genesis registered node's answer or its removal at the window's end). network_topology: one row perperiod_heightwith a 64-bytetopology_seedandnode_count(28).fee_scale: every row kept, newest = current, seeded at genesis (04§3);fee_vote_commitment_vote,fee_vote_reveal_vote: append-only; a voter may commit in several periods (17,04§3).oracle_attestation(versioned, key (event, attester): a newer attestation by the same attester is a new version row and the current one is the latest; governance votesZBCGOV1:…, release votesZBCREL1:…and bridge events share the table and are pruned by their own windows, §11),oracle_result(one per event, written at itsresolved_height; the replay guard of bridge mints and burns) (17,34).bridge_withdrawal_request(rulebridge_withdrawal_credit,34): keytrigger_hash= the hash of the TransferToken that paid a bridge coin's custody account with a valid withdrawal (34§5); the row holdscustody_address(the typed custody account),token_id,amountanddestination(the foreign address as text), written only when that transfer was credited (14); a withdrawal is resolved only from a row whose fields equal the attested ones.consensus_parameters:parameter_name → parameter_valuewith adescriptiontext, no height; the genesis rows of06§13: the stored parameters of06§2,min_registry_size,survival_min_producersandspine_late_vote_after_secondswhen the genesis names them, onerule.<name>row per rule the genesis lists (125 rules,29), each with the builder's description text, andcoinbase_total_distributionwith a null description (206 rows on TestNet, 207 on DevNet, 205 on the mainnet template). A governance change (17) changes the row's value only: the row keeps its description (a name with no row gets a new row with a null description); it also writes aconsensus_parameter_changerow (had_row1 when the name had a row,old_value,new_value,block_height). A reorganisation below that height writesold_valueback into the row, the description again untouched, or deletes the name whenhad_row= 0, and deletes the change row, newest change first.account_group,account_group_member(18);account_split_policy(entries= the wire encodingcount (u8) ‖ count × (len (u8) ‖ address ‖ share_bp (u16 LE)),00= cleared) (08).release_authority(single key 1),release_registry(keyversion;revoked0/1),gateway_registry(status0 active / 1 withdrawn,locked_stake,last_heartbeat_height),archival_registry,relay_registry(17).bridge_coin: genesis-only, never written afterwards (06§5); read by the withdrawal and custody checks of every transaction and by the deposit step (34§1a, §5, §5a).chain_metadata: genesis-only, nine rows written by the genesis build and never afterwards, every value as text (exact forms in06§13):chain_id(the chain name),genesis_timestamp(decimal seconds),genesis_hashandconfig_hash(64 lower-case hex characters,06),total_supply(decimal: the emission ceiling, 3,333,333,333,333,333 unless the genesis names another),coinbase_total_distributionandcoinbase_total_supply(decimal: the coinbase pool,06§8, both the same value),coinbase_number_rewards_per_secondandcoinbase_max_number_rewards_per_block(decimal: 1 and 600 on every shipped file). Read by the coinbase (21) and by the SendZBC supply bound (08§3); it travels whole in a snapshot so that a snapshot joiner and a genesis-built node judge the same bound.
How to compute it. Per chapter.
Rule activation. Per chapter; the gated tables of §1.
Rejections and errors. Per chapter.
Vector. computed from the TestNet genesis file (06 §6): its first node entry is
node_public_key ZNK_OFPKRYXV_DO6LO6FC_NZU5OO6R_ARH6HJB5_O3FRZ5WL_YOU2MYNC_7OWAOVEQ =
715EA8E2F51BBCB778A26E69D73BD1044FE3A43D76CB1CF6CBC3A9A661A2FBAC, owner
ZBC_WZTVPBV6_34ULHZ64_3C5MTP4Z_OWFTUZDA_IVYL77IS_7UIMX4QL_HHVACESO. EXPECTED OUTPUT, its
node_registry row at height 0: (id 4016115710591262321, node_public_key 715EA8E2…FBAC, account_address 00000000B6675786BEDF28B3E7DCD8BAC9BF99758B3A64604570BFFD12FD10CBF20B39EA, registration_height 0, locked_balance 0, registration_status 0, latest 1, height 0) — the id is
the first 8 bytes 71 5E A8 E2 F5 1B BC B7 read little-endian (0xB7BC1BF5E2A85E71) with the sign
bit cleared (0x37BC1BF5E2A85E71 = 4,016,115,710,591,262,321). chain_metadata of the same file:
(chain_id, "zoobc-test"), (genesis_timestamp, "1793509027"), (total_supply, "3333333333333333"). computed: INPUT consensus_parameters row (X, 5), then a change at
height 300 to 7 → rows (X, 7) and change (id 1, X, had_row 1, old 5, new 7, 300); a
reorganisation to 299 → (X, 5), no change row; the same with no row for X before (had_row 0) →
after the reorganisation X has no row. INPUT, on the TestNet genesis, the row
(dataset_storage_cost_per_mib, 5000000, "Storage rent: atomic ZBC charged per MiB per billing period") changed at height 172,800 to 6,000,000 → (dataset_storage_cost_per_mib, 6000000, "Storage rent: atomic ZBC charged per MiB per billing period"); a reorganisation to 172,799 →
(dataset_storage_cost_per_mib, 5000000, "Storage rent: atomic ZBC charged per MiB per billing period"), the same row as a node that never applied the change, so both write the same snapshot
bytes. As the consensus_parameters entry of the snapshot document (06 §13, CBOR as 26 §2):
before the change 18,781 bytes, SHA3-256
C1243461D81BA42E14F590E5C5A7E16F4ED73F413065D16C486DEC688E707BF3; after the change 18,781 bytes,
F84BA7646A106487193787C90D6A5EA3A5B94D420A06BDE0C87F21025249F1DE (the row 83 78 3B "Storage rent: …" 78 1C "dataset_storage_cost_per_mib" 1A 00 5B 8D 80); after the reorganisation 18,781
bytes, C1243461…7BF3 again. INPUT, on the same genesis, a change at 172,800 of
spine_late_vote_after_seconds (a name the TestNet file does not write) to 10,800 → a new row
(null, spine_late_vote_after_seconds, 10800), the entry 207 rows, 18,817 bytes,
01CBD02324D3F16F5E8163E3E5A98921658668B032C6D6CCCFAC8D832176BEE9; a reorganisation to 172,799
deletes the row and the entry is C1243461…7BF3 again. INPUT, on a chain where bundle 602 is readiness-gated (a
later release whose rules the genesis file does not list; bundle 601 is gated on no chain built
from 0.6.1, because the shipped genesis files list all its rules at 0, 29 §4b), a
readiness_bundle_decision row (bundle_id 602, effective_height 5,001, height 5,000, latest 1)
→ a node whose binary carries bundle 602 and restarts at tip 5,000 or above treats bundle 602 as
active from 5,001 (a node on an older binary stops producing there, 29 §4b); a reorganisation to
4,999 deletes the row and the bundle is not activated.
Test cases · §8
12 cases · 12 valid · 1 reference
A TestNet genesis registered node's registry row at height 0
Loading the test widget…
The registered node's ZNK_ text decodes to its node key
Loading the test widget…
The registered node's id derives from its key
Loading the test widget…
The TestNet file's chain_metadata rows
A stated value: there is nothing to compute. A compatible node shows the same value.
- chain_id
zoobc-test- genesis_timestamp
1793509027- total_supply
3333333333333333
A parameter change at height 300 writes a change row
Loading the test widget…
A reorganisation to 299 restores the old value and drops the change row
Loading the test widget…
A reorganisation below a parameter's first write removes it
Loading the test widget…
A price change at 172,800 and a reorganisation to 172,799: the description stays
Loading the test widget…
A change of a name the genesis did not write, then a reorganisation below it
Loading the test widget…
A decision row for a gated bundle 602: a restart at tip 5,000 treats it as active from 5,001
Loading the test widget…
The same row read at a restart at tip 6,000
Loading the test widget…
A reorganisation to 4,999 deletes the decision row: bundle 602 is not activated
Loading the test widget…
Defects to match. None.
9. History and node-local tables
Purpose. What a node holds that is not consensus state, and what it may shape freely.
Inputs. None.
Output and effect.
| Table | Kind | Note |
|---|---|---|
main_block |
history | the block window of 26; the genesis row is always kept (06); carries block_seed_proof (05 §5) |
zbc_transaction |
history | the window plus longevity-kept transactions (13, 26); also the "already confirmed" check of 04 and 19; carries expiry (03 §4) |
published_receipt |
history | the window from the safe height (23, 26); also the "already published" check of rule receipt_once (19) |
account_ledger |
history | §5 |
account_transaction_index, eth_tx_hash |
API index | rebuilt from transactions; cut with blocks (31) |
mempool, transaction_staging |
local | 04 |
node_receipt, merkle_tree |
local | receipts this node collected and the trees it built (23) |
node_address_info |
local | peer addresses (28) |
participation_score_ledger, node_registry_ledger |
audit | never read by consensus |
producer_signed_parent |
local | the one block this node signed over each parent, so a crash cannot make it equivocate (20) |
rule_activation_record |
audit | (rule, edge) → (edge_height, block_hash, height): the rule edges this chain crossed, written at genesis and at each on/off height, checked against the node's own rule table at start (06 §11, 29) |
storage_missing, storage_unconfirmed |
local (storage audit ledger) | storage_missing(node_public_key B, piece_id B, epoch I, height I), PK the first three: an expected holder silent at a (piece, epoch); storage_unconfirmed(piece_id B PK, streak I, epoch I, height I): a piece's streak of epochs with no confirmed tally. Created by the first storage-proof tally, deleted above T on a reorganisation, read by nothing in consensus (11) |
spine_deferred_check |
spine | (spine_height PK, block_hash): a spine block stored ahead of this node's main chain whose content checks wait until the main chain reaches its reference (25, 26) |
spine_promise, spine_refused |
spine (local) | this node's standing signing commitment per pending spine height (the proposal identity it signed, its signature floor, the proposal and the identities it signed there; rule cosign_promise_binds) and the proposal identities it refused per pending height; both restored at start and cut at the spine tip (25) |
spine_late_refusal |
spine | the late non-signing statements that travel with their spine block (rule spine_late_vote, 25) |
spine_block, spine_block_manifest, spine_public_key, spine_skipped_blocksmith, chain_reference_heights |
spine | 25, 26 |
node_notification_outbox |
local | this operator's notification queue (30) |
dfs_chunks |
local | off-chain file content (11) |
None of these is carried by a snapshot's state section; 26 says which history travels beside it.
How to compute it. Per chapter.
Rule activation. None.
Rejections and errors. None.
Vector. none.
Test cases · §9
1 case · 1 valid · 1 reference
The history and node-local tables have no vector
A stated value: there is nothing to compute. A compatible node shows the same value.
- value
none
Defects to match. None.
10. What a reorganisation does to the state
Purpose. The exact state effect of popping blocks back to height T (24 specifies when).
Inputs. T.
Output and effect. For every table of §1 with a height column: every row with height > T is
deleted (network_topology by period_height, oracle_result by resolved_height,
spine_equivocation_charge by the main chain height that wrote it); for the versioned ones,
latest is recomputed as the row with the greatest surviving height per key (§2;
readiness_bundle_decision and bridge_withdrawal_request included). consensus_parameters is
restored through consensus_parameter_change (§8). spendable_balance is set to balance on
every latest account row (the mempool re-applies its reservations afterwards, 04 §7). The
history and index tables are cut at T too (account_ledger, published_receipt,
account_transaction_index, eth_tx_hash, merkle_tree; node_receipt by
reference_block_height), the storage audit tables by height, and the spine tables by their own
heights (25). producer_signed_parent is pruned with the kept window, not by T. bridge_coin
and chain_metadata are untouched. A failed delete or update fails the whole pop (nothing is
committed).
How to compute it. As stated, inside one atomic step with the block pop.
Rule activation. None.
Rejections and errors. None visible outside the node.
Vector. computed. INPUT: tip 1,005; survival_state rows 1,000…1,005; an account with rows
at 990 (balance 10, latest 0) and 1,003 (balance 12, latest 1, spendable 9); a
dataset_delete_vote row (O, V, 1,004, latest 1); a readiness_bundle_decision row (602, 1,003,
1,002, latest 1) (a gated later bundle, as in §8); reorganisation to T = 1,001. EXPECTED OUTPUT:
survival_state rows 1,000 and 1,001; the account row at 990 with latest 1 (spendable 10); no
vote row for (O, V); no decision row for bundle 602.
Test cases · §10
5 cases · 5 valid
An account after a reorganisation to 1,001
Loading the test widget…
The same account before the reorganisation (spendable 9)
Loading the test widget…
Survival-state rows after a reorganisation to 1,001
Loading the test widget…
A delete vote written at 1,004 is gone after a reorganisation to 1,001
Loading the test widget…
A gated bundle 602's decision row written at 1,002 is gone after a reorganisation to 1,001
Loading the test widget…
Defects to match. A rollback can reach only T ≥ tip − max_rollback_height (24); the local
prune keeps, for node_registry, participation_score, node_liveness, queue_state,
account_balance and the multisig envelopes, every superseded version a rollback to such a T
could need (a version goes only once a newer version of its key sits at or below min(receipt horizon, tip − max_rollback_height)).
11. What a snapshot carries
Purpose. The state section of a snapshot (26 gives the file and its encoding).
Inputs. Snapshot height S, safe height F = S − main_snapshot_min_height (TestNet 760,
DevNet 80; 1,440 = MIN_ROLLBACK_BLOCKS when the parameter is 0; F = 0 when S is not above it:
the safe height of the snapshot document, 26 §2).
Output and effect. For every table of §1 whose gate (if any) is active at S, in §1's order, as
the state stood when block S was committed, less every row the local prune at height S deletes
(so the content does not depend on how far each node's own prune had got), the snapshot writes one
entry table name → {"Columns": [...], "Rows": [[...], ...]}:
- Columns = the table's columns except
latest(and exceptdataset_object.last_billing_heightwhiledataset_rent_object_clockis not active at S), sorted by name in byte order; every row lists its values in that order. - Values: integer, text, bytes or null, as stored;
spendable_balanceofaccount_balanceandaccount_token_balanceis written equal tobalance. - Rows, ordered by the table's key then height: versioned with a key → the row with the
greatest height ≤ S per key (for
node_registrythe row with the greatest height below F per key, plus every row with F ≤ height ≤ S); versioned without a key (node_admission_timestamp,fee_scale) → every row with height ≤ S; append-only → every row with height ≤ S; no height column → the whole table. - A table the node has not created is written as
{"Columns": [], "Rows": []}, so every snapshot names every table whose gate is active.
The rows the prune at S deletes, and so the snapshot leaves out. Nothing is deleted while S is
at or below the receipt lifecycle R = max(max(100, 2 × registered nodes) + 1, the genesis receipt_lifecycle); above it, with the receipt horizon S − R, the rollback depth D = max_rollback_height, the floor f = min(S − R, S − D) and the snapshot cycle L:
- a superseded version (
latest0) ofnode_registry,participation_score,node_liveness,queue_stateoraccount_balancewhose height is belowfand whose key has a newer version at or belowf; score_unit_clockrows belowS − R;queue_attendancerows belowS − Rwhose window is at least two windows older than the newest window evaluated at S (9);skipped_blocksmithrows belowf;- fee votes (both tables) below
min(S − R, S − (L + D)); oracle_attestation: a parameter vote (ZBCGOV1:prefix) below the start of the vote window of lengthL + Dthat contains S (17); a release vote (ZBCREL1:prefix) of a resolved event belowS − (RELEASE_VOTE_WINDOW_BLOCKS + D)(172,800 + D), and of an unresolved event whose survival-adjusted ageS − height − (survival heights in (height, S])exceeds that window; any other attestation belowS − Rexcept an unresolved event whose survival-adjusted idlenessS − newest attestation height − (survival heights in (newest, S])is at most 720 (BRIDGE_EVENT_IDLE_WINDOW);survival_state: a row is deleted only when its height is below bothkeep_from = max(1, S − (D + 120) + 1)andpending_oldest, wherepending_oldestis the lowest of: the newest attestation height of every unresolved event of item 6's last clause, and the row height of every unresolved release vote still inside its survival-adjusted window; with no such event or vote there is no second bound. So the survival rows a pending event or vote counts are never pruned before its own rows are;- an executed MultiSignature envelope below
fwith every older version of it, and the signatures of an envelope that is no longer pending at or belowf(12).
Every horizon is read from the consensus parameters as of block S. A rule gate in this list
(survival_mode for item 7 and the survival clauses of item 6, attendance_tail for item 3) is
active from height 0 on every chain; the full prune, including the history tables, is in 13 and
26.
The loading node, for each table of the list present in the section, in order: a table entry that
is not an object, or lacks a Columns or Rows list → refused; a table the node has not created is
skipped when its Rows list is empty and refused otherwise; a column the node does not have →
refused; then every row the node holds in that table is deleted, at every height (a node
recovering from a fork by snapshot loses its fork's rows above S as well; the genesis rows come back
with the snapshot's rows); a table carried with no columns but with rows → refused; the rows are
inserted (a row whose length differs from the column count, or a value that is not null, integer,
text or bytes → refused); for a versioned table, latest is recomputed (the row with the greatest
height per key; for a keyless versioned table, the rows at the greatest height). A table missing
from the section (a gated table whose gate was off at S, or one the source never had) is left
untouched.
How to compute it. As stated.
Rule activation. The gates of §1; all active from height 0 on every chain.
Rejections and errors. "Snapshot has no StateTables section", "Malformed snapshot table <t>",
"Snapshot table <t> has no Columns or Rows list", "Snapshot carries table <t> which this node does not have", "Malformed snapshot column name in <t>", "Snapshot column <t>.<c> does not exist on this node: the snapshot is from a different release", "Snapshot table <t> has rows but no columns", "Malformed snapshot row in <t>", "Malformed snapshot value in <t>.<c>". Any of them
refuses the whole snapshot.
Vector. computed. INPUT: S = 300; fee_scale rows (0, 1,000,000), (240, 1,100,000);
survival_state rows 1…300 all active 0 (N = 5, a chain with receipt_lifecycle 1,440: S is
below the lifecycle, nothing is pruned); a node that never created dataset_delete_vote.
EXPECTED OUTPUT entries:
"fee_scale": {"Columns": ["block_height","fee_scale"], "Rows": [[0,1000000],[240,1100000]]},
"survival_state": {"Columns": ["active","height"], "Rows": [[0,1],[0,2],…,[0,300]]},
"dataset_delete_vote": {"Columns": [], "Rows": []},
"chain_metadata": {"Columns": ["key","value"], "Rows": [["chain_id","zoobc-test"], …]} (nine
rows in byte order of key, 06 §13), "consensus_parameters": {"Columns": ["description","parameter_name","parameter_value"], "Rows": [["Account groups: addresses per group, the controller included (100)","account_group_max_members",100], …]} (206 rows on TestNet, the
texts of 06 §13, which a governance change leaves in place); and for an account row (A, 250, balance 80, spendable 70, …):
Columns ["account_address","balance","block_height","dataset_storage_bytes","last_billing_height","nonce","pop_revenue","prepaid_storage_balance","rent_due_height","spendable_balance","transact_policy"],
the row's spendable_balance value 80; dataset_object Columns
["height","last_billing_height","manage_mode","object_id","owner_account","pending_owner"].
INPUT: S = 100,000 on a chain with receipt_lifecycle 1,440, max_rollback_height 720, no
pending event or release vote → survival_state carries the rows 99,161…100,000 (keep_from =
100,000 − 840 + 1); with an unresolved release vote at height 50,000 whose survival-adjusted age
is within 173,520 → the rows 50,000…100,000. INVALID: an entry "token": {"Columns": [], "Rows": [[1]]} → "Snapshot table token has rows but no columns"; a column "account_balance.colour" →
"Snapshot column account_balance.colour does not exist on this node: the snapshot is from a different release".
Test cases · §11
12 cases · 9 valid · 3 invalid
A snapshot carries every fee_scale row at or below S
Loading the test widget…
Survival-state rows 1 to 300 below the receipt lifecycle all travel
Loading the test widget…
A table the node never created travels empty
Loading the test widget…
chain_metadata travels whole, its seven rows in byte order of key
Loading the test widget…
An account row travels without latest, its spendable balance equal to its balance
Loading the test widget…
dataset_object travels with its six columns
Loading the test widget…
At S = 100,000 the snapshot carries the survival rows from keep_from = 99,161
Loading the test widget…
An unresolved release vote at 50,000 keeps the survival rows from 50,000
Loading the test widget…
A table entry with rows but no columns is refused
Loading the test widget…
A column the node does not have is refused
Loading the test widget…
Rows for a table the node does not have are refused
Loading the test widget…
An empty entry for a table the node does not have is skipped
Loading the test widget…
Defects to match. A versioned table without a key carries all its rows ≤ S, not only the newest; the append-only tables carry every row ≤ S that the prune at S keeps; a node that writes a snapshot must do the same or its snapshot hash differs.
12. Touched accounts of a transaction
Purpose. The set of accounts a transaction directly references, used by the gateway's push
feed (31); not consensus, specified because clients rely on it.
Inputs. A transaction.
Output and effect. De-duplicated typed addresses of at least 24 bytes (the empty and
02000000 placeholders are skipped), in first-seen order: always the sender; plus the recipient
for SendZBC, TransferToken, LiquidPayment, CreateTrigger, ScheduledTransfer, SetupAccountDataset,
RemoveAccountDataset (a dataset record's recipient is the dataset's ZBS_ address),
DeclineEscrowRequest; every recipient in the body of SendZBCBatch and TransferTokenBatch; the
split recipients of SetSplitPolicy; the invited opponent of CreateApp; the member of LinkAccount,
UnlinkAccount, SetMemberPermissions; the new controller of TransferGroupControl; the participants
of a MultiSignature whose body carries the multisig info; the proposed sender and approver of an
EscrowRequest. Every other type, the duty types QueueAttendance 59, EquivocationReport 60, RollCall
61 and SpineEquivocationReport 62 included: the sender only (a ClaimNodeRegistration's owner
recipient is reached through the ledger union below). An app transaction names its app_id
(CreateApp → its own id; JoinApp, ResignApp, ClaimAppTimeout, AppMove, SettleApp → the body's app
id), and the block-level endpoint adds the app's creator, every player and the invited opponent from
the app's state. The block-level feed is the union of these sets with the block's ledger
addresses.
How to compute it. As listed.
Rule activation. None.
Rejections and errors. None.
Vector. computed: INPUT a SendZBC from 00000000 ‖ K1 to 00000000 ‖ K2 → EXPECTED
[00000000‖K1, 00000000‖K2]; a SendZBC from 00000000 ‖ K1 to itself → [00000000‖K1]; a
RegisterRelease (recipient empty) → [sender]; a SpineEquivocationReport → [sender].
Test cases · §12
4 cases · 4 valid
A SendZBC touches its sender and its recipient
Loading the test widget…
A SendZBC to oneself touches one account
Loading the test widget…
A RegisterRelease touches its sender only
Loading the test widget…
A SpineEquivocationReport touches its sender only
Loading the test widget…
Defects to match. None.
13. The node's spendable-balance view
Inputs. The latest account rows; block commits; reorganisations; this node's pending pool.
Output and effect. Node-local; no consensus effect. The only observable effect is the
admission refusal "Sender has insufficient balance for fee" when the sender's spendable balance
(balance less this node's reservations) is below the fee. An implementation may keep this view in
memory or compute it on demand.
How to compute it. Not required beyond 04.
Rule activation. None.
Rejections and errors. As stated.
Vector. computed: INPUT balance 5,000,000, this node holds a pending transaction reserving
3,000,000, a new transaction with fee 2,500,004 → EXPECTED "Sender has insufficient balance for fee" at this node (another node without the pending transaction admits it).
Test cases · §13
2 cases · 1 valid · 1 invalid
A fee the node's reservations leave uncovered is refused at staging
Loading the test widget…
Another node without the pending transaction admits it
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.