ZK Circuits
Circom Groth16 circuits for vault operations.
Circuits are authored in Circom 2 (siphon-zk) and compiled to Groth16 proving/verification keys deployed as Solidity verifiers.
Withdrawal
Proves ownership of N input notes against a Merkle root:
Public signals: withdrawnValue, stateRoot, changeCommitment, nullifierHash[N], recipient
Enforces nullifier uniqueness, 128-bit range checks, and sum constraints across inputs.
Merge
Consolidates N notes into one mergedCommitment. No external transfer — all input nullifiers spent.
Swap
Atomic private swap from one input note:
Public signals: amountIn, stateRoot, newCommitment, nullifierHash, recipient, pool, dstToken, fee, minAmountOut
The executor cannot reroute the swap — all routing params are proof-bound.
Split
Divides one note into multiple slice notes (up to eight).
Tree parameters
- Hash: Poseidon (BN254 field)
- Depth: 32 levels
- Field size: alt_bn128 scalar field
Client proving
Proofs are generated in the browser via snarkjs and WASM artifacts from the trusted setup. An optional proving relayer can generate proofs server-side.