Concepts
Notes and the pool
On this page
Notes
A note is four numbers: tokenId (1 = SEI, 2 = USDC), amount, ownerPub and a random blinding. The chain stores only its commitment:
commitment = Poseidon(TAG_COMMITMENT, tokenId, amount, ownerPub, blinding)
ownerPub = Poseidon(TAG_OWNER, spendKey)
All values are elements of the BN254 scalar field. The domain tags are derived constants (Spec §3.3).
The tree
Commitments are appended to an incremental Merkle tree of depth 20 (about one million leaves), hashed with Poseidon. Every root the tree has ever had stays valid forever, so a proof made against an older root still verifies (Spec §7.1). That costs a storage slot per insertion and reveals an upper bound on when a note was inserted.
Spending
To spend a note you reveal its nullifier:
nullifier = Poseidon(TAG_NULLIFIER, commitment, leafIndex, spendKey)
The pool records every nullifier and rejects a second use. Nobody can connect a nullifier to its commitment without the spend key.
The join-split
Every transaction (deposit, transfer, claim, withdrawal) uses the same circuit with two inputs and two outputs. It proves:
- both inputs are in the tree (or are zero-value dummies),
- the spender knows their spend keys,
- the nullifiers are computed correctly,
- inputs + public amount = outputs + fee, per asset, with every amount in range,
- the outputs all have the same asset as the inputs.
The public inputs are listed in Circuit. For a private transfer the public asset is 0 and the public amount and fee are 0, so the chain learns neither the asset nor the value.
Balance
Your balance is the sum of your unspent notes per asset. The app keeps no balance on any server. It reads pool events, tries every ciphertext with your view key, and keeps the notes whose commitment matches when recomputed with your own key (Spec §8.1).
Source: apps/web/content/docs/notes-and-pool.md