Best Viewed on Desktop
The technical documentation and app previews are optimized for desktop viewing.
β Back to HomeZK Circuits
Nine Circom circuits spanning the full protocol evolution β from basic deposit to V9 relayer binding and V11 partial withdrawals.
Core Circuits (Deployed)
Main withdrawal circuit. Dual nullifier, Poseidonβ commitment, Merkle proof (20 levels), passphrase verification, relayer binding anti-frontrun.
Proof of Innocence β proves commitment β ASP clean set via Merkle proof, without revealing which commitment. Based on Buterin et al. 2023.
V11 partial withdrawal. Amount cryptographically bound to leaf via Poseidonβ(commitment, amount). Change commitment for remainder. Full dual nullifier anti-coercion preserved.
Dual Merkle proof (pool + ASP). Configurable range checks on amount and timestamp. Audit nonce binding prevents replay. Optional checks via trivial ranges.
Helpers & Evolution
Basic deposit: Poseidonβ(secret, nullifier) β commitment + nullifierHash.
Arithmetic primitives: Selector (mux), OR, AND gates. No branching β mathematical indistinguishability.
First dual-logic: panic_bit OR ia_inference β coercion detection. Poseidonβ commitment.
V9 with passphrase + biometry. NOT(estrΓ©s) AND frase_correcta. Poseidonβ commitment.
V9 refined: direct acceso_real = biometria_normal * frase_correcta. Uses CommitmentHasherV9 template.
Source Code
Circuit Evolution
Compilation Pipeline
# 1. Compile circuit β R1CS + WASM circom withdraw_dual_v9_relayer.circom --r1cs --wasm --sym -o build/ # 2. Trusted setup β Phase 1 (Powers of Tau) snarkjs powersoftau new bn128 16 pot16_0000.ptau snarkjs powersoftau contribute pot16_0000.ptau pot16_0001.ptau --name="ZK-Sentinel Ceremony" # 3. Phase 2 β Circuit-specific snarkjs groth16 setup build/withdraw_dual.r1cs pot16_final.ptau withdraw_0000.zkey snarkjs zkey contribute withdraw_0000.zkey withdraw_final.zkey # 4. Export verification key + Solidity verifier snarkjs zkey export verificationkey withdraw_final.zkey vkey.json snarkjs zkey export solidityverifier withdraw_final.zkey Verifier.sol # NOTE: vkey is embedded in Verifier.sol at compile time # The .zkey file is NOT used at runtime by the contract # Flow: r1cs β zkey β Verifier.sol (vkey embedded)
.zkey file is used only during proof generation (client-side) and is NOT required at runtime by the on-chain verifier. This means the contract is self-contained for verification.