Binary Encoding

Version 2 (0x02) — deterministic block and vote wire formats.


Version 2 (0x02). Deterministic layout for hashing and signing.

Block Canonical Encoding

OffsetSizeField
01Version byte (0x02)
11Type byte
28Asset (left-aligned UTF-8, zero-padded)
1032Account (hex-decoded)
4232Previous (hex-decoded; "0" → 32 zero bytes)
748Balance (big-endian uint64)
828Timestamp (big-endian int64)
90+varType-specific tail
after tail32Representative (32 zero bytes if empty)
after rep48Genesis lease-timing tail — genesis only, present iff any timing field is non-zero: six big-endian uint64s (min_duration, settle_grace, force_settle_gap, escrow_expiry, archive_gap, max_attestation_skew)
trailer1+NSend/burn only: memo_len (1 byte, 0–64) + memo bytes — always present on send and burn, even when the memo is empty, so a missing memo and an empty memo encode identically

Memos

Send and burn blocks may carry a UTF-8 memo of up to 64 bytes (MaxMemoBytes, byte-counted). The memo is part of the canonical encoding, so it is covered by the block hash and signature.

Type Bytes

Send=0x01, Receive=0x02, Lease=0x04, LeaseAccept=0x05, LeaseSettle=0x06, Genesis=0x07, MultisigOpen=0x08, MultisigUpdate=0x09, LeaseCancel=0x0A, Burn=0x0B, LeaseForceSettle=0x0C, Mint=0x0D

0x03 is a retired, unallocated gap (the removed permissionless claim type).

Full Block Encoding

[canonical bytes] [8 bytes PoW nonce (little-endian uint64)]

Vote Encoding

OffsetSizeField
01Version (0x02)
132RepPubKey
3332BlockHash
6532ConflictAccount
9732ConflictPrev
1298Timestamp (big-endian)
1371Final flag (0 = converge, 1 = final)
1382Signature length
140NSignature bytes

Signing bytes are offsets 0–137 (138 bytes); the final flag is signed so a converge vote cannot be flipped into a final vote. Total wire size with a 64-byte ed25519 signature: 204 bytes. DecodeVote rejects any version byte other than 0x02.

PoW nonce = little-endian; all other numeric fields = big-endian.