Transaction kinds and public fields

The seven transaction kinds of statement v4 and what each one puts in the public journal.

On this page
  1. The kinds
  2. Every transaction has
  3. The journal
  4. Containers and ids
  5. Notes
  6. Fields that stay out of public market data

The kinds#

KindNameWhat it isPublic beyond the common fields
0SPENDPrivate transfer, merge or split, with changeOptional fee
1ISSUANCECreates a plain asset; the whole supply is minted into the two outputsThe asset identifier and a salted commitment to the supply cap
2EXCHANGE_PRIVATEOne half of a two-party exchangeAn exchange binding; no pair, no quantity
3EXCHANGE_PUBLICOne half of a two-party exchange that publishes pair and quantitiesBoth assets and both amounts
4POOL_BUYSlippage-bounded intent to buy from a poolPool, input asset and exact amount, minimum out, recipient binding, hash of the pool-output envelope
5POOL_SELLThe same, selling the pool's tokenThe same
6LAUNCHA shielded spend bound to one launchLaunch parameters hash, launch fee asset and amount

Roles: in an exchange, role 0 gives asset A and takes B; role 1 gives B and takes A. Always 0 for other kinds.

Every transaction has#

Two inputs and two outputs, with dummy padding when fewer are real. A single amount may not exceed 2^63 - 1. The note tree has depth 32.

The journal#

The journal is the public statement of a proof: exactly 668 bytes, beginning with the magic LSV4. In order: version (4), kind, role, an expiry height, the chain, a domain, the note-tree root the inputs were proven against, two nullifiers, two output commitments, two envelope hashes, the fee asset and amount, the issuance asset and cap commitment, the exchange binding, the swap terms (kind 3 only), the market reference, the value asset and amount, the minimum out, the recipient binding and the market envelope hash. A field that does not apply to a kind must be zero.

The witness, the private input to the proof, is 3,584 bytes and never leaves the wallet.

Containers and ids#

A transaction container holds one proof (two for an exchange), the claimed journals as hex, the envelopes and, for a launch, the public parameters. The transaction id is a tagged hash of the journals. See Node HTTP API.

Notes#

A note is (asset, amount, owner, salt). Its commitment is a two-layer hash. Its nullifier is a tagged hash of the nullifier key, the chain and the note's leaf; the spend key and nullifier key are separate, so the person who paid you cannot tell when you spend what they paid.

Fields that stay out of public market data#

Nullifiers, change commitments, the ledger-created output commitment, the recipient binding, envelope hashes, the anchor root, the minimum out, the expiry and the transaction id are never in any tape, launch, pool or quote object. They are still in the journals inside blocks, so anyone reading the chain can see them.

Lathen documentation.