ZooBC wiki
Transactions

Transactions

A transaction is a signed instruction to the chain: pay someone, issue a token, place an order, link an address to a group. ZooBC has no virtual machine for user code. Every feature is a built-in transaction type with fixed rules that every node applies in exactly the same way, so a wallet knows, before it signs, everything a transaction can do and what its minimum fee will be.

Built-in types

From version 0.5.8 ZooBC defines 73 transaction type numbers, type 0 included, in twelve families.

Twelve tiles, one per family of transaction types, each with its number of types, adding up to 73
Twelve tiles, one per family of transaction types, each with its number of types, adding up to 73

A type number is a group plus 256 times a subtype, so the numbering is sparse: 2 is NodeRegistration, and 258 (group 2, subtype 1) is its update. A number the chain does not define is refused, and every defined type is accepted from block 1.

Two numbers are special. Type 0, Empty, moves nothing: it exists to carry a message, it must still pay a fee above zero, and it does not raise the sender's nonce, the per-sender counter the chain keeps. Type 53, CancelLongevity, is retired: every chain refuses it, and CloseLongevity (309) is used instead.

The life of a transaction

  1. A wallet builds the envelope, the same layout for every type, and signs it for one chain.
  2. It submits the signed bytes with POST /api/v1/transactions. HTTP 202 means the node accepted the transaction into its pool, not that it is in a block. Resending the same bytes is safe: the copy is marked as a duplicate.
  3. Nodes pass the transaction on, and a block producer includes it. A block holds at most 2,000 transactions and 524,288 bytes of payload, and at most one transaction from each account (see one transaction per account per block, and batches).
  4. GET /api/v1/transactions/<hash>/status reports its progress: staging, mempool (with its position), confirmed (with the block height), rejected (with the reason) or not_found.

A transaction that no block includes within its window expires (see expiry and timestamps).

When the state changes in between

Between signing and inclusion in a block, other transactions can change what a transaction depends on: an escrow is settled, an offer is taken by someone else, a token expires. Such a transaction becomes a paid no-op: it is included in a block, it pays its fee, and it changes nothing else. The block stays valid on every node, so nobody can stall the chain by sending transactions that are about to go stale.

A block is invalid only for faults that every node sees the same way, such as a bad signature, a fee below the floor (see fees) or a payment larger than the sender's balance.

Articles in this category

See also

Articles in this topic