On this page
  1. §0 The area in one paragraph
  2. 1. Integers, byte order and units
  3. 2. Hash functions
  4. 3. Text encodings
  5. 4. The account address (byte form)
  6. 4.1 Fixed-layout payload length by type
  7. 4.2 Well-formedness of an embedded address
  8. 5. The ZooBC text address (ZBC_ family)
  9. 6. Foreign text forms
  10. 7. Keyless and derived addresses
  11. 8. The verifiable random function (ECVRF, ZooBC variant)

01 — Primitives and addresses

Edition 0.6.1 · verified against the reference implementation, version 0.6.1

Out of scope how a signature is made and verified for each account type (02); where an address sits inside a transaction and how its length is read there (03); the account state behind an address and what a group does to it (07, 18); the dataset object and its rent (10); multi-signature accounts beyond the address formula (12); the JSON shapes of addresses in the HTTP API (31); how the block seed uses the VRF and where the proof sits in the header (05 §5, 20)

§0 The area in one paragraph

Everything in ZooBC is bytes hashed, signed or compared; this document fixes the primitives those bytes are built from. Integers are little-endian unless a foreign format dictates otherwise, money is a signed 64-bit count of atomic units with one ZBC equal to one hundred million of them, and the hash that identifies almost everything native is SHA3-256. An account is identified by its account address: a 4-byte little-endian type number followed by a payload whose meaning and length the type decides. Type 0 is the native account, whose payload is an Ed25519 public key or, for accounts nobody holds a key for, a 32-byte hash. Sixteen other types mirror foreign chains (Bitcoin in five script shapes, Ethereum, Solana, Polkadot, Cardano, Ripple, Tron, Tezos), hold a dataset object's deposit, or are reserved. Every account is typed: a bare 32-byte key is a node key, never an account, and a sender or recipient of that shape is refused. An Ethereum or Tron account is its type and 20 Keccak bytes, a Bitcoin legacy, P2PKH or P2WPKH account its type and 20 HASH160 bytes; the form of those types that carries the whole public key instead names no account either and is refused wherever a transaction names an account. The chain compares accounts by their bytes and, where account groups exist, after resolving a member to its group. Text forms exist only for humans and tools: the ZBC_ family is base32 of the 32-byte payload plus a 3-byte SHA3-256 checksum that also commits to the 3-letter prefix, and every foreign type is written exactly as its home chain writes it. The rest of the protocol takes from here the byte layout of an address, the equality rule, the hash functions and the encodings, a verifiable random function (an ECVRF over Ed25519 in a ZooBC variant that no RFC 9381 library reproduces, §8) whose output is the block seed, and the keyless pools, the lottery carry among them, where a block's reward waits when nobody may win it (§7). ZBC is never burned: a burn address is still defined by the reference but nothing writes to it (§7). Nothing here depends on block height: the typed-account rule, the one-form rule and the VRF's use as the block seed are rules listed at height 0 in every genesis file, so they are on from genesis on every chain.


1. Integers, byte order and units

Purpose. Fix how numbers are laid out in bytes and what the amount fields count.

Inputs. A number and the field it goes into (a transaction field, a block field, a body field, a hash preimage).

Output and effect. Every multi-byte integer in a ZooBC-defined structure is little-endian, with these widths:

kind width signedness examples
type numbers, lengths, heights, counts 4 bytes uint32 (account type is int32) transaction type, account type prefix, body length, block height
amounts, fees, balances, timestamps, identifiers 8 bytes int64 amount, fee, survival, timestamp (Unix seconds), transaction id, node id
versions, small flags 1 byte uint8 transaction version, split-policy count
two-byte lengths inside signatures and bodies 2 bytes uint16 the public-key length in a Bitcoin-style signature envelope

An amount is a count of atomic units. ONE_ZBC = 100,000,000 atomic units; there is no other scaling anywhere in consensus. Amounts, fees and balances are int64; what happens on overflow is the business of the mechanism that adds them (see 04 and the transaction documents), not of the encoding.

Foreign formats embedded in ZooBC data keep their own conventions: SLIP-10 child indexes and the PBKDF2 block counter are big-endian; Bitcoin transactions use little-endian fields with CompactSize lengths; Ethereum values are big-endian. Each is specified where it is used.

How to compute it. LE32(v) = bytes v & 0xFF, (v >> 8) & 0xFF, (v >> 16) & 0xFF, (v >> 24) & 0xFF. LE64(v) = the eight bytes (v >> 8·i) & 0xFF for i = 0..7. Signed values are the two's-complement bit pattern of the same width. Reading is the inverse; a signed field is reinterpreted from the unsigned pattern.

Rule activation. None.

Rejections and errors. None at this level; a short buffer is a parse failure of the structure being read (03, 05).

Vector (computed). LE32(0x0000000A) = 0A 00 00 00 (the dataset account type prefix); LE64(100000000) = 00 E1 F5 05 00 00 00 00 (one ZBC).

Test cases · §1

2 cases · 2 valid

The dataset account type 10 as LE3201-1-le32-datasetvalid

Loading the test widget…

One ZBC (100,000,000 atomic units) as LE6401-1-le64-one-zbcvalid

Loading the test widget…

Defects to match. None.


2. Hash functions

Purpose. Name every hash the protocol uses and how each is parameterised, so that two implementations never disagree on a digest.

Inputs. A byte string.

Output and effect.

name definition output used for
SHA3-256 FIPS 202 SHA3-256 (Keccak-f[1600], rate 136, domain suffix 0x06) 32 bytes address checksum (§5), transaction hash and signing digest (02, 03), block and receipt hashes (05, 23), group address and multisig address (§7), storage piece ids (11), every other native digest; the VRF input of the block seed, SHA3-256(previous seed) (05 §5)
Keccak-256 the pre-standard Keccak with domain suffix 0x01, same permutation and rate 32 bytes Ethereum and Tron addresses (§6), Ethereum message and transaction hashing (02)
SHA-256 FIPS 180-4 32 bytes base58check, Bitcoin signature hashing, BIP-39 checksum
double SHA-256 SHA256(SHA256(x)) 32 bytes base58check checksum, Bitcoin sighash
SHA-512 FIPS 180-4 64 bytes the VRF (§8): hash-to-curve candidates, challenge, nonce and output; inside Ed25519 (RFC 8032)
RIPEMD-160 ISO/IEC 10118-3 RIPEMD-160 20 bytes HASH160
HASH160 RIPEMD160(SHA256(x)) 20 bytes Bitcoin and Ripple payloads (§6)
BLAKE2b-n BLAKE2b, unkeyed, with the digest length parameter set to n bytes n bytes n = 20: Tezos payload; n = 28: Cardano payload (§6); n = 64: SS58 checksum (§3)
HMAC-SHA512, PBKDF2-HMAC-SHA512 RFC 2104 / RFC 8018 64 bytes key derivation only (02), never consensus

