On this page
12 — Escrow (sender-issued and receiver-issued) and multisignature accounts
Out of scope the envelope serialization the escrow part sits in and its signing (03, 02); the fee floor and the generic refund (04); the split policy an approved credit passes through (08 §10); token balances (14); account groups (18); the longevity pool the rent feeds (13, 21); the snapshot file and its EscrowedTransactions section (26, 07 §11); the JSON of the escrow and multisig HTTP routes (31)
§0 The area in one paragraph
An escrow is a SendZBC or TransferToken whose envelope names an approver, a
commission, an absolute timeout and an instruction: the amount, the fee and the
commission leave the sender at once, and a rent for the bytes the escrow occupies until its
timeout is paid into the longevity pool. The approver settles it with an ApprovalEscrow:
approve pays the recipient and the approver's commission, reject returns the amount to the
sender and still pays the commission; the recipient may decline it (amount and commission
back to the sender); and the first block whose predecessor's timestamp passes the timeout
expires it (amount and commission back to the sender), as does the pruning horizon reaching
the escrow's block. An escrow's timeout may not reach past the point where the chain stops
keeping its transaction unless the sender pays a survival deposit that keeps it. A payee may
publish an EscrowRequest naming payer, amount, approver, commission, deadline and
instruction; the payer funds it with an escrowed SendZBC that links the request and matches it
exactly, or declines it. A multisignature account is the type-0 account
00000000 ‖ H, where H is a hash of a participant set, a nonce and a threshold; it has no key.
A MultiSignature wrapper may carry the account's definition, an unsigned inner transaction
sent by that account, and participant signatures over the chain-bound digest of the inner bytes,
in any combination; when a threshold of verifying signatures has accumulated, the inner
transaction runs once, paying its own fee, and is marked executed for ever. Every escrow,
request, pending transaction, signature and account definition is consensus state; the holds and
settlements move balances through the ordinary balance operations of 07 §3.
1. The escrow part of a transfer
Purpose. An implementation must recognise the escrow part of an envelope, decide whether the transaction is a valid escrow, and refuse every malformed or impossible escrow before it is mined.
Inputs. The escrow segment of the envelope (03 §7), hashed and signed with the rest; the
transaction's type, timestamp, recipient, body, message and survival field; the validating
height h (the block's height in a block; the tip + 1 at admission); the genesis parameters
main_snapshot_interval (I), main_snapshot_min_height (M) and dataset_storage_cost_per_mib
(P); SMITHING_PERIOD = 15; LONGEVITY_MIN_DEPOSIT = 10,000,000. The segment is either the
4-byte marker 02 00 00 00 (no escrow) or:
| Offset | Length | Field | Encoding |
|---|---|---|---|
| 0 | 4 + n | approver_address |
LE32(type) ‖ payload, the payload length fixed by the type (01 §4.1); type 2 = no escrow |
| 4+n | 8 | commission |
int64 LE |
| 12+n | 8 | timeout |
int64 LE, an absolute Unix second |
| 20+n | 4 | instruction_length |
uint32 LE |
| 24+n | L | instruction |
bytes, no 0x00, at most 128,000 |
| 24+n+L | 1 | multi_party |
01 = multi-party, any other value = not |
| 25+n+L | 4 | co_signature_length |
uint32 LE; present only when multi_party = 01 |
| 29+n+L | s | co_signer_signature |
the recipient's signature, may be empty |
| 29+n+L+s | 8 | escrow_request_id |
int64 LE, 0 = none |
The escrow bytes of a transaction are this segment exactly as written (approver through
multi_party, plus the multi-party tail when multi_party = 01).
Output and effect. A transaction has an escrow when its approver address is present and not of type 2. Such a transaction is accepted only when every check below passes; it is then created as an escrow when mined (§2). The multi-party flag, the co-signature and the request id are used only by these checks and by the request link of §7; they are not stored.
How to compute it. In this order (all stateless: admission and block validation alike, so a
failure refuses admission and makes a block invalid). Before them, among the message checks of
03, a foreign-signed carrier (02 §9) that carries an escrow part is refused (rule
foreign_carrier_bound): only a transaction signed by its sender over the ZooBC bytes can be an
escrow. Also before them, with the envelope's sender and recipient (08 §1 step 1), an approver in
a full-key form is refused (rule canonical_account_forms, 07 §3.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)".
- The instruction, when non-empty, is at most 128,000 bytes and contains no 0x00.
- The approver must be a well-formed typed account (
07§3.1) of a kind that can sign: type 0 ZBC, 1 BTC, 4 ETH, 5 P2PKH, 6 P2SH, 7 P2WPKH, 9 P2TR, 11 Solana, 12 Polkadot, 13 Cardano, 14 Ripple, 15 Tron or 16 Tezos. timeout > tx.timestamp.- The timeout cap (rule
escrow_timeout_cap). Withhas above:R(h)= 0 (no cap) whenI ≤ 0; elseR = (h div I + 2) × I, and whenR − I < M,R = (M div I + 2) × I.Ris the first height whose pruning horizon (§5) passesh.cap = tx.timestamp + (R − h) × 15, or no cap whenR= 0.- When
timeout > cap:timeout_height = h + (timeout − tx.timestamp) div 15;period=longevity_billing_period_blockswhen set above 0, elseI;free_until = h + 2 × period(saturating at 4,294,967,295);bytes= the body length + the message length (1 when that is 0);rent_per_period = max(1, ceil(bytes × P / 1,048,576));periods = ceil((timeout_height − free_until) / period)whentimeout_height > free_until, else 0;needed = max(rent_per_period × periods, 10,000,000), the product saturating at 9,223,372,036,854,775,807. The transaction is refused unlesstx.survival ≥ needed.
- The type is SendZBC (1) or TransferToken (11).
- The outflow (rule
escrow_commission_nonnegative):commission ≥ 0; and withamount= the SendZBC body's amount (0 for a TransferToken, whose amount is token units) andrent= the rent of §3, the sumamount + fee + commission + rentmust not overflow a signed 64-bit integer (when the SendZBC amount is negative this test is skipped: the SendZBC rules refuse it,08§3). - When
multi_party=01(ruleescrow_request): a co-signature or a request id must be present; a request id is allowed on SendZBC only; a co-signature by an Ethereum- or Tron-typed recipient (type 4 or 15, not 32 bytes long) must be exactly 65 bytes ending in the recovery byte 27 or 28 (ruleeth_signature_canonical_v,02§5); a co-signature must verify, under the recipient's account type (02§2), over the co-signer digest = the chain-bound digest of02§1 of the unsigned envelope written with the co-signature emptied (co_signature_length0, the request id kept). The sender then signs the envelope that contains the co-signature.
Rule activation. escrow_timeout_cap, escrow_request, escrow_commission_nonnegative,
foreign_carrier_bound, eth_signature_canonical_v and canonical_account_forms: active from
height 0 on every chain.
Rejections and errors. The full-key approver text above; "A foreign-signed carrier cannot carry an escrow"; then in the order of the steps:
"Escrow instruction exceeds maximum length of 128000", "Escrow instruction contains null bytes",
"Escrow approver address type cannot sign: it could never approve or reject",
"Escrow timeout must be a future Unix timestamp (now + lock duration); got T <= tx time S",
"Escrow timeout T is beyond the reachable prune horizon (cap C, block R); a header survival deposit of N units keeps it until the timeout (rule escrow_timeout_cap)",
"Escrow is only supported for SendZBC and TransferToken transactions",
"Escrow commission cannot be negative", "Escrow amount + fee + commission + rent overflow",
"Multi-party escrow needs a co-signature by the recipient or an escrow_request_id",
"An escrow request can only be funded by a SendZBC",
"Multi-party escrow: the recipient's co-signature: Ethereum signature recovery id must be 27 or 28", "Multi-party escrow: the recipient's co-signature does not verify".
Vector. computed (the escrow bytes): approver = the TestNet release authority
00000000 7D8BD8A4…61902572, commission 1,000,000, timeout 1,793,786,400, instruction
deliver by friday (17 bytes), not multi-party →
74 bytes 000000007D8BD8A41DCEEA4986D1E99DFE99CA9303874B7C3AAC7EEECD60A82F61902572 40420F0000000000 2002EB6A00000000 11000000 64656C697665722062792066726964617900 (the last byte 00 is multi_party).
computed (the cap as the status route quotes it, TestNet parameters): a node at tip 12,518
answers GET /api/v1/blockchain/status with "escrow_release_height":345600 and
"escrow_timeout_cap_seconds":4996215 — with I = 172,800, M = 760 and h = 12,519:
R = (12,519 div 172,800 + 2) × 172,800 = 345,600 and (345,600 − 12,519) × 15 = 4,996,215.
computed (the cap, TestNet parameters I 172,800, M 760, P 5,000,000): an escrowed SendZBC
(8-byte body, no message) at h = 12,500 with tx.timestamp 1,793,700,000 → R 345,600,
cap = 1,793,700,000 + 333,100 × 15 = 1,798,696,500. With timeout 1,799,700,000 and
survival 0: timeout_height 412,500, free_until 358,100, periods = ceil(54,400 / 172,800) = 1,
rent_per_period = ceil(8 × 5,000,000 / 1,048,576) = 39, needed = max(39, 10,000,000) =
10,000,000 → refused: Escrow timeout 1799700000 is beyond the reachable prune horizon (cap 1798696500, block 345600); a header survival deposit of 10000000 units keeps it until the timeout (rule escrow_timeout_cap). The same transaction with survival 10,000,000 passes.
Invalid inputs: the same escrow with timeout 1,793,700,000 (equal to tx.timestamp) →
Escrow timeout must be a future Unix timestamp (now + lock duration); got 1793700000 <= tx time 1793700000; with approver 08000000 ‖ 32 bytes (P2WSH) → Escrow approver address type cannot sign: it could never approve or reject; on an Empty (type 0) transaction → Escrow is only supported for SendZBC and TransferToken transactions; the escrowed SendZBC of 100,000,000 with
fee 5,000,000, tx.timestamp 1,793,700,000 and the escrow bytes above with the commission field
FFFFFFFFFFFFFFFF (−1) → Escrow commission cannot be negative; the same with the commission
field FFFFFFFFFFFFFF7F (9,223,372,036,854,775,807) → Escrow amount + fee + commission + rent overflow; a multi-party SendZBC to the Ethereum account 04000000 ‖ 20 bytes whose recipient's
co-signature r ‖ s ‖ 01 (65 bytes, recovery byte 1) would verify → Multi-party escrow: the recipient's co-signature: Ethereum signature recovery id must be 27 or 28, refused at admission
and invalid in a block; the same co-signature with its last byte 1C (28) passes this test; the
escrowed SendZBC with approver 04000000 ‖ 64 × 66 (68 bytes, given by named fields) → 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 · §1
16 cases · 6 valid · 10 invalid · 1 reference
The escrow part naming the release authority, deliver by friday
Loading the test widget…
An escrowed SendZBC passes the stateless checks
Loading the test widget…
The cap the status route quotes at tip 12,518 (TestNet parameters)
A stated value: there is nothing to compute. A compatible node shows the same value.
- escrow_release_height
345600- escrow_timeout_cap_seconds
4996215
The release height and cap seconds at height 12,519
Loading the test widget…
A timeout beyond the cap without a survival deposit is refused
Loading the test widget…
The same timeout with a survival deposit of 10,000,000 passes
Loading the test widget…
An escrow whose timeout equals the transaction's timestamp is refused
Loading the test widget…
A P2WSH approver is refused
Loading the test widget…
An escrow on an Empty transaction is refused
Loading the test widget…
An instruction with a null byte is refused
Loading the test widget…
An escrowed SendZBC with commission -1 is refused
Loading the test widget…
An escrowed SendZBC whose commission is 2^63 - 1 overflows its outflow
Loading the test widget…
A multi-party SendZBC to an Ethereum account whose co-signature ends in recovery byte 01 is refused
Loading the test widget…
The same co-signature ending in 1C (28) passes the recovery-id test
Loading the test widget…
An escrowed SendZBC whose approver is an Ethereum full-key form (68 bytes) is refused
Loading the test widget…
A multi-party escrow naming neither a co-signature nor a request is refused
Loading the test widget…
Defects to match. (1) The parser tolerates a truncated multi-party tail (a missing
co-signature or request id read as empty / 0); step 7 then refuses a multi-party part that names
neither. (2) The cap's bytes counts the body and the message, not the escrow bytes the rent of §3
counts.
2. Creating an escrow: the hold
Purpose. An implementation must take, when an escrowed transfer is mined, exactly what the escrow holds and record the escrow.
Inputs. The escrowed SendZBC or TransferToken (the sender is the executing sender: a linked
group member's transaction executes as its group, 18); the rent of §3; for a request-linked
escrow, the request (§7).
Output and effect.
- SendZBC: one debit of the sender's balance of
amount + fee + commission + rent; ledger rows event 16 for −(amount + fee + commission) and, whenrent > 0, event 45 for −rent on the sender with event 50 +rent on the longevity pool (21); a newescrow_transactionrow (keyid= the transaction id) withsender= the executing sender's bytes,recipient,approver,amount,commission,timeout,status0,block_height= this height,instruction,token_id0,decline_reasonempty. A linked request gets a new version with status 1 (§7). - TransferToken: one ZBC debit of
fee + commission + rent(the same rows, event 16 for −(fee + commission)); a debit ofamounttoken units; the record as above withtoken_id. - Then the fee settlement of
04§5: the overpay above the floor comes back as event 22; the rent is a separate amount, not part of the floor.
How to compute it.
- SendZBC, request link (
multi_party=01, request id ≠ 0): run the funding test of §7; a failed test is a paid no-op (the fee is charged best-effort, nothing is escrowed); a storage fault reading the request fails the block. - SendZBC:
rentper §3;amount + fee + commission + rentis summed with overflow checks (an overflow makes the block invalid,"EscrowApplyConfirmed: amount + fee + commission + rent overflow"; §1 step 6 refuses such a transaction first, so an honest block never carries one); the sum is debited from the confirmed balance; an insufficient balance makes the block invalid ("Insufficient balance"), as for a plain SendZBC. - TransferToken: the body must parse,
amount > 0,token_id ≠ 0, the fee paid in ZBC (not in the token), the token known,fee ≥ 0,commission ≥ 0andfee + commission + rentmust not overflow — each failure makes the block invalid; then the ZBC debit (insufficient → block invalid), then the token debit; insufficient token units → the ZBC debit is undone and the transaction is a paid no-op. - Admission additionally requires the sender's spendable balance to cover
amount + fee + commission + rent + survival(04§6), wheresurvivalis the deposit step 4 of §1 required; the sum is computed with overflow checks ("Escrow amount + fee + commission + rent overflow"), and the mempool reservesamount + fee + commission + rent(the TransferToken:fee + commission + rent) from the spendable balance with the same checks ("EscrowApplyUnconfirmed: amount + fee + commission + rent overflow").
Rule activation. uniform_fee_refund (the rent as its own amount), escrow_request,
state_answer_noop, escrow_commission_nonnegative (the checked sums of steps 2 and 4): active
from height 0 on every chain.
Rejections and errors. "EscrowApplyConfirmed: escrow data missing",
"EscrowApplyConfirmed: bad TransferToken body", "EscrowApplyConfirmed: transfer amount must be positive", "EscrowApplyConfirmed: TransferToken token_id required", "EscrowApplyConfirmed: escrowed token transfer must pay the fee in ZBC", "EscrowApplyConfirmed: unknown token N",
"EscrowApplyConfirmed: fee+commission overflow", "EscrowApplyConfirmed: amount + fee + commission + rent overflow", "Insufficient balance" — each makes the block invalid. Admission:
"Escrow amount + fee + commission + rent overflow", the balance refusal of 04 §6.
Vector. computed (TestNet parameters): an escrowed SendZBC of 100,000,000 with fee 5,000,000
and the escrow bytes of §1 (74 bytes, commission 1,000,000, timeout − tx.timestamp = 86,400 s),
tx.timestamp 1,793,700,000 → rent 12 (§3); the sender's balance falls by
100,000,000 + 5,000,000 + 1,000,000 + 12 = 106,000,012; rows: event 16 −106,000,000, event 45 −12,
event 50 +12 on 00000000 ‖ "ZBCLONGV" ‖ 24 × 00, then event 22 +(5,000,000 − floor); the
escrow_transaction row has status 0, amount 100,000,000, commission 1,000,000, timeout
1,793,786,400, token_id 0. Invalid: the same transaction from a sender whose confirmed balance is
106,000,011 → the block is invalid (Insufficient balance).
Test cases · §2
2 cases · 1 valid · 1 invalid
An escrowed SendZBC of 1 ZBC with rent 12
Loading the test widget…
The same from a sender holding one unit less makes the block invalid
Loading the test widget…
Defects to match. The stored sender is the executing sender's bytes (a member's escrow is recorded under its group).
3. Escrow rent
Purpose. An implementation must charge the price of keeping the escrow record until its timeout, identically on every node.
Inputs. The escrow bytes of §1 (E bytes); tx.timestamp and timeout;
dataset_storage_cost_per_mib (P), storage_oracle_multiplier_ppm (Q); the billing period =
the snapshot cycle main_snapshot_interval (T); SMITHING_PERIOD = 15. Live values: TestNet
P 5,000,000, Q 1,000,000, T 172,800.
Output and effect. rent (int64, ≥ 0): 0 when there is no escrow; otherwise
epr = ceil(ceil(E × P / 1,048,576) × Q / 1,000,000) (0 when P ≤ 0, Q ≤ 0 or E = 0),
blocks = ceil(max(timeout − tx.timestamp, 0) / 15), rent = ceil(epr × blocks / T) (0 when
T = 0). Every product is exact in 128-bit unsigned arithmetic, saturating at
9,223,372,036,854,775,807. It is debited at creation as its own amount (§2) and is distinct from
the survival deposit of §1 step 4.
How to compute it. As stated.
Rule activation. uniform_fee_refund: active from height 0 on every chain.
Rejections and errors. None.
Vector. computed (TestNet): E = 74 (the escrow bytes of §1), 86,400 s →
epr = ceil(ceil(74 × 5,000,000 / 1,048,576) × 1,000,000 / 1,000,000) = ceil(352.86…) = 353,
blocks = 5,760, rent = ceil(353 × 5,760 / 172,800) = ceil(11.77) = 12. The same escrow with
timeout = tx.timestamp + 1 → blocks 1, rent = ceil(353 / 172,800) = 1 (a non-empty escrow
with any lock pays at least one unit).
Test cases · §3
2 cases · 2 valid
The rent of the 74-byte escrow over 86,400 s
Loading the test widget…
The same escrow over one second pays one unit
Loading the test widget…
Defects to match. Rent is per block of duration at the block count the 15-second period implies, so a chain that runs slower than 15 s charges less per real second.
4. ApprovalEscrow (4)
Purpose. An implementation must apply the approver's settlement of an escrow.
Inputs. Body, exactly 36 bytes:
| Offset | Length | Field | Encoding |
|---|---|---|---|
| 0 | 4 | approval |
uint32 LE: 0 approve, 1 reject, 2 expire |
| 4 | 32 | transaction_hash |
the escrowed transaction's hash (03 §9) |
The escrow id = the int64 LE of the hash's first 8 bytes (03 §9). State read: the escrow row
(the newest version for that id) and the escrowed transaction itself, found by its id among the
node's stored transactions. A node rebuilt from a snapshot holds the transaction of every escrow
that was pending at the snapshot height, however old (the snapshot's EscrowedTransactions
section, 26), so the answer is the same on every node.
Output and effect. On a pending escrow whose stored transaction's hash equals the body's,
sent by its approver (the same typed account bytes, or the same account under groups, 07 §3,
"the same account"):
- approve: ZBC — the recipient +
amountthrough the incoming-credit path (its split policy applies,08§10; a credit to a deposit address is booked as the escrow sender's deposit,10), row event 16 (transaction_id= escrow id, timestamp = the approval's); the approver +commission when > 0 (a plain credit, row event 9); token — the recipient +amountunits through the incoming token credit, the approver +commission in ZBC (row event 9); status 1. - reject: the sender +
amount(ZBC, plain credit, row event 9; token: units back); the approver +commission when > 0 (row event 9); status 2. - expire (value 2 from the approver): ZBC — the sender +(amount + commission) (row event 9;
the sum is checked, rule
escrow_commission_nonnegative: a negative part or an overflow makes the block invalid,"EscrowApproval: amount + commission overflow", which no escrow created under §1 step 6 can reach); token — units back and the commission back to the sender (row event 9); status 3.
Then the approver's fee: a plain debit (block invalid when it cannot be paid), row event 9 for
−fee; the escrow gets a new version at this height with the new status. Then 04 §5 with the fee
counted as collected. When the recipient of an approved ZBC escrow cannot be credited (a state
refusal, not a storage fault), the escrow stays pending and the approver's fee is still charged.
How to compute it.
- Stateless (admission and block validation): the body parses and is exactly 36 bytes;
approval≤ 2. - Admission only: the escrow exists, is pending, the sender is the approver, the stored
transaction's hash equals the body's, and at block assembly the escrow will not be expired by
the target block's timestamp (
timeout < target timestamprefuses). - Execution, in this order — each of these is a paid no-op (fee charged best-effort, nothing else): no escrow with the id; the escrow is not pending (settled earlier in this block by the expiry step or a competing approval); the sender is not the approver; no stored transaction with the id; the stored transaction's hash differs from the body's. A storage fault reading the escrow or the transaction fails the block. Otherwise the settlement above.
Rule activation. escrow_request (the approver compare), state_answer_noop,
uniform_fee_refund, escrow_commission_nonnegative (the checked expire sum): active from height 0
on every chain.
Rejections and errors. Stateless: "ApprovalEscrow: invalid body: ApprovalEscrow body must be exactly 36 bytes (approval + escrowed tx hash), got M", "ApprovalEscrow: unknown approval value V (0 approve, 1 reject, 2 expire)". Admission: "ApprovalEscrow: invalid body", "ApprovalEscrow: no escrow for transaction hash <hex> (id N)", "ApprovalEscrow: escrow already processed",
"ApprovalEscrow: only the approver can approve/reject", "ApprovalEscrow: escrowed transaction hash does not match: N", "ApprovalEscrow: escrow will be expired by target block: N". Execution
faults: "ExecuteApprovalEscrow: escrow read failed: …", "ExecuteApprovalEscrow: escrowed transaction read failed: …"; block invalid: "EscrowApproval: amount + commission overflow".
Vector. computed: for an escrowed transaction with hash
74F670B6BC135B845A030C39D12EA1DA5E3D5291D62965E0F34B52E55D2B00AD (escrow id
−8,909,505,736,586,758,540 = int64 LE of 74F670B6BC135B84), the approve body is
00000000 74F670B6BC135B845A030C39D12EA1DA5E3D5291D62965E0F34B52E55D2B00AD, the reject body
01000000 ‖ hash, the expire body 02000000 ‖ hash. Applied by the approver to the escrow of §2
(amount 100,000,000, commission 1,000,000), approve → recipient +100,000,000 (event 16), approver
+1,000,000 (event 9), approver −fee (event 9), status 1; reject → sender +100,000,000, approver
+1,000,000, status 2; expire → sender +101,000,000, status 3. Invalid: body
03000000 ‖ hash → ApprovalEscrow: unknown approval value 3 (0 approve, 1 reject, 2 expire)
(block invalid); a 35-byte body → ApprovalEscrow: invalid body: ApprovalEscrow body must be exactly 36 bytes (approval + escrowed tx hash), got 35; a second approval of the same escrow in
the same block → a paid no-op.
Test cases · §4
10 cases · 8 valid · 2 invalid · 1 reference
The approve body
Loading the test widget…
The reject body
Loading the test widget…
The expire body
Loading the test widget…
The approve body passes the stateless checks
Loading the test widget…
Approval value 3 is refused
Loading the test widget…
A 35-byte body is refused
Loading the test widget…
The credits of approve on the escrow of §2
Loading the test widget…
The credits of reject on the escrow of §2
Loading the test widget…
The credits of expire on the escrow of §2
Loading the test widget…
A second approval of the same escrow in one 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) An approver's transaction with value 2 expires its own escrow early (the commission goes back to the sender). (2) The fee is debited after the settlement, so an approver with an empty account can pay it from the commission it just received.
5. Expiry
Purpose. An implementation must release, before each block's transactions, every escrow past its timeout or past the pruning horizon.
Inputs. The block's height h and timestamp; the previous block's timestamp; the escrow rows;
the longevity rows (13); main_snapshot_interval (I) and main_snapshot_min_height (M).
Output and effect. The first per-block step (22), before the block's transactions: every
escrow whose newest version has status 0 and that satisfies either
timeout < clock, whereclock= the previous block's timestamp (ruleexpiry_previous_stamp), or- its
block_height < horizon(h)and no longevity record for its id has a newest version withdeposit > 0(ruleescrow_horizon_pure),
is expired: ZBC — the sender +(amount + commission) by a plain credit (row event 9,
transaction_id = escrow id, timestamp = this block's own); token — the units back to the
sender and the commission (ZBC) back with a row event 9; a new version with status 3 and an empty
decline_reason. horizon(h): newest = (h div I) × I; horizon = newest − I; 0 (no horizon
clause) when I ≤ 0, newest < M, newest ≤ 0, horizon < M or horizon ≤ 0. The node never
prunes a transaction below this horizon's reach earlier than this release (26).
How to compute it. As stated; both comparisons are strict.
Rule activation. expiry_previous_stamp, escrow_horizon_pure, balance_credit_full_row:
active from height 0 on every chain.
Rejections and errors. A failed read of the escrow list is a fault of this node: it refuses the
block (an empty list ends the step). A refund that fails for one escrow (a credit the account rules
refuse, or an amount + commission that overflows, which no escrow created under §1 step 6 holds)
leaves that escrow pending and the step continues with the next.
Vector. computed: an escrow with timeout 1,793,786,400. Block n−1 has timestamp
1,793,786,400 (not greater), block n 1,793,786,415: at block n clock = 1,793,786,400 → not
expired; at block n+1 clock = 1,793,786,415 > timeout → expired, sender +(amount + commission)
with event 9 and block n+1's timestamp. Horizon (TestNet I 172,800, M 760):
horizon(345,599) = 0 (newest 172,800, 172,800 − 172,800 = 0); horizon(345,600) = 172,800, so an
escrow created at height 12,500 without a funded longevity record is expired at block 345,600
whatever its timeout — exactly the R of §1.
Test cases · §5
4 cases · 4 valid
At block n the clock equals the timeout: not expired
Loading the test widget…
At block n + 1 the clock is past the timeout: expired
Loading the test widget…
horizon(345,599) is 0
Loading the test widget…
At height 345,600 the horizon expires an escrow of height 12,500
Loading the test widget…
Defects to match. (1) The horizon clause expires an escrow whose transaction a snapshot would leave behind, whatever its timeout; §1's cap keeps a legitimate escrow from being caught by it. (2) The escrows are refunded in the order the store returns them (no defined order); only the order of the ledger rows within the block depends on it.
6. EscrowRequest (260)
Purpose. An implementation must record a payee's published terms for an escrow.
Inputs. Body:
| Offset | Length | Field | Encoding |
|---|---|---|---|
| 0 | 4 + n | proposed_sender |
LE32(type) ‖ payload (the payer) |
| 4+n | 8 | proposed_amount |
int64 LE, > 0 |
| 12+n | 4 + m | approver_address |
LE32(type) ‖ payload |
| 16+n+m | 8 | commission |
int64 LE, ≥ 0 |
| 24+n+m | 8 | timeout |
int64 LE, > 0: the absolute escrow timeout the funding must carry |
| 32+n+m | 4 | instruction_length |
uint32 LE |
| 36+n+m | L | instruction |
no 0x00, ≤ 128,000 |
| 36+n+m+L | 8 | expiry |
int64 LE, > 0: the number of blocks after this one during which it can be funded |
Minimum 44 bytes.
Output and effect. The sender −fee (row event 1; a sender that cannot pay is not charged and
nothing is written); a new escrow_request row: id = the transaction id, requester = the
sender, proposed_sender, proposed_amount, approver, commission, timeout, instruction,
expiry = this height + body expiry, status 0, escrow_transaction_id 0, block_height = this
height. Then 04 §5. A read of a pending request whose expiry is below the next height reports it
as expired; nothing in state changes.
How to compute it. Stateless (admission and block validation), in order: the body parses; the
payer is present and at least 24 bytes; proposed_amount > 0; the approver is present and at least
24 bytes; the payer is a well-formed typed account of a kind that can sign (the list of §1 step 2);
so is the approver; neither party is a full-key form (rule canonical_account_forms, 07 §3.1;
each address is read at its type's fixed length, 01 §4.1, so body bytes never yield one and this
test guards the parsed value only); timeout > 0; expiry > 0; commission ≥ 0; the instruction
rule of §1 step 1.
Rule activation. escrow_request, state_answer_noop, canonical_account_forms: active from
height 0 on every chain.
Rejections and errors. "EscrowRequest body too short", "Unexpected end of bytes (…)",
"EscrowRequest requires proposed sender address", "Invalid proposed sender address size",
"EscrowRequest proposed amount must be positive", "EscrowRequest requires approver address",
"Invalid approver address size", "EscrowRequest: proposed sender address type cannot sign",
"EscrowRequest: approver address type cannot sign: it could never approve or reject",
"EscrowRequest: a party: 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)", "EscrowRequest timeout must be positive", "EscrowRequest expiry must be positive",
"EscrowRequest commission cannot be negative", and the instruction texts of §1.
Vector. computed: payer = the TestNet release authority 00000000 7D8BD8A4…61902572, amount
10,000,000, approver = the treasury 00000000 120EE4CA…E0B7E807, commission 1,000, timeout
1,793,800,000, instruction pay on delivery, expiry 240 → 123 bytes
000000007D8BD8A41DCEEA4986D1E99DFE99CA9303874B7C3AAC7EEECD60A82F61902572 8096980000000000 00000000120EE4CA9D258D75656901EC4837373E07763369AD75ED8D63FA31C7E0B7E807 E803000000000000 4037EB6A00000000 0F000000 706179206F6E2064656C6976657279 F000000000000000; mined at height
12,500 it stores expiry 12,740 and status 0. Invalid: the same body with the approver replaced by
0A000000 ‖ 32 bytes (a ZBS_ address) → EscrowRequest: approver address type cannot sign: it could never approve or reject; with proposed_amount 0 → EscrowRequest proposed amount must be positive.
Test cases · §6
5 cases · 3 valid · 2 invalid · 1 reference
An EscrowRequest of 0.1 ZBC
Loading the test widget…
The request passes the stateless checks
Loading the test widget…
A ZBS_ approver is refused
Loading the test widget…
A proposed amount of 0 is refused
Loading the test widget…
The request mined at height 12,500
A stated value: there is nothing to compute. A compatible node shows the same value.
- expiry
12740- status
0
Defects to match. The body's timeout is a point in time while expiry is a block count; the
stored expiry is absolute.
7. Funding a request
Purpose. An implementation must settle a request with the escrowed SendZBC that links it, and only with one that matches it exactly.
Inputs. An escrowed SendZBC with multi_party = 01 and escrow_request_id = the request's
id; the request's newest version.
Output and effect. The link must satisfy all of, in this order: the request exists; it is
pending; the block height ≤ its expiry; the sender is the proposed payer (the same typed
account, or the same account under groups); the recipient is the requester (the same typed
account); the SendZBC amount equals proposed_amount; the approver equals the request's; the
commission, the escrow timeout and the instruction (byte for byte) are equal. Then the hold of §2
and a new request version with status 1 and escrow_transaction_id = the escrow's id. Any mismatch
is a paid no-op (nothing escrowed); a storage fault reading the request fails the block.
Admission refuses the same cases with the same texts.
How to compute it. As stated.
Rule activation. escrow_request: active from height 0 on every chain.
Rejections and errors. "escrow request N not found", "escrow request already settled",
"escrow request expired", "escrow request names another payer", "escrow request funding must pay the requester", "amount differs from the escrow request", "approver differs from the escrow request", "commission differs from the escrow request", "deadline (escrow timeout) differs from the escrow request", "instruction differs from the escrow request".
Vector. computed: funding the request of §6 (id 4,512,928,738,978,693,598, int64 LE
DE017A0FC724A13E, sent by the treasury) takes a SendZBC from the release authority to the
treasury, body 8096980000000000, escrow part = approver 00000000 120EE4CA…E0B7E807, commission
E803000000000000, timeout 4037EB6A00000000, instruction pay on delivery, then
01 00000000 DE017A0FC724A13E (multi-party, no co-signature, the request id), mined at a height
≤ 12,740 → escrow created, request status 1. Invalid: the same with amount 9,999,999 → a paid no-op
(amount differs from the escrow request at admission).
Test cases · §7
6 cases · 4 valid · 2 invalid
The request id as written in the escrow part
Loading the test widget…
The escrow part of the funding SendZBC
Loading the test widget…
The funding SendZBC passes the stateless checks
Loading the test widget…
The funding matches the request
Loading the test widget…
A funding of 9,999,999 does not match
Loading the test widget…
A funding above the request's expiry
Loading the test widget…
Defects to match. The equality of timeout means a request is fundable only with the exact
absolute deadline it stated, however late it is funded.
8. DeclineEscrowRequest (516)
Purpose. An implementation must let the side that did not create a request or an escrow refuse it, with a reason.
Inputs. Body:
| Offset | Length | Field | Encoding |
|---|---|---|---|
| 0 | 8 | target_id |
int64 LE, ≠ 0: a request id, or an escrow id |
| 8 | 2 | reason_length |
uint16 LE, ≤ 512 |
| 10 | r | reason |
UTF-8, no 0x00 |
| 10+r | 0 or 1 | target |
absent = request; 01 = escrow; any other value refused |
Output and effect. Request target: when the sender is the proposed payer (the same typed
account or the same account under groups) of a pending, unexpired request: the fee is charged
(an unpayable fee leaves nothing written), and the request gets a new version with status 4 and the
reason. Escrow target: when the escrow is pending, its transaction is a SendZBC (a token escrow is
always a TransferToken), the sender is its recipient (same typed account or same account) and not
its sender: the fee, then the sender +(amount + commission) (ZBC, row event 9) or the token units
back and the commission (row event 9), and the escrow gets a new version with status 4 and
decline_reason. Anything else: a paid no-op; a storage fault reading the escrow, the request or
the escrowed transaction fails the block. Then 04 §5.
How to compute it. Stateless (admission and block validation), in order: body ≥ 10 bytes; when
the body is exactly 10 + r + 1 bytes the last byte must be 01, otherwise the body must be
exactly 10 + r bytes; r ≤ 512; no 0x00 in the reason; target_id ≠ 0. Admission then mirrors
the executor's answers.
Rule activation. The type exists from escrow_request: active from height 0 on every chain.
Rejections and errors. Stateless: "DeclineEscrowRequest: body too short",
"DeclineEscrowRequest: unknown decline target", "DeclineEscrowRequest: reason length does not match the body", "DeclineEscrowRequest: the reason is longer than 512 bytes",
"DeclineEscrowRequest: the reason contains a NUL byte", "DeclineEscrowRequest: request_id is 0" / "DeclineEscrowRequest: escrow id is 0". Admission: "escrow request N not found",
"escrow request already settled", "escrow request expired", "only the payer the escrow request names can decline it", "escrow N not found", "escrow already settled", "escrowed transaction N not found", "only an escrowed SendZBC or TransferToken can be declined by its recipient",
"only the escrow's recipient can decline it", "the escrow's sender cannot decline its own escrow".
Vector. computed: the payer declines the request of §6 with declined by payer → 27 bytes
DE017A0FC724A13E 1100 6465636C696E6564206279207061796572; the recipient declines escrow
−8,909,505,736,586,758,540 with not expected → 23 bytes 74F670B6BC135B84 0C00 6E6F74206578706563746564 01. Invalid: the escrow decline with a final 00 instead of 01 →
DeclineEscrowRequest: unknown decline target; 0000000000000000 0000 → DeclineEscrowRequest: request_id is 0.
Test cases · §8
6 cases · 4 valid · 2 invalid
The payer declines the request
Loading the test widget…
The recipient declines the escrow
Loading the test widget…
The request decline passes the stateless checks
Loading the test widget…
The escrow decline passes the stateless checks
Loading the test widget…
An escrow decline ending in 00 is refused
Loading the test widget…
A decline of target 0 is refused
Loading the test widget…
Defects to match. A request decline carries no trailing byte while an escrow decline carries
exactly 01; an implementation must never write 00.
9. The multisignature account
Purpose. An implementation must derive a multisignature account's address from its definition and hold its balance and definition under the right keys.
Inputs. A definition: minimum_signatures (uint32), nonce (int64), the participants (typed
accounts, each LE32(type) ‖ payload with the payload length fixed by the type, 01 §4.1).
Output and effect.
H = SHA3-256(LE32(minimum_signatures) ‖ LE64(nonce) ‖ LE32(count) ‖ the participants sorted in ascending byte order, each written in full), 32 bytes.- The account is the type-0 typed account
00000000 ‖ H(36 bytes). Its balance row, its ledger rows and its nonce are keyed by those 36 bytes; it is funded by any transfer whose recipient is00000000 ‖ H, and an inner transaction it sends names00000000 ‖ Has its sender. Halone is never an account. Under ruletyped_accounts_only, a 32-byte value as a sender or recipient is a bare key: it cannot be written into an envelope and is refused with"accounts are typed: a bare 32-byte key is not an account on this chain"(07§3.1,03§1); no read treats it as an alias of00000000 ‖ H.- The definition is stored keyed by the bare 32-byte
H: onemultisignature_inforow (keymultisig_address= H;minimum_signatures,nonce) and onemultisignature_participantrow per participant (key (H, participant);account_address_index= its position in the body), both versioned byblock_height. These keys are table keys, not account addresses. - Completion (§10) finds the definition by taking the pending inner transaction's sender and, when
it is 36 bytes starting
00000000, dropping those 4 bytes. A sender of any other type (0B000000 ‖ H, for example) keeps its prefix, finds no definition, and never completes: only type 0 addresses a multisignature account.
How to compute it. As stated. A definition is not checked against anything when stored: any participant set derives its own account and can spend only from it.
Rule activation. typed_accounts_only: active from height 0 on every chain.
Rejections and errors. None at derivation. A body whose definition has minimum_signatures 0 or
above the participant count is refused (§10).
Vector. computed: participants (in body order) 00000000 7D8BD8A4…61902572 (the TestNet
release authority), 00000000 120EE4CA…E0B7E807 (the treasury), 04000000 9A080FFFE4105361B023220BD21BE0B9418E908E (an ETH account, 24 bytes); minimum_signatures 2,
nonce 1. Sorted: treasury, release authority, ETH. The 112-byte preimage is
02000000 0100000000000000 03000000 00000000120EE4CA9D258D75656901EC4837373E07763369AD75ED8D63FA31C7E0B7E807 000000007D8BD8A41DCEEA4986D1E99DFE99CA9303874B7C3AAC7EEECD60A82F61902572 040000009A080FFFE4105361B023220BD21BE0B9418E908E and
H = 4B7B0B74D39F9CBE6CE878DDBCDBDF3E89B7531DFABCE0B2651087753455C86A. The account is
00000000 4B7B0B74…3455C86A; a SendZBC to it credits that 36-byte row. Invalid: a transaction
naming the 32 bytes 4B7B0B74…3455C86A as its recipient → accounts are typed: a bare 32-byte key is not an account on this chain.
Test cases · §9
3 cases · 2 valid · 1 invalid
The account of a 2-of-3 definition with nonce 1
Loading the test widget…
A transaction naming the bare 32-byte H as recipient is refused
Loading the test widget…
A SendZBC to the typed account 00000000 ‖ H passes
Loading the test widget…
Defects to match. None.
10. MultiSignature (5)
Purpose. An implementation must store a multisignature account's definition, its proposed inner transactions and the participants' signatures, and run an inner transaction exactly once when a threshold of verifying signatures exists.
Inputs. The body, three parts in this order (an empty body is valid: every part absent):
| Offset | Length | Field | Encoding |
|---|---|---|---|
| 0 | 4 | info_present |
uint32 LE; 1 = the definition follows; any other value = absent |
| 4 | 4 | minimum_signatures |
uint32 LE |
| 8 | 8 | nonce |
int64 LE |
| 16 | 4 | participant_count |
uint32 LE |
| 20 | Σ | participants | each LE32(type) ‖ payload, the payload length fixed by the type |
| … | 4 | inner_length |
uint32 LE (0 = no inner transaction) |
| … | i | inner_bytes |
the inner transaction's unsigned envelope (03 §1 without a signature) |
| … | 4 | signatures_present |
uint32 LE; 1 = follows; any other value = absent |
| … | 32 | transaction_hash |
SHA3-256 of the inner unsigned bytes |
| … | 4 | signature_count |
uint32 LE |
| … | … | signatures | each: LE32(type) ‖ payload ‖ signature_length (uint32 LE) ‖ signature |
Bytes after the signature part are ignored. The wrapper's own sender (any account; nothing requires it to be a participant) pays the outer fee.
Output and effect.
- Outer fee: a plain debit of the wrapper's fee from its sender (block invalid when it cannot be paid), row event 10.
- Replay guard (rule
multisig_no_replay): when the carried inner bytes' hash, or the signature part'stransaction_hash, names a pending transaction whose newest version is executed, nothing more happens (the fee stays). - Definition: a new
multisignature_infoversion and new participant versions at this height (§9); a repeat at the same height replaces the row. - Inner bytes: a new
pending_transactionversion:sender= the inner envelope's sender (36 bytes, typed),transaction_hash= SHA3-256(inner bytes), the bytes,status0, this height (a repeat at the same height replaces the row). - Signatures: for each
(address, signature)a newpending_signatureversion keyed (transaction_hash,address), unless that signer already has a version for that hash at this height (skipped). - Completion:
h= the signature part's hash when present, else the hash of the carried bytes. When the newest pending version forhexists and is pending, and a definition exists for its sender (§9), count the newest stored signatures forhwhose address equals a participant byte for byte, which, for an Ethereum- or Tron-typed participant, are exactly 65 bytes ending in the recovery byte 27 or 28 (ruleeth_signature_canonical_v; a stored signature in another form is not counted), and whose signature verifies, under the signer's account type (02§2), over the chain-bound digestSHA3-256("ZBC-TX" ‖ genesis_hash ‖ inner bytes)(02§1). Atcount ≥ minimum_signaturesthe inner transaction runs once:- its sender must equal the pending sender (else block invalid:
"Multisig inner-tx sender is not the multisig account"); its id becomes the wrapper's id; - when its fee is below its own floor at this height (
04§2), it stays pending and the wrapper ends here; - when an inner transaction of the same pending sender was already executed in this block (a
pending version of that sender with status 1 at this height), the block is invalid
(
"Block carries two transactions from one account (multisig <hex> already ran an inner transaction in this block): one transaction per account per block"); - the account-group gate applies to a multisignature account that is a member (
18); a refused inner makes the block invalid ("Multisig inner transaction: account group: <reason>"); - the fee is debited from the account holding the inner sender's balance (row event 70, added to
the block's reward pool,
21); a payer that cannot cover it makes the block invalid ("Multisig inner transaction: insufficient balance for its fee"), except for the four group management types, which run unpaid; - the type runs with fee 0; allowed types: Empty, SendZBC, NodeRegistration,
NodeRegistrationUpdate, RemoveNodeRegistration, ClaimNodeRegistration, SetSplitPolicy,
LinkAccount, UnlinkAccount, SetMemberPermissions, TransferGroupControl (any other: block
invalid,
"Inner transaction type not supported in multisig"); a failure makes the block invalid ("Inner transaction execution failed: …"); an inner SetSplitPolicy that names a full-key entry sets nothing (block validation does not judge the inner body; its execution makes it a no-op,08§9); - when the type refunds overpay (
04§5),fee − floorcomes back to the account that now holds the payer's balance (row event 22); - the pending transaction gets a new version with status 1 (executed).
- its sender must equal the pending sender (else block invalid:
- Then
04§5 for the wrapper.
How to compute it. Stateless (admission and block validation): the body parses
("MultiSignature: invalid body: …"); with a definition, 1 ≤ minimum_signatures ≤ participant_count; every non-empty signature the body carries for an Ethereum- or Tron-typed
participant (type 4 or 15, an address that is not 32 bytes long) is exactly 65 bytes ending in the
recovery byte 27 or 28 (rule eth_signature_canonical_v, 02 §5), so a block carrying a 0/1 or
29/30 copy is invalid on every node; carried inner bytes parse as an unsigned envelope and pay at
least their own floor. Admission only: the replay guard; the inner transaction (carried, or the stored pending one
a signature-only wrapper names) must be of an allowed type, pass its own stateless and admission
rules, a SendZBC must be covered by the multisignature account's spendable balance, and a
signature-only wrapper whose stored inner is now below its floor is refused. The mempool reserves
the outer fee only. Block assembly takes one wrapper per multisignature account per block (04 §10). Pending and signature rows below the pruning floor are deleted only when superseded or
executed; a live pending transaction is kept (07 §11).
Rule activation. multisig_no_replay, group_spend_invalid_block, state_answer_noop,
typed_accounts_only, eth_signature_canonical_v, canonical_account_forms: active from height 0
on every chain.
Rejections and errors. Stateless: "MultiSignature: invalid body: Invalid multisig body: …",
"MultiSignature: minimum_signatures must be between 1 and the participant count",
"MultiSignature: participant signature: Ethereum signature recovery id must be 27 or 28",
"MultiSignature: inner transaction does not parse: …", "MultiSignature: inner transaction fee too low (F < minimum M)". Admission: "MultiSignature: the inner transaction has already been executed and cannot be submitted again", "MultiSignature: the signed inner transaction has already been executed", "MultiSignature: inner transaction refused, account group: …", "MultiSignature: inner transaction type N is not one a multisig account can send", "MultiSignature: inner transaction: …", "MultiSignature: the multisig account cannot cover the inner transaction (N needed, M spendable)", "MultiSignature: the inner transaction's fee is below the floor (F < minimum M)". Block invalid at execution: the texts of step 6.
Vector. computed (the account of §9, on the chain whose genesis hash is the vectors' chain
identity G = E003E4E3…2871 of 02 §1):
- Definition only (124 bytes):
01000000 02000000 0100000000000000 03000000 000000007D8BD8A41DCEEA4986D1E99DFE99CA9303874B7C3AAC7EEECD60A82F61902572 00000000120EE4CA9D258D75656901EC4837373E07763369AD75ED8D63FA31C7E0B7E807 040000009A080FFFE4105361B023220BD21BE0B9418E908E 00000000 00000000→ info rowmultisig_address=4B7B0B74…3455C86A(32 bytes),minimum_signatures2,nonce1, three participant rows with indexes 0, 1, 2. - An inner version-1 SendZBC of 1,000,000 from
00000000 4B7B0B74…3455C86Ato the release authority, fee 5,000,000, timestamp 1,793,700,100, unsigned (113 bytes):01000000 01 04B1E96A00000000 000000004B7B0B74D39F9CBE6CE878DDBCDBDF3E89B7531DFABCE0B2651087753455C86A 000000007D8BD8A41DCEEA4986D1E99DFE99CA9303874B7C3AAC7EEECD60A82F61902572 404B4C0000000000 08000000 40420F0000000000 02000000 00000000; its hash (the pending key)41D81C21501C502BC5E003B26676C37D9E0CD2C7195423F895DCE31BF4A9DF03; the digest each participant signs5E44252B38D52B1622DA4EC263056CDDB61AEC7EE4A1CEF8956CB6BE22B2DE43. - Inner only (125 bytes):
00000000 71000000 ‖ the 113 bytes ‖ 00000000→ a pending row (sender00000000 4B7B0B74…, status 0). - Signature only, one signature by the release authority:
00000000 00000000 01000000 41D81C21…4A9DF03 01000000 000000007D8BD8A4…61902572 40000000 ‖ 64 signature bytes(152 bytes) → onepending_signaturerow; one verifying signature is below the threshold 2, nothing runs. A second wrapper with the treasury's verifying signature → the inner runs: the account −5,000,000 (event 70), −1,000,000 to the release authority (event 1 rows of the SendZBC), +(5,000,000 − floor) back (event 22), pending status 1. - Invalid: the definition with
minimum_signatures0 (01000000 00000000 0100000000000000 03000000 ‖ the three participants ‖ 00000000 00000000) →MultiSignature: minimum_signatures must be between 1 and the participant count; any wrapper that carries or names41D81C21…4A9DF03after its execution → refused at admission (the inner transaction has already been executed …), a paid no-op if mined; a signature-only wrapper whose one signature is by the ETH participant04000000 9A080FFF…418E908Eand is 65 bytes ending in01→MultiSignature: participant signature: Ethereum signature recovery id must be 27 or 28, refused at admission and invalid in a block (ending in1Bor1Cit passes this test and counts when it verifies).
Test cases · §10
13 cases · 10 valid · 3 invalid · 2 reference
The definition-only body
Loading the test widget…
The definition-only body passes the stateless checks
Loading the test widget…
The inner SendZBC of 0.01 ZBC from the multisignature account
Loading the test widget…
The pending key: SHA3-256 of the inner bytes
Loading the test widget…
The chain-bound digest each participant signs
Loading the test widget…
The inner-only body
Loading the test widget…
A signature-only body with one signature
Loading the test widget…
A signature-only wrapper whose Ethereum participant's signature ends in 01 is refused
Loading the test widget…
The same signature ending in 1B (27) passes the stateless checks
Loading the test widget…
The same signature ending in 1C (28) passes the stateless checks
Loading the test widget…
A definition with minimum_signatures 0 is refused
Loading the test widget…
The second verifying signature runs the inner transaction
A stated value: there is nothing to compute. A compatible node shows the same value.
- value
the account −5,000,000 (event 70), −1,000,000 to the release authority, +(5,000,000 − floor) back (event 22), pending status 1
A wrapper naming the executed inner hash is refused at admission
A stated value: there is nothing to compute. The statement is a refusal: the exact text a compatible node answers.
- refusal
MultiSignature: the inner transaction has already been executed and cannot be submitted again
Defects to match. (1) Signatures within one body are keyed by the signer's address: a repeated signer keeps the last signature, and a re-encoding writes them in ascending hex-address order; any order parses. (2) A truncated signature list ends the list silently (the signatures read so far count). (3) A nested-multisignature signature (framed with a 4-byte prefix) is not supported and is not counted. (4) A participant signature over the bare inner hash does not count. (5) Signatures are stored even when no pending transaction or definition exists for the hash; nothing expires a pending transaction.
11. Lifecycles, ledger rows and the state
Purpose. An implementation must keep the escrow and multisignature objects and their status values exactly as the rules above write them.
Output and effect. Escrow status: 0 pending → 1 approved (§4) / 2 rejected (§4) / 3 expired (§4 value 2, §5) / 4 declined (§8). Request status: 0 pending → 1 approved (§7) / 4 declined (§8); 2 and 3 are never written (a read reports an expired pending request as 3). Pending transaction: 0 pending → 1 executed.
| Event | Row | Written by |
|---|---|---|
| 16 | sender −(amount + fee + commission) at creation; recipient +amount on approve | §2, §4 |
| 45 / 50 | sender −rent / longevity pool +rent | §2 |
| 9 | approver +commission; sender refunds; approver −fee; expiry and decline refunds | §4, §5, §8 |
| 1 | sender −fee | EscrowRequest, DeclineEscrowRequest |
| 10 | wrapper sender −fee | MultiSignature |
| 70 | multisignature account −inner fee | §10 |
| 22, 47 | per 04 §5 |
the generic settlement |
State (the full schemas are in 07 §1): escrow_transaction and escrow_request (key id),
pending_transaction (key transaction_hash), pending_signature (key (account_address,
transaction_hash)), multisignature_info (key multisig_address) and multisignature_participant
(key (multisig_address, account_address)) are versioned by block_height: every change writes a
new row at the block's height and marks it the newest for its key; the current value is the newest
row; a reorganisation to T deletes every row above T and re-marks the newest survivor per key; a
snapshot carries the newest row per key at or below its height. Reads used above: "the newest
escrow row for id", "the newest pending row for a hash", "the newest signature rows for a hash",
"the newest definition for H and its newest participant rows in index order", "is there a pending
row of this sender with status 1 at this height". Local, not consensus: the ledger rows' history,
the mempool reservations, the admission-only checks.
How to compute it. As stated.
Rule activation. None beyond the sections above.
Rejections and errors. None.
Vector. none (the sections above give the transitions).
Test cases · §11
1 case · 1 valid · 1 reference
Lifecycles and ledger rows: no vector
A stated value: there is nothing to compute. A compatible node shows the same value.
- value
none
Defects to match. None.
A question about this chapter, or a statement that does not match the network? Discuss on zoobc.pro.