What a note is
A note is five numbers you keep on your own device:
Only its commitment goes on-chain:
Poseidon rather than keccak. Poseidon is designed to be cheap to compute inside a
zero-knowledge circuit — a keccak hash costs tens of thousands of constraints, a Poseidon hash
costs a few hundred. Since every action proves a hash in-circuit, that choice is the difference
between a practical system and an unusable one.
The commitment tree
Every commitment is a leaf in one Merkle tree, 20 levels deep — just over a million leaves. The contract stores only the root. It does not keep the leaves, and it could not tell you which leaf is yours if it wanted to. To spend a note you supply a Merkle path — the sibling hashes from your leaf up to the root — and prove in zero knowledge that hashing your commitment along that path produces the root the contract knows. That proof says: “one of the leaves under this root is a note I hold the secrets to.” It does not say which.Your anonymity set is every unspent note in the tree. It grows with every user, which is why
privacy here is a shared resource rather than an individual setting.
Spending, and why you cannot spend twice
If a proof never reveals which note was spent, what stops you spending the same note over and over? The nullifier hash:The four note states
An action consumes a note and produces a new one. Theoutcome field controls what is legal:
The fourth state exists for a specific reason. A payout has to be tagged as something, and
every other value is a trap: tag it as unbet collateral and it could be redeemed again as a
refund, producing another payout note, forever. Each individual step would be legitimate, and
nullifiers would not stop it because each new note is genuinely new.
So payouts get a state that can only ever be withdrawn. The cycle is closed by construction
rather than by a check somebody might forget.