The BLAKE2b digest length is a parameter of the function (it enters the parameter block), not a truncation: BLAKE2b-20(x) is not the first 20 bytes of BLAKE2b-64(x). SHA3-256 and Keccak-256 differ only in the padding byte; an implementation that offers only one must implement the other itself.

Tagged seed streams. Every consumer of a block seed hashes it under its own ASCII tag, so no two consensus samples share a stream: zbc-blocksmith (the blocksmith draw), zbc-receipt (the receipt peers), zbc-receipt-datum (the receipt datum sampler), zbc-topology-v2 (the topology scramble), zbc-coinbase (the coinbase lottery) and zbc-apps (the apps draws). The exact preimages and generators are in 20 §1, 23 and 16. The use of zbc-receipt-datum and zbc-apps is governed by rules receipt_datum_prefix and apps_seed_prefix, active from height 0 on every chain.

How to compute it. Use the standard algorithms. For Keccak-256 with a library that offers only SHA3-256: absorb 136-byte blocks; pad the last partial block with 0x01 at the first free byte and XOR 0x80 into byte 135; squeeze 32 bytes.

Rule activation. None for the functions. The two seed tags above: rules receipt_datum_prefix and apps_seed_prefix, at 0 on every chain.

Rejections and errors. None.

Vector (computed, standard values). SHA3-256("") = a7ffc6f8bf1ed76651c14756a061d662f580ff4de43b49fa82d80a4b80f8434a; Keccak-256("") = c5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470; HASH160 of the 33-byte key 02 50863ad64a87ae8a2fe83c1af1a8403cb53f53e486d8511dad8a04887e5b2352 = f54a5851e9372b87810a8e60cdd2e7cfd80b6e31 (the Bitcoin wiki example, 1PMycacnJaSqwwJqjawXBErnLsZ7RkXUAs); SHA-512("") = cf83e1357eefb8bdf1542850d66d8007d620e4050b5715dc83f4a921d36ce9ce47d0d13c5d85f2b0ff8318d2877eec2f63b931bd47417a81a538327af927da3e.

Test cases · §2

5 cases · 5 valid

SHA3-256 of the empty string01-2-sha3-emptyvalid

Loading the test widget…

Keccak-256 of the empty string01-2-keccak-emptyvalid

Loading the test widget…

SHA-512 of the empty string01-2-sha512-emptyvalid

Loading the test widget…

HASH160 of a compressed key (the Bitcoin wiki example)01-2-hash160valid

Loading the test widget…

The same HASH160 read back from its P2PKH address01-2-hash160-addressvalid

Loading the test widget…

Defects to match. None.


3. Text encodings

Purpose. Fix the alphabets and checksums of every text form an address can take.

Inputs. Bytes to encode, or text to decode.

Output and effect.

encoding alphabet rule
hex 0-9 a-f A-F; two characters per byte; input accepts either case; the reference emits upper case for account addresses in its API (observed) and lower case elsewhere a hex string of odd length is invalid
base32 RFC 4648: ABCDEFGHIJKLMNOPQRSTUVWXYZ234567, value = index; no padding characters are ever written or accepted 5 bits per character, most significant first; 35 bytes ↔ 56 characters exactly
base58 (Bitcoin) 123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz big-endian base conversion; each leading 0x00 byte ↔ one leading 1
base58 (Ripple) rpshnaf39wBUDNEGHJKLM4PQRST7VWXYZ2bcdeCg65jkm8oFqi1tuvAxyz the same arithmetic with the symbols permuted; the reference transliterates to the Bitcoin alphabet position by position and decodes with the Bitcoin decoder
base58check base58 of payload ‖ SHA256(SHA256(payload))[0..4] the four checksum bytes must match on decode
bech32 / bech32m BIP-173 / BIP-350: qpzry9x8gf2tvdw0s3jn54khce6mua7l; hrp ‖ "1" ‖ data ‖ 6-character checksum; polymod constant 1 (bech32) or 0x2BC830A3 (bech32m) mixed case is invalid; total length 14..90 for the Bitcoin decoder, up to 1023 for the plain decoder; the last 1 separates hrp and data
SS58 base58 of prefix(1) ‖ AccountId(32) ‖ checksum(2) with checksum = BLAKE2b-64("SS58PRE" ‖ prefix ‖ AccountId)[0..2] only the single-byte prefix form (prefix ≤ 63, bit 6 clear) is accepted: 35 decoded bytes exactly

How to compute it. Standard algorithms; base58 is plain big-endian base conversion (byte-wise long division gives the same result). For bech32 the checksum is verified by expanding the hrp (c >> 5 for each character, a 0, then c & 31 for each character), appending the data values and running the BIP-173 polymod; the Bitcoin SegWit decoder accepts hrp bc, tb and bcrt only, requires a witness version 0..16 in the first data value, converts the rest from 5 to 8 bits with no padding allowed, requires bech32 for version 0 and bech32m for version ≥ 1, and requires a program of 2..40 bytes, which for version 0 must be 20 or 32 bytes. The plain decoder used for Cardano accepts any hrp, the bech32 constant only, and converts the whole data part to bytes.

Rule activation. None.

Rejections and errors. A character outside the alphabet, a failed checksum, a bech32 string with mixed case, an SS58 string whose first decoded byte has bit 0x40 set (two-byte prefix) or whose length is not 35 bytes: all are decode failures. Nothing in consensus ever decodes text; these failures are seen by tools, wallets and the HTTP API.

