On this page
- §0 The area in one paragraph
- 1. What every transaction passes through before its type runs
- 2. Empty (0)
- 3. SendZBC (1)
- 3.1 SendZBCBatch (257)
- 4. LiquidPayment (6) and LiquidPaymentStop (262)
- 5. CreateTrigger (15) and CancelTrigger (16)
- 6. ScheduledTransfer (29)
- 7. CancelSchedule (30)
- 8. ReassignSchedule (31)
- 9. SetSplitPolicy (54) and SetTransactPolicy (50): the bodies
- 10. The split policy's effect on every incoming payment
- 11. The transact policy's effect on every transaction
- 12. The ledger rows of this family
08 — Transfers, streams, schedules, triggers and the two account policies
Out of scope the envelope, the message classes and the carrier's canonical forms and chain binding (03 §8, 02 §9); the fee floor, the overpay refund and the not-collected rows (04 §5); the carrier nonce queue of the mempool and the staging pool (04); the escrow option on SendZBC (12); the account-group gate and the member window (18); the longevity survival deposit (13); the oracle that resolves event-conditioned triggers (17); the reward pool (21); the ordering of the per-block steps among each other (22); the survival flag itself (19, 36)
§0 The area in one paragraph
This family moves ZBC (and, through the same objects, tokens) between accounts now or later. A
SendZBC credits a recipient at once; a SendZBCBatch pays up to 25 recipients in one
transaction, all or nothing; an Empty transaction moves nothing and exists for its message. A
LiquidPayment locks an amount that vests linearly over a number of minutes and is paid out
when the window closes or when either party stops it. A ScheduledTransfer pays a fixed amount
per fire, a fixed number of times, either from a lock taken at creation (mode 0, "vesting") or
from the owner's live balance at each fire (mode 1, "pull"); its recipient may redirect it and the
owner (when revocable) or the recipient may cancel it. A CreateTrigger locks an amount that a
later block height (or an oracle event) releases to a recipient, and a CancelTrigger takes it
back. Two per-account policies shape every credit and every transaction: a split policy
forwards fractions of every incoming payment to other accounts, and a transact policy opts the
account out of whole categories of transactions in both directions, so that a refused transaction
is bounced for its fee without moving funds. Standing properties: a condition that depends on state
the sender could not see at admission is a paid no-op, never a failed block (the one exception, an
Ethereum carrier whose nonce is not the account's, cannot arise in a block built from the pool,
§1 step 3); an overspend, a
missing sender row or a type not yet active is a failed block; every balance test that decides a
block uses the confirmed balance (07 §3); every clock a block step or a stream reads is the
chain's (the previous block's timestamp for what is due, rule expiry_previous_stamp; the block's
own timestamp for when a stream starts and splits, rule liquid_chain_clock), never a timestamp the
sender chose; a credit the rules refuse is never lost but goes to the longevity pool (rule
failed_credit_to_pool); and every payment names a recipient of a spendable kind (§3). The
rest of the protocol takes from this chapter the incoming-payment rule (every payment, release,
fire, fill and reward lands through it, so the split policy applies everywhere), the category table
of the transact policy, and the three state objects — liquid payment, schedule/trigger, split
policy — that the per-block steps of 22 settle.
1. What every transaction passes through before its type runs
Purpose. The dispatch steps that decide, for every type, whether the type's own action runs at all, and the ledger context it runs in. Stated here once; the type chapters assume it.
Inputs. The mined transaction, the block height h, the block timestamp (known before the
block's transactions run), the sender's account and group rows, the block's survival flag (19).
Output and effect. In this order:
- The stateless validation of
03/04and the type's own, at height h; a failure makes the block invalid. Envelope rules that matter here: a sender or recipient that is a bare 32-byte key is refused ("accounts are typed: a bare 32-byte key is not an account on this chain",07§3.1), before the signature is checked; a SendZBC must carry a recipient ("Missing recipient address") of 32 bytes or at least 24 ("Invalid recipient address size"), well-formed ("Recipient address: <reason>",07§3.1); every other type whose recipient is non-empty and not the02000000placeholder must name a well-formed address the same way (rulerecipient_address_shape), and a non-empty recipient of a LiquidPayment, ScheduledTransfer or CreateTrigger must be of a spendable kind ("Recipient address type cannot hold spendable funds (transfer would be permanently locked)", §3); a batch's envelope recipient must be empty. The sender, the recipient and the escrow approver must not be a full-key form (rulecanonical_account_forms,07§3.1: an Ethereum or Tron type followed by a 64-byte key, a Bitcoin legacy, P2PKH or P2WPKH type followed by a 33- or 65-byte key):"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)". The envelope bytes cannot carry one (03§3 reads the 20-byte form), but a block received with named fields can, and this refuses it. A foreign carrier (a SendZBC or TransferToken whose signed sender is of type 4, 11, 7 or 5 and whose message parses as a signed Ethereum, Solana or Bitcoin transaction,02§9) must be in its canonical form, bound to this chain and inside its window (ruleforeign_carrier_bound,02§9,03§8); one that is not makes the block invalid. - Rule
group_spend_invalid_block: a sender that is a group member the controller has not permitted makes the block invalid ("Account group: <reason>",18). - Ethereum carrier nonce (rule
foreign_carrier_bound): for an Ethereum carrier, the nonce inside the signed Ethereum transaction must equal the sender address'snonce(07§3) as it stands when the transaction runs; otherwise the block is 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: there is no early-exit settlement and no fee. The mempool and block assembly refuse such a carrier first (04), and since a block carries one transaction per account, nothing earlier in the same block moves the sender's nonce. - For every type but Empty: the sender address's nonce grows by 1 on its own row (
07§3), before anything else is decided. - A type not active at h makes the block invalid; the validation of step 1 refuses it first, with
"Transaction type N is not active until height H (rule R)". - Survival freeze (rule
survival_mode): a transaction of the governance category — FeeVoteCommitment 7, FeeVoteReveal 263, RegisterRelease 32, ReleaseAuthorityPropose 33, ReleaseAuthorityAccept 34, RevokeRelease 35, SetConsensusParam 51 — or of the bridge category, AttestEvent 17, is refused while the survival flag of the block it lands in is true, with one text,"SurvivalMode: transaction type N is not accepted while fewer than survival_min_producers distinct producers made the last 120 blocks (survival mode: governance and bridge are frozen until N produce again)"(N here is the letter N, not the parameter's value; "producers" means distinct blocksmiths). The check is part of the stateless validation of step 1, judged at h: a block that carries such a transaction is invalid with that text; admission refuses it with the same text for the block it would land in (tip + 1), and a producer leaves an admitted one in the pool while the flag is true. A flag that cannot be read →"SurvivalMode: the survival state could not be read: <reason>", which fails the block on that node. The execution repeats the check at h after the validation has passed, so it never refuses anything the validation did not. - A linked member acts as its group: the group's address replaces the sender for everything below
(except the four group-management types,
18); a member with a spending limit runs inside an undoable step and the block is invalid when its outflow exceeds what is left of its window ("Account group: the member's spending limit would be exceeded by what the transaction took"). - Carrier replay guard (SendZBC and TransferToken with a non-empty message, judged on the
transaction as signed: a member's carrier is judged under the member's own typed address,
not the group's). When the signed transaction is a foreign carrier, its native id is: for an
Ethereum carrier the Keccak-256 of its canonical signed encoding (32 bytes, the Ethereum
transaction hash); for a Solana carrier its signature (64 bytes); for a Bitcoin carrier its txid
(32 bytes). Block validation (
19) has already refused the block (ForeignCarrierReplayed) when that id is inspent_foreign_messageor when two carriers of the block share one id; the mempool, the staging pool and block assembly refuse such a carrier first (04). Here the id is inserted intospent_foreign_messageat h (07§6); an id that cannot be computed makes the block invalid ("Foreign carrier id could not be computed"). - Transact-policy bounce: when the type's category is refused by the sender's or the
envelope recipient's mask (§11), the fee is taken when the sender can pay (a storage failure
fails the block) and the type does not run; the early-exit settlement of
04§5 follows. - The sender's balance before the action is noted; a type other than Empty in a block below the
height of rule
min_user_tx_heightmakes the block invalid ("user transactions are not accepted below height H"; the rule's height is 0 on every chain). - The ledger context is set to this transaction's id and timestamp (the split rows of §10 cite it); the type's action runs; a storage fault during it fails the block on that node.
- After the action: the group types settle their own survival; every other type gets the fee
settlement of
04§5 — which believes the action's own report of whether the declared fee was debited (rulefee_collected_explicit), never the balance delta, so a type that credits its sender inside the same action still pays its fee — and then the header survival of13.
How to compute it. As listed.
Rule activation. group_spend_invalid_block, recipient_address_shape, typed_accounts_only,
canonical_account_forms, min_user_tx_height, foreign_carrier_bound, survival_mode and
fee_collected_explicit are active from height 0 on every chain. Type gates per 03 §2.
Rejections and errors. As listed; "block invalid" means every node refuses the block.
Vector. computed. INPUT: a SendZBC whose sender field is the 32 bytes 11 × 32 (a bare key)
→ EXPECTED refusal at admission and in a block: accounts are typed: a bare 32-byte key is not an account on this chain. INPUT: a SendZBC, correctly signed by its sender, received in a block by
named fields with the recipient 04000000 ‖ 64-byte key (68 bytes, an Ethereum full-key form) →
EXPECTED the block is invalid: 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); the same payment to 04000000 ‖ the 20-byte Keccak address of that key
(24 bytes) → runs. INPUT: a
SetConsensusParam in block 5,000 of a chain whose survival flag at 5,000 is true → EXPECTED block
invalid: SurvivalMode: transaction type 51 is not accepted while fewer than survival_min_producers distinct producers made the last 120 blocks (survival mode: governance and bridge are frozen until N produce again); the same text at admission with the flag of tip + 1 true. INPUT: an ETH-typed
sender's SendZBC whose message is a signed Ethereum transaction with nonce 3 while the sender's
nonce is 2 → EXPECTED the block that carries it is invalid: ForeignCarrierNonce: carrier nonce 3, account nonce 2 (a block carrying it is invalid) (no fee, no row, the nonce stays 2, the id is not
spent); the same with nonce 2 → the payment runs and the nonce becomes 3. INPUT: a block carrying two SendZBC carriers whose messages canonicalise to one Ethereum
transaction hash → EXPECTED block invalid ForeignCarrierReplayed; one carrier whose hash is
already in spent_foreign_message → the same.
Test cases · §1
11 cases · 3 valid · 8 invalid · 2 reference
A SendZBC whose sender is a bare 32-byte key is refused
Loading the test widget…
A SendZBC whose recipient is an Ethereum full-key form (68 bytes) is refused
Loading the test widget…
The same payment to the 20-byte Keccak address of that key runs
Loading the test widget…
A sender in a Bitcoin full-key form (37 bytes) is refused
Loading the test widget…
A SetConsensusParam in a survival-mode block makes the block invalid
Loading the test widget…
An AttestEvent in a survival-mode block makes the block invalid (the bridge category)
Loading the test widget…
A SendZBC in a survival-mode block is accepted
Loading the test widget…
An Ethereum carrier with nonce 3 from an account at nonce 2 makes its block invalid
Loading the test widget…
The same carrier with nonce 2 runs
Loading the test widget…
Two carriers of one block whose messages canonicalise to one Ethereum transaction hash make it invalid
A stated value: there is nothing to compute. The statement is a refusal: the exact text a compatible node answers.
- refusal
ForeignCarrierReplayed
A carrier whose hash is already in spent_foreign_message makes its block invalid
A stated value: there is nothing to compute. The statement is a refusal: the exact text a compatible node answers.
- refusal
ForeignCarrierReplayed
Defects to match. The executor keeps a paid-no-op branch for a carrier whose id is already spent; in a validated block it is unreachable (step 8), so an implementation that refuses the block is exact.
2. Empty (0)
Purpose. A message-only transaction.
Output and effect. The fee is taken from the sender (one row of event 1); nothing else changes. The nonce is not incremented (§1 step 4). Category None: never bounced by a transact policy.
How to compute it. Take the fee when the sender can pay it; a sender that cannot is not
charged and the rows 22 + 47 of 04 §5 follow (rule state_answer_noop).
Rule activation. state_answer_noop: active from height 0 on every chain.
Rejections and errors. Only the envelope and fee rules.
Vector. computed: INPUT an Empty with an empty body, fee 5,000,000 above a floor of
2,500,000, sender balance 10,000,000 → EXPECTED sender balance 7,500,000 after the settlement
(rows −5,000,000 event 1 and +2,500,000 event 22), nonce unchanged. INPUT the same with sender
balance 1,000 → EXPECTED mined, nothing taken, rows 22 and 47 per 04 §5.
Test cases · §2
3 cases · 3 valid
An Empty transaction pays its fee and gets the overpay back
Loading the test widget…
An Empty transaction whose sender cannot pay is mined and nothing is taken
Loading the test widget…
An Empty transaction with an empty body passes the stateless checks
Loading the test widget…
Defects to match. None.
3. SendZBC (1)
Purpose. Transfer ZBC to a recipient, optionally with a message or a foreign-signed carrier.
Inputs. Body:
| Offset | Length | Field | Encoding |
|---|---|---|---|
| 0 | 8 | amount |
i64 LE, 0 … the chain's total supply (0 = message-only payment) |
| 8 | … | ignored | any trailing bytes are hashed and charged (04 §2) but not read |
Envelope recipient: required and of a spendable kind; message classes of 03 §8; the escrow part
makes it an escrow (12). The total supply is the total_supply row of chain_metadata (07 §8; 3,333,333,333,333,333 on both chains, the builder's default), the emission ceiling the whole
chain can ever hold, so no single payment can name more.
Output and effect. Sender: balance and spendable_balance −(amount + fee); recipient:
+amount as an incoming payment (07 §3; §10 applies); ledger rows event 1: sender −(amount +
fee), recipient +amount, both with this transaction's id and timestamp. Then the settlement of
04 §5.
The one list of spendable kinds (used by every chapter): a recipient is spendable when it
is at least 4 bytes, not a bare key, and its type is one that can sign (07 §3.1: 0 ZBC, 1 BTC,
4 ETH, 5 P2PKH, 6 P2SH, 7 P2WPKH, 9 P2TR (rule taproot_recipients), 11 Solana, 12 Polkadot, 13
Cardano, 14 Ripple, 15 Tron, 16 Tezos) or type 10 (a ZBS_ deposit address, which receives ZBC
to finance a dataset or a file, 10, 11). Not spendable: anything shorter than 4 bytes (so an
empty recipient), type 2 Empty, 3 Estonia eID, 8 P2WSH, any unknown type, a bare 32-byte key, and a
full-key form (rule canonical_account_forms, 07 §3.1: type 4 or 15 followed by a 64-byte key,
type 1, 5 or 7 followed by a 33- or 65-byte key; no transaction can be sent from it). The sites that
name an account refuse a full-key form with their own text before this test (§1 step 1, the batch
and split-policy steps below).
The list guards SendZBC, every SendZBCBatch payment, LiquidPayment, ScheduledTransfer,
CreateTrigger, ReassignSchedule's new recipient and every split-policy entry. Tokens use the same
list without type 10 (a ZBS_ address cannot hold tokens, 14).
How to compute it.
- Stateless, in this order: body ≥ 8 bytes (
"Invalid SendZBC transaction body");amount ≥ 0("Transaction amount cannot be negative");amount ≤ total supply("SendZBC amount above total supply", ruleescrow_commission_nonnegative);fee ≥ 0("Transaction fee cannot be negative");amount + feemust not overflow ("Transaction amount overflow"); the recipient must be spendable ("Recipient address type cannot hold spendable funds (transfer would be permanently locked)"). Self-send is allowed. - Execution:
amount + feecomputed checked; the sender row must exist ("Sender account not found", block invalid); the sender's confirmedbalance ≥ amount + fee("Insufficient balance", block invalid); debit; credit the recipient as an incoming payment from the sender (a payment into the deposit address of a stored file or a live dataset is booked as the sender's deposit,07§3); two rows.
Rule activation. taproot_recipients, escrow_commission_nonnegative: active from height 0
on every chain.
Rejections and errors. Step 1 at admission and in block validation (block invalid); step 2's
balance failure: block invalid (the blocksmith's gates of 04 §10 keep it out of honest blocks).
Vector. computed. INPUT: sender 00000000‖K1 with balance 5,000,000,000, recipient
00000000‖K2, body 00CA9A3B00000000 (1,000,000,000 = 10 ZBC), fee 5,000,000, floor 2,500,000 →
EXPECTED sender 3,997,500,000 after the refund (rows −1,005,000,000 event 1, +2,500,000 event 22),
recipient +1,000,000,000 (row event 1). INPUT the same with recipient 08000000 ‖ 32 × AA (P2WSH)
→ EXPECTED refused: Recipient address type cannot hold spendable funds (transfer would be permanently locked). INPUT recipient 0A000000 ‖ 32 bytes → accepted (a ZBS_ address). INPUT
body 00CA9A3B000000 (7 bytes) → Invalid SendZBC transaction body. INPUT body
FFFFFFFFFFFFFFFF (−1) → Transaction amount cannot be negative. INPUT body
56554025A6D70B00 (3,333,333,333,333,334, one unit above the ceiling) → SendZBC amount above total supply; 55554025A6D70B00 (exactly 3,333,333,333,333,333) passes this check.
Test cases · §3
9 cases · 4 valid · 5 invalid
A SendZBC of 10 ZBC passes the stateless checks
Loading the test widget…
A SendZBC of 10 ZBC: the sender's balance after the settlement
Loading the test widget…
A SendZBC to a P2WSH address is refused
Loading the test widget…
A SendZBC to a ZBS_ deposit address is accepted
Loading the test widget…
A 7-byte SendZBC body is refused
Loading the test widget…
A negative SendZBC amount is refused
Loading the test widget…
A SendZBC of one unit above the total supply is refused
Loading the test widget…
A SendZBC of exactly the total supply passes that check
Loading the test widget…
A SendZBC without a recipient is refused
Loading the test widget…
Defects to match. None.
3.1 SendZBCBatch (257)
Purpose. Several ZBC payments from one sender in one transaction, all or nothing.
Inputs. Envelope recipient: empty (the recipients are in the body). Body, little-endian:
| Offset | Length | Field | Encoding |
|---|---|---|---|
| 0 | 2 | count |
u16, 1 … 25 |
| 2 | then count × |
addr_len (u8) ‖ addr (addr_len bytes, ≥ 24: a typed address) ‖ amount (i64 LE, > 0) |
one payment |
The body must end exactly after the last payment. A recipient may repeat.
Output and effect. Sender (the group for a member): −(Σ amount + fee) as one row of event 1;
each recipient, in body order: +amount as an incoming payment (its split policy applies, §10; a
payment into the deposit address of a stored file or a live dataset is the sender's deposit, 10),
one row of event 1 each with this transaction's id. The settlement of 04 §5 follows.
How to compute it.
- Stateless: envelope recipient empty (
"SendZBCBatchTransaction: a batch names its recipients in its body; the envelope recipient must be empty"); the body parses ("SendZBCBatch: body too short for the action count","SendZBCBatch: a batch carries at least one action","SendZBCBatch: more than 25 actions","SendZBCBatch: the body is shorter than its action count"whencount × 33exceeds the bytes left,"SendZBCBatch: truncated recipient","SendZBCBatch: truncated or too short recipient","SendZBCBatch: truncated amount","SendZBCBatch: trailing bytes after the last payment"); then for each payment i in order: amount > 0 ("SendZBCBatchTransaction: payment i: the amount must be positive"), recipient well-formed ("SendZBCBatchTransaction: payment i: recipient address: <reason>"), not a full-key form ("SendZBCBatchTransaction: payment i: 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)") and spendable ("SendZBCBatchTransaction: payment i: recipient address type cannot hold spendable funds (transfer would be permanently locked)");fee + Σ amountmust not overflow ("SendZBCBatchTransaction: amount overflow"). - The floor is the sum of the one-payment floors (
04§2.1); the block's transaction-count ceiling counts every payment (05§10). - State, checked for every payment before any applies (at admission a refusal, in a block a
paid no-op of the whole batch): no recipient's transact policy refuses Payments
(
"Refused by transact policy: SendZBCBatchTransaction: payment i: the recipient's transact policy refuses Payments transactions (SetTransactPolicy bit 0, mask 1)"). The sender's own policy bounces the whole batch as for SendZBC (category Payments, §11). - Execution: the sender's confirmed balance must cover
Σ amount + fee, else block invalid; debit once; credit each payment.
Rule activation. The type every chain has from genesis; the full-key test (rule
canonical_account_forms) is active from height 0 on every chain.
Rejections and errors. As listed.
Vector. computed. INPUT: two payments, 1 ZBC to 00000000‖K1 and 2 ZBC to 00000000‖K2
with K1 = bytes 01…20 and K2 = bytes 21…40, body (92 bytes)
0200 24 00000000 0102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F20 00E1F50500000000 24 00000000 2122232425262728292A2B2C2D2E2F303132333435363738393A3B3C3D3E3F40 00C2EB0B00000000
→ EXPECTED sender −(300,000,000 + fee) in one event-1 row, K1 +100,000,000, K2 +200,000,000.
INVALID: the same body with one extra byte 00 at the end → SendZBCBatch: trailing bytes after the last payment; count 0000 → SendZBCBatch: a batch carries at least one action; a
non-empty envelope recipient → SendZBCBatchTransaction: a batch names its recipients in its body; the envelope recipient must be empty; the second payment's recipient written as 25 05000000 02 ‖ 32 × 77 (length 37: type 5 P2PKH followed by a 33-byte compressed key, a full-key form) →
SendZBCBatchTransaction: payment 1: 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) (payments count from 0).
Test cases · §3.1
7 cases · 2 valid · 5 invalid
A SendZBCBatch body of two payments
Loading the test widget…
The two-payment batch passes the stateless checks
Loading the test widget…
A batch with one byte after the last payment is refused
Loading the test widget…
A batch whose count is 0 is refused
Loading the test widget…
A batch with an envelope recipient is refused
Loading the test widget…
A batch whose second payment names a Bitcoin full-key form (37 bytes) is refused
Loading the test widget…
A batch payment of 0 is refused
Loading the test widget…
Defects to match. None known.
4. LiquidPayment (6) and LiquidPaymentStop (262)
Purpose. A payment that vests linearly over time and can be stopped by either party.
Inputs. LiquidPayment body:
| Offset | Length | Field | Encoding |
|---|---|---|---|
| 0 | 8 | amount |
i64 LE, > 0 |
| 8 | 8 | complete_minutes |
u64 LE, ≠ 0 |
| 16 | 8 | token_id |
i64 LE, optional (absent or 0 = ZBC) |
Stop body: transaction_id (8, i64 LE) = the liquid payment's transaction id. Envelope recipient:
required (see Rejections).
Output and effect. On creation a row liquid_payment_transaction(id = tx id, sender, recipient, amount, applied_time, complete_minutes, status 0 pending, token_id) with
applied_time = the timestamp of the block that carries the transaction (rule
liquid_chain_clock; never the transaction's own timestamp, which the sender chooses inside the
admission window). ZBC: sender −(amount + fee) at once (row event 13 for −(amount + fee), the
transaction's timestamp); the amount is held by the record. Token: the token units leave the
sender; the fee is paid in the token when the token is ZBC-backed (14's fee-in-token rule: the
floor is released from the backing to the pool and the overpay stays in the token, rows 22 + 46),
else in ZBC.
Settlement, two ways:
- Completion (a per-block step that runs before the block's transactions,
22): every pending row (status0,latest1) withapplied_time + complete_minutes × 60 ≤ clock, in storage order (no ordering is applied; the payments are independent, so only the order of the ledger rows depends on it; I think it is the order the rows were written), whereclockis the previous block's timestamp (ruleexpiry_previous_stamp); it pays the wholeamountto the recipient as an incoming payment (§10) and 0 to the sender; the recipient's row is event 14 withtransaction_id= the payment id and the block's timestamp. The row becomes status 1 (completed) at this height. A due list that cannot be read is a fault that fails the block's apply on that node; only a genuinely empty list skips the step. - Stop (a LiquidPaymentStop by the payment's sender or recipient, compared as the same account,
07§3):elapsed = block.timestamp − applied_time(the stopping block's timestamp, ruleliquid_chain_clock):recipient = amountwhenelapsed ≥ complete_minutes × 60, elseceil(amount × elapsed / (complete_minutes × 60))in 128-bit integer arithmetic, capped atamount(ruleliquid_exact_vesting);sender = amount − recipient. The stopper's fee is taken by a plain debit (row event 15, −fee, the stop's timestamp); the recipient gets its part as an incoming payment (row event 14,transaction_id= payment id, timestamp = the block's); the sender gets the rest by a plain credit (row event 14, the same id and timestamp); the row becomes completed at this height. Token streams move units, not ZBC, and write no ZBC rows except the stopper's fee.
How to compute it.
- Stateless: body ≥ 16 (
"LiquidPayment: invalid body: <reason>"),amount > 0("LiquidPayment: amount must be positive"),complete_minutes ≠ 0("LiquidPayment: complete_minutes must be positive"). Stop: body ≥ 8 ("LiquidPaymentStop: invalid body"). - Admission only: a token stream's token must exist at the target height (
"LiquidPayment: unknown or expired token N"); a stop's payment must be pending ("LiquidPaymentStop: liquid payment not found or not pending: N"), the stopper a party ("LiquidPaymentStop: only the sender or recipient can stop this payment"), and the stop's owntimestampnot before the payment'sapplied_time("LiquidPaymentStop: the stop is dated <T>, before the payment started (<applied_time>); a stop's timestamp is its vesting clock and may not precede the payment"— the text is kept as clients see it; the chain's clock, not the stop's, decides the split). - Execution of the payment: an empty recipient makes the block invalid
(
"ExecuteLiquidPayment: recipient address required"; the envelope rules pass an empty recipient, so nothing refuses it earlier); ZBC:amount + feeoverflow → block invalid; the sender row must exist ("ExecuteLiquidPayment: sender account not found", block invalid); the confirmedbalance ≥ amount + fee, else block invalid ("ExecuteLiquidPayment: insufficient balance"); token: an unknown token is a paid no-op; insufficient token units: the stream is not created and the ZBC fee, when paid in ZBC, is returned (a free no-op). - Execution of the stop: unknown, not pending, or a stopper that is not a party → paid no-op; a
block timestamp before
applied_time→ paid no-op (the stream stays pending); then the vesting split above; a stopper that cannot pay the fee makes the block invalid; a recipient that cannot be credited: its part goes back to the sender.
Rule activation. expiry_previous_stamp, liquid_exact_vesting, liquid_chain_clock,
fee_in_token_step, state_answer_noop, recipient_address_shape, balance_credit_full_row:
active from height 0 on every chain.
Rejections and errors. As listed.
Vector. computed. INPUT: a LiquidPayment of 0.1 ZBC over 3 minutes, body
8096980000000000 0300000000000000 (amount 10,000,000, complete_minutes 3), transaction
timestamp 1,793,599,990, mined in a block with timestamp 1,793,600,000 → EXPECTED a row (amount
10,000,000, applied_time 1,793,600,000, complete_minutes 3, status 0) and the sender's row
event 13 of −(10,000,000 + fee) stamped 1,793,599,990. A stop by the recipient, body = the payment
id as i64 LE (for id −3,909,169,050,934,266,947: BDB31CB875D7BFC9), mined in a block with
timestamp 1,793,600,066 → recipient ceil(10,000,000 × 66 / 180) = 3,666,667, sender 6,333,333,
status 1 (the stop's own timestamp plays no part). A stop in a block stamped 1,793,600,180 or
later → recipient 10,000,000. 100,000,000 over 10 minutes stopped in a block 66 s after the start →
11,000,000 exactly. With no stop, the first block whose previous block's timestamp is ≥
1,793,600,180 pays the recipient 10,000,000 (row event 14). INVALID: body
0000000000000000 0300000000000000 → LiquidPayment: amount must be positive; a stop dated
1,793,599,999 → at admission LiquidPaymentStop: the stop is dated 1793599999, before the payment started (1793600000); a stop's timestamp is its vesting clock and may not precede the payment; a
stop mined in a block stamped 1,793,599,999 (possible only through a reorganisation that re-dates
the creating block) → a paid no-op.
Test cases · §4
11 cases · 9 valid · 2 invalid · 3 reference
A LiquidPayment of 0.1 ZBC over 3 minutes and the stop body of its id
Loading the test widget…
The LiquidPayment passes the stateless checks
Loading the test widget…
A stop 66 s into a 180 s stream pays the recipient ceil(10,000,000 × 66 / 180)
Loading the test widget…
A stop at the end of the stream pays the recipient everything
Loading the test widget…
A stop after the end pays the recipient everything
Loading the test widget…
1 ZBC over 10 minutes stopped 66 s in pays exactly 11,000,000
Loading the test widget…
The LiquidPayment's row and its sender's ledger row
Signed at 1,793,599,990 and mined in a block stamped 1,793,600,000: the stream starts at the block's timestamp.
A stated value: there is nothing to compute. A compatible node shows the same value.
- amount
10000000- applied_time
1793600000- complete_minutes
3- status
0- sender_row
event 13, -(10000000 + fee), timestamp 1793599990
Without a stop, the first block whose previous block is at or past the end pays the recipient
A stated value: there is nothing to compute. A compatible node shows the same value.
- value
recipient +10,000,000 (row event 14) in the first block whose previous block's timestamp is ≥ 1,793,600,180
A LiquidPayment of amount 0 is refused
Loading the test widget…
A stop dated before the payment started is refused at admission
Loading the test widget…
A stop mined in a block stamped before the payment started is a paid no-op
Possible only through a reorganisation that re-dates the creating block.
A stated value: there is nothing to compute. A compatible node shows the same value.
- value
a paid no-op
Defects to match. (1) The completion step computes the share with a double-precision formula
rate = (elapsed / 60.0) / complete_minutes, rate > 1.0 → all, else ceil(rate × amount); it
only ever runs with elapsed ≥ total, so it always pays the whole amount, and an implementation
must not apply it to any other case. (2) The stop's fee is a hard debit: a party that cannot cover
it fails the block. (3) The status has only 0 and 1; a stopped stream is completed. (4) The
admission refusal of a stop dated before applied_time compares the stop's own timestamp, which
the chain never reads afterwards; its text still says the timestamp is the vesting clock.
5. CreateTrigger (15) and CancelTrigger (16)
Purpose. Lock an amount now, release it to a recipient at a block height or on an oracle event; or take it back.
Inputs. CreateTrigger body:
| Offset | Length | Field | Encoding |
|---|---|---|---|
| 0 | 8 | fire_height |
u64 LE read as i64; must exceed the block height for a height trigger |
| 8 | 8 | amount |
i64 LE, > 0 |
| 16 | 4 | event_id_len |
u32 LE, optional |
| 20 | n | event_id |
UTF-8; non-empty = fires when the oracle resolves this event (17), not by height |
Envelope recipient: required. CancelTrigger body: trigger_id (8, i64 LE).
Output and effect. Creation: sender −(amount + fee) (rows: −fee event 1, −amount event 61); a
trigger_schedule row with trigger_id = the little-endian i64 of the first 8 bytes of the
transaction hash, 0 → 1 (this equals the transaction id of 03 §9 except for that 0 case), owner
= sender (the group for a member), recipient, amount, fire_height, event_id, status 0, kind
0. Firing (a per-block step): every row with kind 0, status 0, empty event_id and
fire_height ≤ h, in ascending trigger_id order (a height test), credits the recipient
amount as an incoming payment from the owner (row event 23, transaction_id = trigger id, block
timestamp) and becomes status 1 at h; a credit the rules refuse for a deterministic reason (a
balance overflow, a recipient the typed-address check refuses) sends amount to the longevity pool
instead (rule failed_credit_to_pool: row event 50 on the pool, transaction_id = trigger id,
block timestamp), and the trigger still becomes status 1; a storage fault fails the block. A list
of due triggers that cannot be read fails the block's apply on that node. Cancel: the owner gets
amount back (row event 62) and the row becomes status 2.
How to compute it.
- Stateless: body ≥ 16 (
"CreateTrigger body too short (need fire_height + amount)"),amount > 0("Trigger amount must be positive"). Cancel: body ≥ 8. - Admission only: a recipient must be present (
"Missing trigger action recipient"); a height trigger'sfire_heightmust exceed the height it is judged for (tip + 1 at admission; the target height at assembly). Cancel: the trigger must exist, bekind0 ("CancelTrigger: N is a scheduled transfer or vesting; use CancelSchedule"), be pending ("Trigger is not pending: N") and belong to the sender. - Execution of CreateTrigger: body < 16 → block invalid (
"Invalid CreateTrigger body");amount ≤ 0→ block invalid; a height trigger withfire_height ≤ h→ block invalid ("Trigger fire height must be in the future"); an empty recipient → paid no-op;fee < 0→ block invalid;amount + feeoverflow → block invalid ("Trigger amount + fee overflow"); confirmedbalance < amount + fee→ block invalid. - Execution of CancelTrigger: unknown id → block invalid (
"Unknown trigger", unreachable for an admitted one); the fee is taken (a sender that cannot pay → block invalid); then, in this order, a paid no-op when the trigger is not pending, when the sender is not the owner (byte comparison of the owner field), or when the row is a schedule (kind≠ 0); otherwise refund and status 2.
Rule activation. failed_credit_to_pool: active from height 0 on every chain.
Rejections and errors. As listed.
Vector. computed. INPUT: CreateTrigger body D09C010000000000 40420F0000000000
(fire_height 105,680, amount 1,000,000, no event id) in block 105,000 with transaction hash
beginning 0100000000000000… → EXPECTED a row trigger_id 1, owner = sender, fire_height
105,680, status 0, rows −fee (event 1) and −1,000,000 (event 61); at block 105,680 the recipient
+1,000,000 (event 23) and status 1. A hash beginning 0000000000000000 also gives trigger_id 1.
INPUT the same trigger whose recipient holds 9,223,372,036,854,775,807 at block 105,680 (the
credit overflows) → EXPECTED the longevity pool +1,000,000 (event 50, transaction_id 1), status
1, the recipient unchanged. INVALID: body D09C010000000000 (8 bytes) → CreateTrigger body too short (need fire_height + amount); the same 16-byte body in block 105,680 → block invalid,
Trigger fire height must be in the future.
Test cases · §5
8 cases · 6 valid · 2 invalid · 4 reference
A height trigger body passes the stateless checks
Loading the test widget…
The trigger id of a hash beginning 01 00 … 00
Loading the test widget…
A hash beginning with eight zero bytes also gives trigger id 1
Loading the test widget…
The trigger created in block 105,000
A stated value: there is nothing to compute. A compatible node shows the same value.
- trigger_id
1- fire_height
105680- status
0- rows
-fee (event 1), -1,000,000 (event 61)
The trigger fires at its height
A stated value: there is nothing to compute. A compatible node shows the same value.
- value
at block 105,680 the recipient +1,000,000 (event 23) and status 1
A fire whose credit would overflow the recipient pays the longevity pool
The recipient holds 9,223,372,036,854,775,807 at block 105,680.
A stated value: there is nothing to compute. A compatible node shows the same value.
- value
the longevity pool +1,000,000 (event 50, transaction_id 1), status 1, the recipient unchanged
An 8-byte CreateTrigger body is refused
Loading the test widget…
A trigger whose fire height is not above the block height makes the block invalid
A stated value: there is nothing to compute. The statement is a refusal: the exact text a compatible node answers.
- refusal
Trigger fire height must be in the future
Defects to match. (1) The owner check of CancelTrigger compares raw bytes, not the same
account, so a member cannot cancel a trigger its group owns through another address. (2) A
trigger_id of exactly 0 becomes 1, unlike the transaction id.
6. ScheduledTransfer (29)
Purpose. A recurring or vested transfer, pre-locked or pulled at each fire.
Inputs. Body, 47 bytes, little-endian:
| Offset | Length | Field | Encoding |
|---|---|---|---|
| 0 | 8 | token_id |
i64, ≥ 0 (0 = ZBC) |
| 8 | 8 | per_fire_amount |
i64, > 0 |
| 16 | 8 | interval_seconds |
i64, 0…3,153,600,000; > 0 when remaining_fires > 1 |
| 24 | 4 | remaining_fires |
i32, 1…520 |
| 28 | 8 | cliff_seconds |
i64, 0…3,153,600,000 |
| 36 | 1 | funding_mode |
0 pre-locked (vesting), 1 pull-at-fire |
| 37 | 1 | cancel_policy |
0 revocable by the owner, 1 irrevocable |
| 38 | 8 | end_time |
i64 Unix seconds, 0 = none, ≤ 3,153,600,000 |
| 46 | 1 | reserved |
must be 0 |
Longer bodies are accepted (only 47 bytes are read). Envelope recipient: required.
Output and effect. A trigger_schedule row with trigger_id = the transaction id, owner =
sender (the group for a member), recipient, the body fields, fire_time = block.timestamp + cliff_seconds, locked_remaining = per_fire × fires (mode 0) or 0, kind 2 (mode 0) or 1 (mode
1), status 0, consecutive_skips 0, and — for a pull schedule created by a group member (rule
schedule_fire_member_gate) — creator_address = the member. Mode 0 ZBC: sender −(total + fee)
(rows −fee event 1, −total event 63). Mode 0 token: fee in ZBC (event 1), token units locked. Mode
1: fee only.
Firing (a per-block step: every row with status 0 and 0 < fire_time ≤ clock, where clock is
the previous block's timestamp; the credit, re-arm and ledger rows use the block's own
timestamp; in ascending trigger_id order; a list that cannot be read fails the block's apply on
that node):
- Mode 0:
tranche = locked_remainingon the last fire (remaining_fires ≤ 1), elseper_fire_amount; the recipient is credited as an incoming payment from the owner (ZBC, row event 28 forkind2 or 29 forkind1,transaction_id= schedule id, block timestamp) or a token credit (no ZBC row); on successlocked_remaining −= tranche; on failure nothing is paid but the fire still counts. A ZBC tranche into the deposit address of a stored file or a live dataset is booked as the owner's deposit (10). Thenremaining_fires −= 1;next = fire_time + interval_seconds; the schedule is done (status 1) whenremaining_fires ≤ 0, when the addition overflows, or whenend_time > 0andnext > end_time; a done schedule withlocked_remaining > 0returns it to the owner by a plain credit (ruleschedule_end_refund, ZBC row event 34), and when that credit is refused for a deterministic reason the remainder goes to the longevity pool instead (rulefailed_credit_to_pool: ZBC as a row event 50 on the pool,transaction_id= schedule id; token units to the pool's token balance, no row), the lock becoming 0 either way; otherwisefire_time = next. A new version row at h either way. - Mode 1: the member gate of
18may block the fire (creator_addressset); otherwise the fire is paid when the owner's confirmed ZBC balance (or token balance) ≥per_fire_amountand the transfer succeeds: ZBC by a plain debit and credit (no split policy on the recipient; a credit into a deposit address is booked as the owner's deposit), rows event 29 on both sides; token by debit and credit of units. Paid: skips reset to 0,remaining_fires −= 1, a limited member's window is charged. Not paid: a row event 30 with change 0 on the owner,consecutive_skips += 1, and at 4 the schedule is cancelled (status 2). Re-arm as in mode 0, without any refund (nothing is locked).
How to compute it.
- Stateless: parse (
"Invalid ScheduledTransfer body"when shorter than 47) and the ranges above ("per_fire_amount must be positive","remaining_fires out of range","interval required for recurring","negative time","time field exceeds SCHEDULE_MAX_SECONDS","bad funding_mode","bad cancel_policy","bad token_id","reserved byte must be 0","per*count overflow"). - Admission only: a recipient must be present (
"ScheduledTransfer: missing recipient");end_time, when set, must not precedenow + cliff_seconds(now = the target block timestamp at assembly, the node's clock at admission). - Execution: the stateless check again; an empty recipient → block invalid (
"Missing recipient"); mode 0 ZBC: confirmedbalance < total + fee→ block invalid; mode 0 token: insufficient units → the fee is kept and no schedule is created (paid no-op);fire_timeoverflow → block invalid.
Rule activation. expiry_previous_stamp, schedule_end_refund, schedule_fire_member_gate,
balance_credit_full_row, failed_credit_to_pool: active from height 0 on every chain.
Rejections and errors. As listed.
Vector. computed from the TestNet genesis file (06 §9, 07 §6): its first vesting
entry is the faucet schedule, trigger_id 9,216,412,776,157,539,296, kind 2 in pull mode
(funding_mode 1), owner = the treasury ZBC_CIHOJSU5_…_5ADSND7R, recipient = the faucet
ZBC_ELBIB5B3_…_7A7XAJUC, per_fire_amount 160,000,000,000, interval_seconds 86,400,
remaining_fires 600, cancel_policy 1, fire_time = the genesis timestamp 1,793,509,027
(cliff 0). EXPECTED: the schedule fires in block 1 (the previous block, the genesis block, is
stamped 1,793,509,027 ≥ fire_time), with two rows of event 29 stamped with block 1's timestamp,
treasury −160,000,000,000 and faucet +160,000,000,000, transaction_id = the schedule id; after
it remaining_fires 599 and fire_time 1,793,595,427 = 1,793,509,027 + 86,400; the n-th fire
lands in the first block whose previous block is stamped ≥ 1,793,509,027 + (n − 1) × 86,400.
computed. INPUT: a mode-0 ZBC schedule, body (47 bytes)
0000000000000000 00E40B5402000000 100E000000000000 03000000 3C00000000000000 00 00 0000000000000000 00
(100 ZBC × 3 fires, interval 3,600, cliff 60) in a block with timestamp T → EXPECTED a row
locked_remaining 30,000,000,000, fire_time T + 60, kind 2, rows −fee (event 1) and
−30,000,000,000 (event 63); fires at the first blocks whose previous block's timestamp reaches T +
60, T + 3,660, T + 7,260, the third paying locked_remaining (10,000,000,000 when nothing failed).
INPUT the same schedule with end_time T + 4,000 and an owner whose credit is refused at the end
(the owner's row overflowed): after the second fire next = T + 7,260 > end_time → status 1 and
the remaining 10,000,000,000 to the longevity pool (event 50, transaction_id = the schedule id).
INVALID: the same body with remaining_fires 09020000 (521) → remaining_fires out of range;
with the last byte 01 → reserved byte must be 0.
Test cases · §6
8 cases · 5 valid · 3 invalid · 2 reference
The TestNet genesis faucet schedule (its first vesting entry)
Loading the test widget…
The TestNet genesis faucet schedule and its fire in block 1
The genesis file lists 600 fires; the n-th fire lands in the first block whose previous block is stamped at or after 1,793,509,027 + (n - 1) x 86,400.
A stated value: there is nothing to compute. A compatible node shows the same value.
- trigger_id
9216412776157539296- kind
2- funding_mode
1- per_fire_amount
160000000000- interval_seconds
86400- cancel_policy
1- fire_time
1793509027- fires_in_block
1- rows
treasury -160000000000 (event 29), faucet +160000000000 (event 29)- remaining_fires_after
599- fire_time_after
1793595427
A pre-locked schedule of 100 ZBC × 3 fires, interval 3,600, cliff 60
Loading the test widget…
The schedule body passes the stateless checks
Loading the test widget…
A schedule ended by its end_time whose refund to the owner is refused pays the longevity pool
The 100 ZBC x 3 schedule above with end_time T + 4,000: after the second fire, next = T + 7,260 is past end_time.
A stated value: there is nothing to compute. A compatible node shows the same value.
- status
1- value
the remaining 10,000,000,000 to the longevity pool (event 50, transaction_id = the schedule id)
A schedule of 521 fires is refused
Loading the test widget…
A schedule whose reserved byte is 1 is refused
Loading the test widget…
A 46-byte schedule body is refused
Loading the test widget…
Defects to match. (1) Mode-0 and mode-1 fires use different credit paths: a pre-locked tranche
goes through the recipient's split policy, a pull fire does not. (2) A pre-locked tranche whose
credit fails is skipped but still counted, and its units stay in locked_remaining; the last fire
pays the whole locked_remaining, so the missed tranche reaches the recipient with the last fire.
The owner gets it back (the end refund) only when end_time ends the schedule before its last
fire, or when the last credit fails. (3) A genesis vesting row keeps kind 2 even in pull mode (06 §9),
while a transaction's pull schedule is kind 1.
7. CancelSchedule (30)
Purpose. Revoke (owner) or decline (recipient) a pending schedule, returning what is locked.
Inputs. Body: schedule_id (8, i64 LE) = the schedule's trigger_id.
Output and effect. The fee is taken; a pending schedule becomes status 2 with
locked_remaining 0, and a mode-0 lock is returned to the owner (ZBC row event 34; token units
without a row). A finished schedule that still holds a mode-0 lock returns it the same way (rule
schedule_reclaim_locked), keeping its status.
How to compute it.
- Stateless: body ≥ 8 (
"CancelSchedule body too short"). - Admission only: the schedule exists (
"Unknown schedule: N"); pending, or the reclaim case ("Schedule is not pending: N"otherwise); authorised: the owner whencancel_policy= 0, or the recipient, as the same account ("CancelSchedule: not authorized to cancel"). - Execution: unknown → block invalid (unreachable); not authorised → paid no-op; the fee is taken
(unpayable → block invalid); not pending → reclaim when mode 0 and
locked_remaining > 0, else nothing more; pending → refund, status 2.
Rule activation. state_answer_noop, schedule_reclaim_locked: active from height 0 on
every chain.
Rejections and errors. As listed.
Vector. computed. INPUT: a CancelSchedule of the faucet schedule above, body
E0EB3DDA9646E77F (i64 LE of 9,216,412,776,157,539,296), sent by the treasury → EXPECTED refused
at admission CancelSchedule: not authorized to cancel (its cancel_policy is 1, irrevocable);
the same sent by the faucet (the recipient) → status 2, no refund (pull mode locks nothing).
INVALID: body E0EB3DDA9646E7 (7 bytes) → CancelSchedule body too short.
Test cases · §7
5 cases · 3 valid · 2 invalid · 2 reference
The CancelSchedule body of the faucet schedule
Loading the test widget…
The CancelSchedule body passes the stateless checks
Loading the test widget…
The treasury may not cancel the irrevocable faucet schedule
A stated value: there is nothing to compute. The statement is a refusal: the exact text a compatible node answers.
- refusal
CancelSchedule: not authorized to cancel
The faucet (the recipient) may decline the schedule
A pull schedule locks nothing, so nothing is returned.
A stated value: there is nothing to compute. A compatible node shows the same value.
- status
2- refund
0
A 7-byte CancelSchedule body is refused
Loading the test widget…
Defects to match. None beyond §6.
8. ReassignSchedule (31)
Purpose. The current recipient redirects a pending schedule's future fires.
Inputs. Body: schedule_id (8, i64 LE) ‖ new_recipient (4-byte type ‖ the type's
fixed-layout payload of 01 §4.1; the body must end exactly there).
Output and effect. The fee is taken; recipient_address of the row becomes new_recipient (a
version row at h); fired tranches are untouched.
How to compute it. Stateless: body ≥ 12 ("ReassignSchedule body too short"); exact length by
type ("ReassignSchedule: new_recipient length mismatch"); the address must be well-formed
("ReassignSchedule: invalid new_recipient: <reason>") and spendable ("ReassignSchedule: new_recipient address type cannot hold spendable funds"). Admission only: exists, pending, the
sender is the recipient ("ReassignSchedule: only the recipient can reassign"). Execution: not the
recipient → paid no-op (rule reassign_schedule_moved); the fee is taken; not pending → no-op with
the fee kept; else the redirect.
Rule activation. reassign_schedule_moved: active from height 0 on every chain.
Rejections and errors. As listed; the stateless checks make a block invalid.
Vector. computed. INPUT: from the faucet, body (44 bytes)
E0EB3DDA9646E77F 00000000 2122232425262728292A2B2C2D2E2F303132333435363738393A3B3C3D3E3F40 →
EXPECTED the schedule's recipient_address becomes 00000000 2122…3F40. INVALID: the same with
one extra byte → ReassignSchedule: new_recipient length mismatch; with the type 08000000
(P2WSH, 36 bytes) → ReassignSchedule: new_recipient address type cannot hold spendable funds.
Test cases · §8
3 cases · 1 valid · 2 invalid
A ReassignSchedule to a typed ZBC account passes the stateless checks
Loading the test widget…
A ReassignSchedule body with one extra byte is refused
Loading the test widget…
A ReassignSchedule to a P2WSH address is refused
Loading the test widget…
Defects to match. None.
9. SetSplitPolicy (54) and SetTransactPolicy (50): the bodies
Purpose. The two per-account policies.
Inputs. SetSplitPolicy body: count (u8) ‖ count × (addr_len (u8) ‖ address ‖
share_bp (u16 LE)). SetTransactPolicy body: mask (u16 LE), exactly 2 bytes.
Output and effect. SetSplitPolicy: the fee is taken and the sender's account_split_policy
row (keyed by the sender's typed account) becomes the entries, re-encoded exactly as parsed;
count 0 (body 00) clears it. SetTransactPolicy: the fee is taken and the account's
transact_policy becomes mask & 0x1FF (a version row of the account); no row → the fee is kept
and nothing changes. Both take effect for the next transaction in the same block.
How to compute it. SetSplitPolicy, stateless, in this order: a body of 0 bytes →
"SplitPolicy: empty body"; count ≤ 10 ("SplitPolicy: more than 10 recipients"); every entry
complete ("SplitPolicy: truncated entry"); no bytes after the last ("SplitPolicy: trailing bytes"); then per entry: well-formed ("SplitPolicy: a recipient address is malformed"), not a
full-key form ("SplitPolicy: a recipient: 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)", 07 §3.1), spendable ("SplitPolicy: a recipient address type cannot hold spendable funds"), not the sender's own address ("SplitPolicy: the account cannot be its own recipient (leave the share unassigned instead)"), not a repeat ("SplitPolicy: duplicate recipient"), share_bp ≥ 1 ("SplitPolicy: a share must be at least 1 basis point"); finally
Σ share_bp ≤ 10,000 ("SplitPolicy: shares add up to more than 100%"). SetTransactPolicy: the
body length only.
A SetSplitPolicy carried as the inner transaction of a MultiSignature (12) is not judged by block
validation; its execution re-reads the entries, and when one is a full-key form the transaction is a
paid no-op (the fee is taken, nothing is set, the settlement of 04 §5 follows).
Rule activation. Type 54 exists from split_policy (active from height 0 on every chain);
type 50 has no gate; canonical_account_forms is active from height 0 on every chain.
Rejections and errors. As listed; both are stateless, so a failure refuses admission and makes a block invalid (the multisig inner case above excepted).
Vector. computed. INPUT: SetSplitPolicy sending 50 % of every credit to the TestNet release
authority (07 §3), body (40 bytes)
01 24 000000007D8BD8A41DCEEA4986D1E99DFE99CA9303874B7C3AAC7EEECD60A82F61902572 8813 → EXPECTED
policy entries = that body (count 1, addr_len 36, the typed account, share_bp 5,000). Body 00
→ the policy is cleared. SetTransactPolicy body 0500 → transact_policy 5 (Payments and Tokens).
INVALID: the 40-byte body with share_bp 1127 (10,001) → SplitPolicy: shares add up to more than 100%; with share_bp 0000 → SplitPolicy: a share must be at least 1 basis point; the
sender's own address as the entry → SplitPolicy: the account cannot be its own recipient (leave the share unassigned instead); the entry written as 01 44 04000000 ‖ 64 × 5A ‖ 8813 (addr_len
68: an Ethereum full-key form) → SplitPolicy: a recipient: 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).
Test cases · §9
8 cases · 3 valid · 5 invalid
A split policy sending 50 % to the release authority passes
Loading the test widget…
The body 00 clears the split policy
Loading the test widget…
SetTransactPolicy with mask 5 passes
Loading the test widget…
Shares of 10,001 basis points are refused
Loading the test widget…
The sender as its own split recipient is refused
Loading the test widget…
An empty split-policy body is refused
Loading the test widget…
A split entry in an Ethereum full-key form (68 bytes) is refused
Loading the test widget…
Defects to match. None.
10. The split policy's effect on every incoming payment
Purpose. What an account with a split policy does with money that arrives.
Inputs. The policy of the balance holder (a member's credits resolve to its group, and the group's policy applies); the arriving amount and asset; the ledger context of §1.
Output and effect. The incoming payments: SendZBC, every payment of a SendZBCBatch and every
transfer of a TransferTokenBatch, the escrow settlements (12), liquid completion and stop
payouts, trigger fires, pre-locked schedule tranches, token transfers and exchange fills (14,
15), app payouts (16), and the rewards that use it (21). Not incoming payments (plain
credits): refunds of the account's own money (escrow returns, cancelled holds, fee overpay, rent
returns, the end refund of a schedule), pull-mode schedule fires, the sender-side refund of a
liquid payment, a bridge mint (34 §4), and every credit to the longevity pool.
How to compute it. With amount > 0 and a non-empty policy of entries (address_i, bp_i):
- The whole
amountis credited to the holder (the caller's own ledger row describes it). q = amount div 10,000,r = amount mod 10,000; for each entry in order:share = q × bp + (r × bp) div 10,000(=floor(amount × bp / 10,000), exact, no overflow); skip whenshare ≤ 0; skip a malformed address or the holder itself (cannot occur after §9); skip a full-key form (rulecanonical_account_forms; §9 refuses one, so only a policy no validation judged could hold it: the share stays with the holder); skip when the recipient's account exists and has the Payments bit of its transact policy set; ZBC: holder −share and recipient +share by plain credits, rows event 41 (holder, −share) and 42 (recipient, +share) with the context's transaction id and timestamp (transaction id 0 for a block-level credit that set no context; the liquid completion sets the payment id; the timestamp is the transaction's or the block's, never the clock); a share that lands on the deposit address of a stored file or a live dataset is booked as the holder's deposit (10); token: units move, no rows.- A recipient's own policy is not applied to the share it receives (no cascade). The
unassigned remainder (
10,000 − Σ bp) and every skipped share stay with the holder.
Rule activation. The type gate of §9; the full-key skip (canonical_account_forms) is active
from height 0 on every chain.
Rejections and errors. None; a failed share credit is a storage fault.
Vector. computed. INPUT: amount 123,456,789 to a holder with one entry of 5,000 bp → EXPECTED
q = 12,345, r = 6,789, share = 61,725,000 + 3,394 = 61,728,394; rows: holder +123,456,789 (the
caller's row), holder −61,728,394 (event 41), recipient +61,728,394 (event 42); the holder keeps
61,728,395. 7 units of a 0-decimal token at 5,000 bp → share 3; 1 unit → share 0, stays.
Test cases · §10
3 cases · 3 valid
7 units at 5,000 bp
Loading the test widget…
1 unit at 5,000 bp: the share is 0 and stays
Loading the test widget…
Defects to match. The ledger rows of a split made by a block step carry transaction_id 0
unless the step set a context (only the liquid completion does); an implementation must write the
same values.
11. The transact policy's effect on every transaction
Purpose. An account's opt-out of whole categories, in both directions.
Inputs. The mask of the sender's account row and of the envelope recipient's (when it is a real address), read at execution; the type's category.
Output and effect. The category table (bit = category number):
| Bit | Category | Types |
|---|---|---|
| 0 | Payments | SendZBC 1, SendZBCBatch 257, LiquidPayment 6, LiquidPaymentStop 262, CreateTrigger 15, CancelTrigger 16, ScheduledTransfer 29, CancelSchedule 30, ReassignSchedule 31 |
| 1 | Apps | CreateApp 24, JoinApp 25, AppMove 26, ResignApp 27, ClaimAppTimeout 28, SettleApp 39 |
| 2 | Tokens | IssueToken 10, TransferToken 11, TransferTokenBatch 267, MintToken 12, BurnToken 13, FinanceToken 14 |
| 3 | Exchange | CreateSwapOffer 18, AcceptSwapOffer 19, CancelSwapOffer 20, CreateMarket 21, PlaceOrder 22, CancelOrder 23 |
| 4 | DataStorage | SetupAccountDataset 3, RemoveAccountDataset 259, AddPrepaidStorage 9, StoreFile 40, FundStoredFile 296, SubmitStorageProof 41, SubmitStorageProofBatch 297, TransferDataset 42, SetDatasetPolicy 43, AcceptDataset 44, DeleteDataset 45, DFSCreateFile 8, DFSUpdateFile 264, DFSDeleteFile 520 |
| 5 | EscrowMultisig | ApprovalEscrow 4, EscrowRequest 260, DeclineEscrowRequest 516, MultiSignature 5 |
| 6 | NodeInfra | QueueAttendance 59, EquivocationReport 60, RollCall 61, SpineEquivocationReport 62, NodeRegistration 2, NodeRegistrationUpdate 258, RemoveNodeRegistration 514, ClaimNodeRegistration 770, RegisterGateway 36, GatewayHeartbeat 37, UnregisterGateway 38, RegisterArchival 46, UnregisterArchival 47, RegisterRelay 48, UnregisterRelay 49 |
| 7 | Bridge | AttestEvent 17 |
| 8 | Governance | FeeVoteCommitment 7, FeeVoteReveal 263, RegisterRelease 32, ReleaseAuthorityPropose 33, ReleaseAuthorityAccept 34, RevokeRelease 35, SetConsensusParam 51 |
| — | None (never refused) | Empty 0, SetTransactPolicy 50, SetSplitPolicy 54, the longevity types 52/53/309, the group types 55–58, and any type not listed |
A transaction is bounced when sender_mask & (1 << bit) or, for a non-empty, non-placeholder
envelope recipient, recipient_mask & (1 << bit): the fee is taken when the sender can pay, the
type does not run, and 04 §5's early-exit settlement follows (overpay back when the fee was taken;
rows 22 + 47 when it was not). Admission refuses the same transaction with
"Refused by transact policy: the <sender|recipient>'s transact policy refuses <Category> transactions (SetTransactPolicy bit <b>, mask <2^b>)" (the sender is checked first). A
split-policy share to an account with the Payments bit stays with the holder (§10). A batch's
recipients are in its body: SendZBCBatch and TransferTokenBatch check each body recipient's mask
themselves (§3.1, 14) and are a paid no-op of the whole batch when one refuses.
How to compute it. As stated; the recipient looked at is the envelope's recipient only, not an address inside the body.
Rule activation. None.
Rejections and errors. As stated.
Vector. computed. INPUT: account R with transact_policy 1; a SendZBC of 1 ZBC from S to R →
EXPECTED at admission Refused by transact policy: the recipient's transact policy refuses Payments transactions (SetTransactPolicy bit 0, mask 1); mined anyway → S pays its fee (settled per 04 §5), R receives nothing. INPUT: S with transact_policy 4 sends a TransferToken → Refused by transact policy: the sender's transact policy refuses Tokens transactions (SetTransactPolicy bit 2, mask 4). INPUT: every account row the genesis build writes (07 §3) → transact_policy 0, nothing
bounced until the account sends a SetTransactPolicy.
Test cases · §11
5 cases · 3 valid · 2 invalid · 1 reference
A SendZBC to an account with transact_policy 1 is refused
Loading the test widget…
A TransferToken from an account with transact_policy 4 is refused
Loading the test widget…
A SendZBC between accounts with no policy goes through
Loading the test widget…
SetTransactPolicy is never refused (category None)
Loading the test widget…
Every account row the genesis build writes has transact policy 0
A stated value: there is nothing to compute. A compatible node shows the same value.
- transact_policy
0
Defects to match. Only the envelope recipient is checked: a ScheduledTransfer's later fires, a trigger's release and a liquid payout are credited to an opted-out recipient without a bounce (the bounce happens only at the creating transaction, where the recipient is in the envelope).
12. The ledger rows of this family
Purpose. Every ledger row (07 §5) this chapter writes, in one place.
Inputs. The operations above.
Output and effect.
| Event | Row | Written by |
|---|---|---|
| 1 | sender −(amount + fee), recipient +amount | SendZBC; SendZBCBatch (sender −(Σ amount + fee) once, one + row per payment); the fee rows of CreateTrigger and mode-0 ZBC ScheduledTransfer; every fee taken by the other types |
| 13 | sender −(amount + fee) | LiquidPayment (ZBC) |
| 14 | recipient +vested, sender +rest (transaction_id = payment id, the block's timestamp) | liquid completion and stop |
| 15 | stopper −fee | LiquidPaymentStop |
| 23 | recipient +amount (transaction_id = trigger id) | trigger fire |
| 28 / 29 | recipient +tranche (28 for kind 2, 29 for kind 1) |
pre-locked schedule fire |
| 29 | owner −per_fire, recipient +per_fire | pull schedule fire |
| 30 | owner, change 0 | pull schedule skip |
| 34 | owner +locked | CancelSchedule refund, the end refund, the reclaim |
| 41 / 42 | holder −share / recipient +share | split policy |
| 50 | longevity pool +amount (transaction_id = trigger or schedule id) | a refused trigger credit; a refused end refund |
| 61 / 62 | owner −amount / +amount | CreateTrigger lock / CancelTrigger refund |
| 63 | owner −total | mode-0 ZBC ScheduledTransfer lock |
| 22, 46, 47 | per 04 §5 |
the settlement |
How to compute it. As stated in each section.
Rule activation. None.
Rejections and errors. None.
Vector. computed: the genesis faucet schedule's fire in block 1 (§6): two rows of event 29.
Test cases · §12
1 case · 1 valid · 1 reference
The faucet schedule's fire in block 1 writes two rows of event 29
A stated value: there is nothing to compute. A compatible node shows the same value.
- value
two rows of event 29
Defects to match. None.
A question about this chapter, or a statement that does not match the network? Discuss on zoobc.pro.