Common Structure

Public and secret fields

The regular transaction sent to the zkBob contract contains the following fields:

  • Account nullifier - protects from double-spending, if the nullifier already exists the transaction is not valid and will not be executed.

  • Transaction commitment - transaction's subtree root hash

  • Delta field containing of:

    • Transfer index - Merkle tree index at the time of transaction creation

    • XP (energy) delta - for withdrawal transaction

    • Token delta - pool balance delta after the transaction execution (a positive value for deposit transaction, negative for withdrawal)

  • Transaction proof

  • Memo block containing transaction specific fields, encrypted transaction details (accounts and notes) and extra data

  • Deposit signature - for retrieving source account (exists in the deposit transaction only)

circle-info

Merkle tree root and proof

The are two fields were removed from the transaction structure after decentralized relayers architecture was introduced:

  • Merkle tree root after transaction inclusion

  • Merkle tree proof

For now these fields are posted by provers to finalize committed transactions.

In general, a transaction sender must prepare all fields before submitting a tx to the contract. When using the decentralized relayer scheme, the proxy should check all fields, verify tx proof and send the transaction to the contract. After that the prover (in the most cases the same as proxy) should calculate tree proof and finalize transaction by publishing new Merkle tree root.

There are two parts to a transaction created by a sender - public and secret.

  1. The public input containing encrypted transaction data and other fields which do not disclosure sender, receiver, internal transfer amount, etc.

  2. The secret portion contains unencrypted data such as input and output accounts and notes, proofs, and EDDSA signature.

Public transaction components

  • The current Merkle tree root (before transaction processing by the contract)

  • Input account nullifier

  • Transaction commitment

  • Delta value (a composition of the transaction index, token delta and energy delta)

  • Memo block

  • Optional deposit signature

Secret transaction components

  • A set of unencrypted input\output account and notes for the transaction

  • Input account and notes proofs

  • Transaction signature (S,R)(S, R)

  • Transaction verifier key AA to verify signature

Last updated

Was this helpful?