Vector (computed, cross-checked against the reference test inputs). base58check 1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa → payload 00 62e907b15cbf27d5425399ebf6f0fb50ebb88f18; bech32 bc1q02eahpuu87g85zka8eapmwzc0rv56yw2s226c4 → hrp bc, version 0, program 7ab3db879c3f907a0add3e7a1db85878d94d11ca; SS58 14j6ekb87LG6TgqexArYBTLsemPXshEzEkdWaufm95Sw3u2L ↔ prefix 0, AccountId a4d007a95b28ce117e4051904503612abdcbd22b60475121f92a8b5dedac375a (from the reference's SS58 test, taken from @polkadot/util-crypto).

Test cases · §3

5 cases · 3 valid · 2 invalid

Decode a base58check string01-3-base58checkvalid

Loading the test widget…

Decode a bech32 SegWit address01-3-bech32valid

Loading the test widget…

Decode an SS58 address and encode it again01-3-ss58valid

Loading the test widget…

A bech32 string in mixed case is refused01-3-bech32-mixed-caseinvalid

Loading the test widget…

An SS58 string whose first byte has bit 0x40 set is refused01-3-ss58-two-byte-prefixinvalid

Loading the test widget…

Defects to match. None.


4. The account address (byte form)

Purpose. Define the bytes that identify an account everywhere in consensus: in transactions, in state, in receipts, in genesis.

Inputs. An account type and a payload; or address bytes to classify.

Output and effect. An account address is

offset length field encoding
0 4 account_type int32 little-endian
4 n payload by type, table below

The types that exist, with the payload each carries, the payload length a reader of a fixed layout takes for it (§4.1), and the lengths the embedded-address check accepts (§4.2):

type name payload fixed-layout length accepted lengths of the whole address can sign (02) text form (§5, §6)
0 ZooBC Ed25519 public key, or a 32-byte hash for keyless accounts (§7) 32 36 yes (Ed25519) ZBC_ …
1 Bitcoin, legacy HASH160 20 24, 37, 69 yes, Bitcoin envelope none produced; 02 verifies it like type 5
2 Empty nothing; the 4 bytes 02 00 00 00 mean "no recipient" 0 never valid as an account no none
3 Estonia eID reserved, 32 bytes 32 36 no verifier exists none
4 Ethereum last 20 bytes of Keccak-256(uncompressed public key without its 0x04 byte) 20 24, 68 yes (secp256k1, recoverable) 0x + 40 hex
5 Bitcoin P2PKH HASH160(public key) 20 24, 37, 69 yes base58check version 0x00 (1…)
6 Bitcoin P2SH HASH160(redeem script); the verifier assumes the script 00 14 ‖ HASH160(public key) 20 24 yes base58check version 0x05 (3…)
7 Bitcoin P2WPKH witness v0 program = HASH160(public key) 20 24, 37, 69 yes bech32 bc1q… (42 characters)
8 Bitcoin P2WSH witness v0 program, 32 bytes 32 36 no bech32 bc1q… (62 characters)
9 Bitcoin Taproot witness v1 program = x-only output key 32 36 yes (BIP-340 Schnorr) bech32m bc1p…
10 DataSet object SHA3-256 hash of the transaction that created the object (§7) 32 36 no ZBS_ …
11 Solana Ed25519 public key 32 36 yes (Ed25519, verified exactly like type 0) base58, 32–44 characters, no checksum
12 Polkadot AccountId (sr25519 public key) 32 36 yes (sr25519) SS58, prefix 0
13 Cardano BLAKE2b-28(Ed25519 public key) 28 32 yes (Ed25519, key carried in the signature) bech32 hrp addr over 0x61 ‖ payload
14 Ripple HASH160(secp256k1 public key) 20 24 yes (as type 5) base58check, Ripple alphabet, version 0x00 (r…)
15 Tron last 20 bytes of Keccak-256(public key) 20 24, 68 yes (as type 4) base58check version 0x41 (T…)
16 Tezos BLAKE2b-20(Ed25519 public key) 20 24 yes (Ed25519, key carried in the signature) base58check prefix 06 a1 9f (tz1…)
other unknown — 32 (the reader's default) rejected by the embedded-address check treated as type 0 by the verifier none

The types that can sign (the column above) form one list used wherever the protocol asks whether an account can act or receive: 0, 1, 4, 5, 6, 7, 9, 11, 12, 13, 14, 15, 16. Types 2, 3, 8, 10 and every unknown type cannot sign.

Three consequences an implementation must reproduce:

  1. Accounts are typed; a bare 32-byte key is not an account. A bare key is an address of exactly 32 bytes whose first four bytes are not 0D 00 00 00 (a 32-byte address that starts with the Cardano type 13 is the typed Cardano account, 4 + 28). A bare key is a node key (the node_public_key fields, ZNK_ text, gateway and relay keys), never an account: a transaction whose sender or recipient is a bare key is refused with the text accounts are typed: a bare 32-byte key is not an account on this chain (03), the embedded-address check of §4.2 refuses it with the same text, and a bare key "cannot sign" in the list above. The account of a node is its typed node-key account 00 00 00 00 ‖ node key (§7); reading the node key back from an account takes the last 32 bytes of a 36-byte type-0 address and nothing else.
  2. Account identity is byte identity. Two addresses are the same account when their bytes are equal, or, where account groups exist, when the accounts that hold their balances (the group account for a member, 18) are equal. No form is an alias of another: 00 00 00 00 ‖ K and the 32 bytes K are not the same account (the second is not an account at all). Case, text form and separators never matter because consensus never sees text.
  3. The payload length is read from the type. Wherever an address sits in a fixed layout (transaction sender and recipient, bodies that embed addresses without a length byte), the reader takes 4 bytes of type and then exactly the fixed-layout length of §4.1 for that type. An unknown type reads 32 bytes.
  4. One account form per type: the full-key forms are not accounts. For types 4 and 15 the account is LE32(type) ‖ the 20 Keccak bytes (24 bytes); for types 1, 5 and 7 it is LE32(type) ‖ the 20 HASH160 bytes (24 bytes). The full-key forms, LE32(4 or 15) ‖ the 64-byte public key (68 bytes) and LE32(1, 5 or 7) ‖ the 33- or 65-byte public key (37 or 69 bytes), pass the shape check of §4.2, but the transaction bytes carry only the 20-byte form of these types (§4.1), so no transaction can ever be sent from one and whatever reaches it would be stranded. Rule canonical_account_forms refuses a full-key form wherever a transaction names an account, at admission and in a block, with the text 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), usually after a prefix that names the field. The sites: the envelope's sender, recipient and escrow approver (03 §3); the recipients of SendZBCBatch and TransferTokenBatch (08, 14); SetSplitPolicy entries (08); CreateSwapOffer's counterparty (15); CreateApp's invited opponent (16); LinkAccount's member, SetMemberPermissions' member, TransferGroupControl's new controller and each participant of a kind-1 consent (18); TransferDataset's new owner (10); ReleaseAuthorityPropose's authority, a release-authority event's authority and RegisterRelease's release address (17); StoreFile's allow list (11); EscrowRequest's parties (12); a bridge deposit's recipient (34). The recipient types that cannot hold spendable funds (03 §3) include the full-key forms. UnlinkAccount is not refused, so a member stored in a full-key form can leave its group.

4.1 Fixed-layout payload length by type

types payload bytes
0, 3, 11, 12 32
1, 5, 6, 7, 4, 14, 15, 16 20
8, 9 32
13 28
any other value 32

4.2 Well-formedness of an embedded address

Where a body carries an address with its own length (split-policy recipients, schedule recipients, group members, dataset parties), the address is checked for shape, in this order: empty is invalid (Empty account address); a bare key (32 bytes, first four bytes not 0D 00 00 00) is invalid (accounts are typed: a bare 32-byte key is not an account on this chain); shorter than 4 bytes is invalid; otherwise the whole address must have one of the accepted lengths in the table above for its type (Invalid account address size), and type 2 and any unknown type are invalid. The 37- and 69-byte Bitcoin forms and the 68-byte Ethereum and Tron forms (type ‖ full public key) pass this check; they cannot be produced by a fixed-layout read and the reference's text decoder never produces them, so an implementation meets them only in a body that carries an address with its own length or in a named field of the wire forms (03 §10), and there consequence 4 refuses them right after this shape check.

How to compute it. Build: LE32(type) ‖ payload. Classify: if the address is 32 bytes and its first four bytes are not 0D 00 00 00, it is a bare key (not an account); otherwise read LE32 at offset 0 and take the payload as the rest. Compare: bytes, then group resolution.

Rule activation. Rule typed_accounts_only, active from height 0 on every chain: a bare key is never an account. Rule canonical_account_forms, active from height 0 on every chain: a full-key form is never an account (consequence 4).

Rejections and errors. As in §4.2. A transaction whose sender or recipient is a bare key is refused at admission and makes a block invalid (03). A transaction naming a full-key form at any site of consequence 4 is refused at admission and makes a block invalid, with the full-key text. A transaction whose sender address has an unknown type is not rejected by the address rules themselves; it fails signature verification (02) because the verifier treats the payload as an Ed25519 key.

Vector (computed from the TestNet genesis file, 06 §1: the nodes[] entry with node key ZNK_AKSQOGOA_…_FSRL4CNJ and owner ZBC_XTFYBAQN_…_WTLOGT6O). The node registered at genesis with node key 02A50719…2CA2 has the owner account 00000000BCCB80820D3E3FCE6E62F1C283ACF6B0AB884A937AF47120DE2FFE88A393B4D6, type 0 with payload BCCB8082…B4D6 (the owner's Ed25519 key); its text form is in §5. The 32 bytes BCCB8082…B4D6 alone are not an account. Invalid input: the embedded address BCCB80820D3E3FCE6E62F1C283ACF6B0AB884A937AF47120DE2FFE88A393B4D6 (32 bytes) → refused accounts are typed: a bare 32-byte key is not an account on this chain; the 32 bytes 0D000000 ‖ 28 bytes are the typed Cardano account and pass. Full-key forms (computed; the secp256k1 key with private scalar 1, whose public key is the curve's generator): the Ethereum account is 04000000 7E5F4552091A69125D5DFCB7B8C2659029395BDF (24 bytes) and passes; its full-key form 04000000 79BE667EF9DCBBAC55A06295CE870B07029BFCDB2DCE28D959F2815B16F81798 483ADA7726A3C4655DA4FBFC0E1108A8FD17B448A68554199C47D08FFB10D4B8 (68 bytes, spaces for reading only) passes the §4.2 shape check and, as a SetSplitPolicy entry, is refused 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); the P2PKH account of the same key is 05000000 751E76E8199196D454941C45D1B3A323F1433BD6 and its 37-byte full-key form 05000000 0279BE667EF9DCBBAC55A06295CE870B07029BFCDB2DCE28D959F2815B16F81798 is refused the same way. The empty recipient is 02000000. A dataset object created by a transaction whose hash is H has the address 0A000000 ‖ H (computed; the reference's dataset test builds exactly this).

Test cases · §4

14 cases · 10 valid · 4 invalid · 2 reference

The owner account of a genesis registered node of the TestNet genesis file01-4-owner-accountvalidreference

The nodes[] entry with node key ZNK_AKSQOGOA_…_FSRL4CNJ and owner ZBC_XTFYBAQN_…_WTLOGT6O; §5 decodes both texts.

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

node_key
02A50719C01D3B81030D5BB866B25E69F15668DE15160BA51B43CD0C1B352CA2
owner_account
00000000BCCB80820D3E3FCE6E62F1C283ACF6B0AB884A937AF47120DE2FFE88A393B4D6
type
0
payload
BCCB80820D3E3FCE6E62F1C283ACF6B0AB884A937AF47120DE2FFE88A393B4D6
A typed native account passes the embedded-address check01-4-typed-accountvalid

Loading the test widget…

A bare 32-byte key is not an account01-4-bare-keyinvalid

Loading the test widget…

A 32-byte address of type 13 is the typed Cardano account01-4-cardano-32valid

Loading the test widget…

The Ethereum account of the key with scalar 1 is 24 bytes and passes01-4-eth-accountvalid

Loading the test widget…

Its 68-byte full-key form passes the shape check01-4-eth-full-key-shapevalid

Loading the test widget…

The 24-byte Ethereum account as a SetSplitPolicy entry is accepted01-4-eth-split-entryvalid

Loading the test widget…

The 68-byte full-key form as a SetSplitPolicy entry is refused01-4-eth-full-key-splitinvalid

Loading the test widget…

The P2PKH account of the same key passes01-4-p2pkh-accountvalid

Loading the test widget…

Its 37-byte full-key form passes the shape check01-4-p2pkh-full-key-shapevalid

Loading the test widget…

The 37-byte full-key form as a SetSplitPolicy entry is refused01-4-p2pkh-full-key-splitinvalid

Loading the test widget…

The empty recipient is the four bytes 0200000001-4-empty-recipientvalidreference

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

value
02000000
The empty type is never valid as an account01-4-empty-not-accountinvalid

Loading the test widget…

The address of a dataset object created by a transaction01-4-dataset-addressvalid

Loading the test widget…

Defects to match. Type 11 (Solana) and any unknown type are verified as type 0 by the signature dispatcher (02 §2); type 1 is still accepted everywhere a Bitcoin account is.


5. The ZooBC text address (ZBC_ family)

Purpose. The human form of a 32-byte payload under a 3-letter role prefix, with a checksum that detects a mistyped character and a swapped prefix.

Inputs. Encode: a 32-byte payload and a 3-character ASCII prefix. Decode: a string.

Output and effect. Encoding produces 66 characters: the prefix, _, and seven groups of eight base32 characters separated by _. Decoding yields the 32-byte payload and fails on any error; the type of the account is not in the string, it is chosen by the caller from the prefix (ZBS → type 10, every other prefix → type 0 in the reference's generic decoder). Prefixes in use:

prefix meaning the 32 bytes are
ZBC account (type 0) an Ed25519 public key, or a keyless hash (§7)
ZNK node key the node's Ed25519 public key; the node's own account is the ZBC form of the same key
ZBR relay key a relay's Ed25519 public key (17)
ZBG gateway key a gateway's Ed25519 public key (17)
ZBS dataset object address (type 10) the creating transaction's hash

The same 32 bytes under two prefixes share the first 51 of the 56 base32 characters and differ in the last five, because the checksum commits to the prefix.

How to compute it.

Encode:

  1. buffer = payload(32) ‖ prefix(3 ASCII bytes, as given); refuse unless the payload is exactly 32 bytes and the prefix exactly 3 characters.
  2. c = SHA3-256(buffer)[0..3].
  3. b = payload ‖ c (35 bytes).
  4. s = base32(b) (56 characters, no padding).
  5. Text = prefix ‖ "_" ‖ s[0..8] ‖ "_" ‖ s[8..16] ‖ … ‖ "_" ‖ s[48..56].

Decode:

  1. Remove every _, every - and every ASCII white-space character (space, tab, LF, VT, FF, CR) anywhere in the string; upper-case what remains. This is the significant-character rule: only the 3 prefix letters and the 56 base32 characters matter, so ZBC_…, ZBC-…, mixed separators, no separators, lower case and a line-wrapped paste are all the same address.
  2. Fewer than 3 characters: invalid. prefix = first 3 characters; body = the rest.
  3. body must be exactly 56 characters of the base32 alphabet; decode it to 35 bytes.
  4. payload = bytes[0..32], given = bytes[32..35].
  5. Recompute SHA3-256(payload ‖ prefix)[0..3] with the upper-cased prefix and require equality with given.
  6. Output payload.

Shape test (used before decoding to decide whether a string is "a ZBC-family address at all"): after trimming leading white space, the character at index 3 is _ or -; or the significant form is exactly 59 characters whose last 56 are base32. The generic decoder admits the bare 59-character form only for prefixes ZBC and ZBS.

Rule activation. None.

Rejections and errors. Too short; body not 56 characters ("Invalid address encoding"); a character outside A–Z 2–7 after normalisation; checksum mismatch ("Address checksum validation failed"). A prefix other than the five above is not refused by the codec: a string whose checksum was computed for that prefix decodes, and the generic decoder then types it as a type-0 account.

Vector (computed: the node key and owner account of one nodes[] entry of the TestNet genesis file, decoded and re-encoded independently).

bytes prefix text
02A50719C01D3B81030D5BB866B25E69F15668DE15160BA51B43CD0C1B352CA2 ZNK ZNK_AKSQOGOA_DU5YCAYN_LO4GNMS6_NHYVM2G6_CULAXJI3_IPGQYGZV_FSRL4CNJ
BCCB80820D3E3FCE6E62F1C283ACF6B0AB884A937AF47120DE2FFE88A393B4D6 ZBC ZBC_XTFYBAQN_HY7443TC_6HBIHLHW_WCVYQSUT_PL2HCIG6_F77IRI4T_WTLOGT6O

Computed for the first key under the other prefixes: ZBC_AKSQOGOA_DU5YCAYN_LO4GNMS6_NHYVM2G6_CULAXJI3_IPGQYGZV_FSRJHN6I, ZBR_…_FSRO5OMX, ZBG_…_FSRDECTN, ZBS_…_FSRPF6RU (same first 51 characters). Computed: ZBC_IAZLCULM_GCLXBEHJ_57RXQLN2_3ID2JCSO_UH7EP226_YUBX75PU_CY4EHQGN decodes to payload 4032b1516c30977090e9efe3782dbada07a48a4ea1fe47eb5ec5037ff5f41638 with checksum 43c0cd. Normalisation: input znk-aksqogoa-du5ycayn-lo4gnms6-nhyvm2g6-culaxji3-ipgqygzv-fsrl4cnj → expected output payload 02A50719C01D3B81030D5BB866B25E69F15668DE15160BA51B43CD0C1B352CA2, prefix ZNK. Invalid input: ZNK_AKSQOGOA_DU5YCAYN_LO4GNMS6_NHYVM2G6_CULAXJI3_IPGQYGZV_FSRL4CNK (last character changed): the carried checksum is be09aa, the recomputed one be09a9 → refused "Address checksum validation failed". The reference's own example: ZBC_UGQPUJBG_GHSRLK5Y_NIMS6HZ5_RXA3B4IA_SC2TEMNT_KPUGL36W_TKTE7GZ5.

Test cases · §5

10 cases · 9 valid · 1 invalid

Node key as a ZNK address01-5-znk-encodevalid

Loading the test widget…

Owner key as a ZBC address01-5-zbc-encodevalid

Loading the test widget…

The checksum binds the prefix: ZBC01-5-zbc-prefixvalid

Loading the test widget…

The checksum binds the prefix: ZBR01-5-zbr-prefixvalid

Loading the test widget…

The checksum binds the prefix: ZBG01-5-zbg-prefixvalid

Loading the test widget…

The checksum binds the prefix: ZBS01-5-zbs-prefixvalid

Loading the test widget…

Decode a ZBC address01-5-decodevalid

Loading the test widget…

Lower case and dashes are read as the same address01-5-normalisevalid

Loading the test widget…

A changed last character is refused01-5-bad-checksuminvalid

Loading the test widget…

The reference's own example address decodes01-5-reference-examplevalid

Loading the test widget…

Defects to match. None. (The checksum is the 3-byte SHA3-256 prefix above; a 1-byte additive checksum or a Reed-Solomon code met in older ZooBC material is not part of the format.)


6. Foreign text forms

Purpose. Turn the address string of a foreign chain into the account bytes of §4 and back, and define how each foreign payload is derived from a key.

Inputs. A string (decode), or a public key (derive).

Output and effect. The generic decoder below is what the node's HTTP API and the command-line tools use; it never guesses between two chains, it disambiguates by checksum. With no chain hint it tries, in this order, and returns at the first match:

step matches when result
1 trimmed string empty error
2 42 characters, 0x/0X + 40 hex type 4, the 20 bytes
3 the ZBC-family shape test of §5 §5 decode; type 10 if the prefix is ZBS, else type 0
4 starts with bc1, tb1 or bcrt1 (case-blind) SegWit decode: v0 + 20 bytes → type 7; v0 + 32 → type 8; v1 + 32 → type 9; anything else → error (no fall-through)
5 starts with 1 or 3, 26..35 characters, base58-decodes to 25 bytes with a valid base58check version 0x00 → type 5; 0x05 → type 6; other versions fall through
6 starts with addr1/ADDR1 plain bech32 with hrp addr, 29 bytes, first byte 0x61 → type 13 with the 28 remaining bytes; else error
7 starts with T, 34 characters base58check, 21 bytes, version 0x41 → type 15; else error
8 starts with r, 25..35 characters Ripple-alphabet base58check, 21 bytes, version 0x00 → type 14; else error
9 starts with tz1 base58check, 23 bytes, prefix 06 a1 9f → type 16 with the 20 remaining bytes; else error
10 valid SS58 (35 bytes, good checksum) type 12 with the 32-byte AccountId
11 32..44 characters of base58 decoding to exactly 32 bytes type 11
12 64 hex characters type 0 with those 32 bytes
13 otherwise error "unrecognised address"

A chain hint (ethereum, solana, polkadot, zoobc/dataset) forces that reading. A hint of Bitcoin, Cardano, Ripple, Tron or Tezos is a check, not a reading: the auto path above decodes the string, and when it reads as another chain the string is refused ("not a Tron address: it reads as Ethereum", the hinted chain's name and the detected type's name), never typed as the hint; a Taproot, P2SH, P2WPKH or P2WSH string counts as Bitcoin. An older Bitcoin-only decoder the reference keeps for one path additionally accepts the testnet versions 0x6F (→ type 5) and 0xC4 (→ type 6); the generic decoder does not.

Payload derivation from a key (what an implementation generating addresses must do):

type from payload
0, 11 Ed25519 public key (32) the key
12 sr25519 public key (32) the key (AccountId)
4 secp256k1 public key, uncompressed, without the 0x04 byte (64) Keccak-256(key)[12..32]
15 same as type 4 same; written with version byte 0x41
5, 7 secp256k1 public key as the signer presents it (33 compressed in practice) HASH160(key)
14 same HASH160(key), written in the Ripple alphabet with version 0x00
6 the public key behind a P2SH-P2WPKH script HASH160(00 14 ‖ HASH160(key))
9 the BIP-341 output key (the wallet applies the Taproot tweak) the 32-byte x-only key
13 Ed25519 public key (32) BLAKE2b-28(key)
16 Ed25519 public key (32) BLAKE2b-20(key)

Text output for display (non-consensus): Ethereum as 0x + EIP-55 mixed-case hex (the reference computes Keccak-256 of the lower-case hex and upper-cases a letter whose nibble is ≥ 8); Bitcoin P2PKH as base58check with version 0x00; the others as their home chain writes them. The reference never checks EIP-55 case on input.

How to compute it. Follow the table; each step uses the encodings of §3. Trim leading and trailing space, tab, CR and LF first.

Rule activation. None.

Rejections and errors. As in the table. The reference's error strings are visible only to tools and API callers; an implementation may use its own.

Vector (computed; the reference's own address-decoding tests accept every string below with the type shown). Input: the string; expected output: the type and payload.

string type payload (hex)
0xA4cB4CF242Cf8d309E7f7CF1587C50b410f5e7e0 4 a4cb4cf242cf8d309e7f7cf1587c50b410f5e7e0
1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa 5 62e907b15cbf27d5425399ebf6f0fb50ebb88f18
3J98t1WpEZ73CNmQviecrnyiWrnqRhWNLy 6 b472a266d0bd89c13706a4132ccfb16f7c3b9fcb
bc1q02eahpuu87g85zka8eapmwzc0rv56yw2s226c4 7 7ab3db879c3f907a0add3e7a1db85878d94d11ca
bc1qrp33g0q5c5txsp9arysrx4k6zdkfs4nce4xj0gdcccefvpysxf3qccfmv3 8 1863143c14c5166804bd19203356da136c985678cd4d27a1b8c6329604903262
bc1p5cyxnuxmeuwuvkwfem96lqzszd02n6xdcjrs20cac6yqjjwudpxqkedrcr 9 a60869f0dbcf1dc659c9cecbaf8050135ea9e8cdc487053f1dc6880949dc684c
3vwz9YRK4Fo552oeyuGw2eg3Qadu8ugLnvbeyCYDqjqA 11 2b89542cc4374dd4ccce06d1515d539e71f55bed9e830f89fd289e6dc4562b31
15i8e3H9oBQirsfB4W3L3Rz8VUoceR6pmE8AnzNP9qRzcZTj 12 d04fb590a92b2c6c505f297fc94b8650c74e85a3ca8a1d32d6a297578f7b9e7a
addr1vyk0hphgx0ryme02yfnxxjtrk9ge570dxrxlydmqmkkaggsc9grvy 13 2cfb86e833c64de5ea2266634963b1519a79ed30cdf23760ddadd422
rBmafvpgPvyExLTSt66FHpBCc1baPxqniG 14 7607d55d98d18578c275d413da80a77d529a3693
TKTyfw5wP5zq5vtkBdBm8BVVHxfX9p6FvB 15 682a115d32d5f6c7c0ac3d74c48099a8d83526f4
tz1LDovuWKLjJ8FU5cv3t28TdXw43xwrTEh9 16 06637d4106c1cf38fcbf31313c7b09bee9818c5b

The Polkadot string starts with 1 and the Solana string with 3; both fail base58check at step 5 and are read correctly at steps 10 and 11. 1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNb (last character changed) is refused. With the Tron hint, 0xA4cB4CF242Cf8d309E7f7CF1587C50b410f5e7e0 → refused "not a Tron address: it reads as Ethereum"; with the Bitcoin hint, bc1p5cyx…edrcr → type 9 as in the table.

Test cases · §6

15 cases · 13 valid · 2 invalid

Foreign address: type 401-6-ethvalid

Loading the test widget…

Foreign address: type 501-6-p2pkhvalid

Loading the test widget…

Foreign address: type 601-6-p2shvalid

Loading the test widget…

Foreign address: type 701-6-p2wpkhvalid

Loading the test widget…

Foreign address: type 801-6-p2wshvalid

Loading the test widget…

Foreign address: type 901-6-taprootvalid

Loading the test widget…

Foreign address: type 1101-6-solanavalid

Loading the test widget…

Foreign address: type 1201-6-polkadotvalid

Loading the test widget…

Foreign address: type 1301-6-cardanovalid

Loading the test widget…

Foreign address: type 1401-6-ripplevalid

Loading the test widget…

Foreign address: type 1501-6-tronvalid

Loading the test widget…

Foreign address: type 1601-6-tezosvalid

Loading the test widget…

A changed base58check character is refused01-6-bad-base58invalid

Loading the test widget…

With the Tron hint an Ethereum string is refused, never typed as Tron01-6-hint-tron-ethinvalid

Loading the test widget…

With the Bitcoin hint a Taproot string reads as type 901-6-hint-bitcoin-taprootvalid

Loading the test widget…

Defects to match. (a) The two Bitcoin decoders differ on testnet version bytes (above). (b) A 64-hex string is read as a type-0 account even when it is the hex of some other 32-byte payload; callers that mean another type must pass a hint.


7. Keyless and derived addresses

Purpose. Define every address that is not the encoding of a key: the protocol's own pools, the lottery carry, the (unused) burn address, the group account, the dataset object, the multi-signature account, and the node's account.

Inputs. The seed named in each row.

Output and effect.

address type payload (32 bytes) holds
node account (typed node-key account) 0 the node's Ed25519 public key an ordinary account whose key the operator holds, 00 00 00 00 ‖ node key; it is the sender of the node's duties (QueueAttendance, SubmitStorageProof, SubmitStorageProofBatch, AttestEvent, SetConsensusParam, FeeVoteCommitment, FeeVoteReveal, EquivocationReport, RollCall), always in this typed form (the bare node key is not an account, §4). An active node's fee-free duties declare a fee of exactly 0 and must come from this account (04), so it needs no balance and not even a balance row for them (a node admitted after genesis has none until someone funds it); a queued node's attendance is paid from its stake (09)
longevity node pool 0 "ZBCLONGV" ‖ 24 × 0x00 everything the protocol takes and owes to nobody in particular, since ZBC is never burned: account, dataset and longevity rent, early-ended survival balances, the 10 % lock shares (event 76), fees paid out of a lock (event 80), a pruned account's or dissolved group's balance and prepaid storage, a closed longevity record's remainder, an unstarted app's kept share (event 84); paid out per block through the coinbase lottery, and a share per storage epoch to the archive's provers (09, 11, 13, 16, 21)
storage reward pool 0 "ZBCSTORE" ‖ 24 × 0x00 stored-file rent, paid out to proving holders (11, 22)
apps pool 0 "ZBCAPPS" ‖ 25 × 0x00 the apps rake and house edge (16)
lottery carry 0 "ZBCCARRY" ‖ 24 × 0x00 a block's reward (coinbase, fees, longevity slice, the taker fee of a blocksmith that earns nothing) that no ticket holder may take, and block 1's fees; the next block whose lottery has a ticket holder takes it all in. Event 75 rows, + on the carry when it waits, − when it is taken (21)
burn address (defined, unused) 0 32 × 0xFF nothing: it never has a balance row and nothing writes a ledger row on it. Event 74 (EVENT_TYPE_BURN) is defined but no code writes it: ZBC is never burned, so ZBC's burned total is zero (the API's burned_total reads 0). Burning a wrapper coin or a user token lowers that coin's own supply (14, 34) and writes no row here
group account 0 SHA3-256("ZBC-GROUP" ‖ link_tx_hash) where link_tx_hash is the 32-byte hash of the founding LinkAccount transaction the pooled balance and everything the group owns (18)
dataset object 10 the 32-byte hash of the transaction that created the object (for a file entry, the entry's recorded creating_tx_hash) the object's prepaid storage deposit (10)
multi-signature account 0 SHA3-256(LE32(minimum_signatures) ‖ LE64(nonce) ‖ LE32(count) ‖ participant addresses sorted byte-wise ascending and concatenated) a balance spent by a threshold of the participants (12)

The multi-signature account is the typed address 00 00 00 00 ‖ hash: it is the sender of the inner transaction a threshold of participants completes, and a sender must be typed like any other (§4). The reference keys the multi-signature configuration by the raw 32-byte hash and strips the type prefix of a 36-byte type-0 inner sender to find it (12). The participant addresses are hashed in the typed form they are carried in (12 §9 recomputes a multisignature address from its participants as carried, one of them Ethereum-typed). No key exists for a pool, a group or a dataset address: a transaction whose sender is one of them can never carry a valid signature, so they are spent only by the protocol rules that name them. The longevity pool, the storage pool and the lottery carry are the three system pools: they never pay account rent and are never pruned (13), and none may join a group (18); the apps pool is not one of them (Defects (a)). The burn address is not even a point: its 32 bytes are a non-canonical encoding (the y value 2²⁵⁵ − 1 is not below p = 2²⁵⁵ − 19), which the Ed25519 verifier refuses for every signature (02 §3.1) and the VRF's point check refuses too (§8).

How to compute it. Build the payload as in the table and prepend LE32(type). ASCII bytes: "ZBCLONGV" = 5A 42 43 4C 4F 4E 47 56, "ZBCSTORE" = 5A 42 43 53 54 4F 52 45, "ZBCAPPS" = 5A 42 43 41 50 50 53, "ZBCCARRY" = 5A 42 43 43 41 52 52 59. The burn address is LE32(0) ‖ FF × 32.

Rule activation. None for the addresses themselves (what flows into them is gated; see the documents named in the table). ZBC is never burned at any height: the 10 % lock shares, pruned dust and a queued node's attendance fee all go to the longevity pool (09, 13).

Rejections and errors. None.

Vector (computed). All five are 36 bytes:

pool hex
longevity 000000005A42434C4F4E4756000000000000000000000000000000000000000000000000
storage 000000005A424353544F5245000000000000000000000000000000000000000000000000
apps 000000005A42434150505300000000000000000000000000000000000000000000000000
lottery carry 000000005A42434341525259000000000000000000000000000000000000000000000000
burn 00000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF

Test cases · §7

5 cases · 5 valid

The longevity node pool01-7-longevityvalid

Loading the test widget…

The storage reward pool01-7-storagevalid

Loading the test widget…

The apps pool01-7-appsvalid

Loading the test widget…

The lottery carry01-7-carryvalid

Loading the test widget…

The burn address01-7-burnvalid

Loading the test widget…

Defects to match. (a) The system pools (the set that may not join a group, 18) are the longevity pool, the storage pool and the lottery carry only; the apps pool is not one. The rent-exempt set (13) is wider: those three, the apps pool and every ZBS_ deposit address (account type 10, a dataset's or a DFS file's) are never on the rent clock. (b) None other: the group address is always derived from the founding transaction's hash (03 §9).


8. The verifiable random function (ECVRF, ZooBC variant)

Purpose. A function of a node key and an input whose 64-byte output anyone can check from an 80-byte proof, with exactly one output per (key, input), so the key holder cannot choose among outputs. Its one use is the block seed (05 §5, 20).

Inputs.

  • Prove: the node's 32-byte Ed25519 seed (the reference takes the 64-byte secret seed ‖ public key), and the input alpha, a byte string of any length (the block seed passes 32 bytes).
  • Verify: the 32-byte public key Y, alpha, and the 80-byte proof π.

Output and effect. Prove returns π = Γ(32) ‖ c(16) ‖ s(32) and the output β (64 bytes). Verify returns β or "invalid". β = SHA-512(0x03 ‖ 0x03 ‖ encode(8·Γ) ‖ 0x00). Every proof that verifies for one (Y, alpha) carries the same Γ and so the same β; the 80 proof bytes may differ (they depend on the nonce), the output never does.

Conventions: the Ed25519 group of RFC 8032, p = 2²⁵⁵ − 19, group order ℓ = 2²⁵² + 27742317777372353535851937790883648493, base point B; a point is encoded in 32 bytes as RFC 8032 does (y little-endian, the sign of x in bit 255); a scalar is 32 bytes little-endian.

The point check V(b) for a 32-byte string b is true exactly when b is the canonical encoding of a point of order ℓ:

  1. y = b read little-endian with bit 255 cleared is below p (canonical);
  2. b decodes to a curve point P (RFC 8032 §5.1.3: x recovered from y, its parity from bit 255; no square root means no point);
  3. P is not of small order (8·P ≠ identity);
  4. ℓ·P = identity.

This is libsodium's point-validity check. About one random 32-byte string in sixteen passes (one in two decodes, one decoded point in eight has prime order).

How to compute it.

Key expansion, as in Ed25519: h = SHA-512(seed); the scalar x is h[0..32) with h[0] &= 248, h[31] &= 127, h[31] |= 64, read little-endian; h2 = h[32..64); Y = encode(x·B).

Encode to curve (H from Y and alpha; the ZooBC variant of RFC 9381 §5.4.1.1):

  1. For ctr = 0, 1, …, 255: cand = SHA-512(0x03 ‖ 0x01 ‖ Y ‖ alpha ‖ byte(ctr) ‖ 0x00)[0..32).
  2. The first cand with V(cand) true is H, as it is: no multiplication by the cofactor.
  3. If none of the 256 passes, there is no H and the input cannot be proven or verified.

Prove:

  1. H = encode to curve.
  2. Γ = x·H.
  3. k = SHA-512(h2 ‖ H) read as a 64-byte little-endian integer, reduced mod ℓ.
  4. U = k·B, V = k·H.
  5. c = SHA-512(0x03 ‖ 0x02 ‖ Y ‖ H ‖ Γ ‖ U ‖ V ‖ 0x00)[0..16), read little-endian.
  6. s = (k + c·x) mod ℓ.
  7. π = encode(Γ) ‖ c (16 bytes) ‖ s (32 bytes); β as above.

Any nonce k gives a proof that verifies with the same output; step 3 is the reference's choice and the one the vectors use.

Verify:

  1. V(Y) must hold, π must be 80 bytes, and V(Γ) must hold for Γ = π[0..32).
  2. c = π[32..48) and s = π[48..80), both little-endian; require s < ℓ, c ≠ 0 and s ≠ 0 (libsodium's scalar multiplication refuses a zero scalar, so a proof with s = 0 is invalid).
  3. H = encode to curve; none means invalid.
  4. U = s·B − c·Y, V = s·H − c·Γ.
  5. Require SHA-512(0x03 ‖ 0x02 ‖ Y ‖ H ‖ Γ ‖ U ‖ V ‖ 0x00)[0..16) = c.
  6. Return β = SHA-512(0x03 ‖ 0x03 ‖ encode(8·Γ) ‖ 0x00).

How it differs from RFC 9381 (ECVRF-EDWARDS25519-SHA512-TAI, suite byte 0x03). The challenge, the nonce, the proof format and the output are the RFC's. Encode to curve is not: the RFC accepts any decodable candidate and multiplies it by the cofactor 8, the variant accepts only a prime-order candidate and uses it unchanged. The two therefore give different outputs on practically every input, not only where the first candidate is skipped (the published vectors' description says the latter; the bytes are right). Verification is also stricter: Y and Γ must have prime order, and c = 0 and s = 0 are refused. An RFC 9381 library cannot be used as it is. An implementation needs an Ed25519 group library with point decoding, a canonical-encoding check (check y < p yourself if the library's decoder accepts larger values), scalar multiplication, point subtraction and a prime-order test (libsodium's Ed25519 group functions provide all of these, scalar multiplication without clamping included).

Rule activation. The primitive has none. Its use as the block seed is rule seed_vrf, active from height 0 on every chain. A node-key change takes effect 120 blocks after its block, so a blocksmith cannot steer a partner's next seed with a pre-signed rotation (09).

Rejections and errors. Prove fails on a secret key that is not 64 bytes or whose second half is not x·B, and on an input with no candidate. Verify refuses: Y failing V; a proof not 80 bytes; Γ failing V; s ≥ ℓ; c = 0; s = 0; no candidate; a challenge mismatch. What a failed proof does to a block is in 05 §5 and 19.

Vector.

(a) computed, published by the reference: the seven VRF vectors it publishes with its source, written by the reference's own generator and pinned by its test. An independent pure-Python implementation of this section reproduced all seven byte for byte: public key, counter, proof (with the nonce of step 3) and output; a proof with one bit of s flipped is refused. The first:

field value
seed 01 × 32
Y 8a88e3dd7409f195fd52db2d3cba5d72ca6709bf1d94121bf3748801b40f6f5c
alpha empty
counter 28
π 517ccd05e153b007e7eb7896ffdd5965617b0f33aee33037311c67d22cf43984662aaa14167daab69641139d5b8630a808cc6d59415604efa182578cf3efa49e63747e0ae2ae1f5ec86d7e4666e7b006
β c65e819682983e3e0ea06564f9ce821faee65fd56e36650a77fb37934726d2a68210fd72c10f9d7f150164d51ebea118524d26357df6537fae700bb9a5d474bc

(b) computed, the seed of block 1 of any chain under the key of vector (a). The genesis block's seed is 64 zero bytes (06 §4), so block 1's alpha = SHA3-256(64 × 0x00) on every chain; the independent implementation of this section proves and verifies it (encode to curve lands at counter 34), and 05 §2–§5 build a block-1 header around this seed.

field value
seed 01 × 32 (Y = 8a88e3dd…6f5c, vector (a))
alpha 070fa1ab6fcc557ed14d42941f1967693048551eb9042a8d0a057afbd75e81e0
counter 34
π 542529a7c6e4557c0b133b605bfeda1850e8a6fcee80fa47fd892482afa6f4c8cd092d802ef89d6748dd49437f9a3b385c4869b410f02c864a3dc81b3d2d766796fc724a3dca71fe10e5c0b80cfa1d0b
β (block 1's seed) 0aaaaa1285e87f89b1bddb73cebe33ee2966bf8d3291c4032bfa0445fa8aa242f50ec37f4d2315be1345bbbb2ed60ee130002e92a42a10c54e00018f69fd85b3

The same π with its last byte changed to 0a → refused (challenge mismatch).

(c) computed, negative: plain RFC 9381 on vector (a)'s key and input lands at counter 1 with H = 97e23d641a88aeee7a1704c25b500ac5977d9ad3e8c3031041c83ff2891a552d and outputs β = 244dac2b152334d7613320bcbcfe6ecb582fe006fc23bc1a2a5d4a316b740a692f154ae18120dfe6c8797f57583ebfbe71898070e0285743e50ee306860131b0. An implementation that produces this has implemented the RFC, not the variant.

Test cases · §8

8 cases · 6 valid · 2 invalid

Prove the first published VRF vector01-8-prove-avalid

Loading the test widget…

Verify the first published VRF vector01-8-verify-avalid

Loading the test widget…

The same proof with one bit of s flipped is refused01-8-flipped-sinvalid

Loading the test widget…

Block 1 of any chain: alpha is SHA3-256 of the genesis block's 64 zero seed bytes01-8-alpha-bvalid

Loading the test widget…

Prove block 1's seed under the key of vector (a)01-8-prove-bvalid

Loading the test widget…

Block 1's proof verifies and its output is block 1's seed01-8-verify-bvalid

Loading the test widget…

The same proof with its last byte changed to 0a is refused01-8-last-byte-binvalid

Loading the test widget…

Plain RFC 9381 on vector (a) gives another output01-8-rfc9381-negativevalid

Loading the test widget…

Defects to match. (a) The counter is one byte. An input whose 256 candidates all fail the point check has no proof; with about one candidate in sixteen passing, that happens with probability (15/16)²⁵⁶ ≈ 6.7·10⁻⁸ per (key, input). For the block seed it means the blocksmith the selection draws cannot make that block and every node agrees no valid seed exists for it, so the turn passes to the next round (20). An implementation must not extend the counter. (b) None other: the variant is deliberate, and the stricter checks are part of it.

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