0% 0% 0% 0%

Circuits

Index
  1. 01. Concepts
  2. 02. Contracts
  3. 03. pool
  4. 04. policy
  5. 05. viewkeys
  6. 06. verifier
  7. 07. Circuits
  8. 08. Features
  9. 09. Shielded send
  10. 10. Deposit & withdraw
  11. 11. Consolidate & split
  12. 12. Shielded swap & pay
  13. 13. Escrow
  14. 14. Payment channels
  15. 15. Payroll & subscriptions
  16. 16. Auditor disclosure
  17. 17. ASP compliance
  18. 18. Cloud runtimes

Circuits

The zero-knowledge logic lives in Noir circuits, proved client-side with UltraHonk. They are not separate contracts — each circuit is verified on-chain by the pool (the live pool is a “9-verifier” pool, registering one verifier per circuit). So a feature like escrow or swap is a circuit + a pool entrypoint, not a new deployed contract.

The flow is always the same: prove off-chain, verify on-chain. The Rust core builds a witness, the prover produces an UltraHonk proof, the relayer submits it, and the pool’s matching verifier checks it with BN254 + Poseidon host functions.

The circuits

CircuitWhat it provesFeature
depositA public on-ramp commits the right value into a note.Deposit & withdraw
transfer / transfer4Spend up to 4 owned notes → 2 outputs; membership + nullifiers + value conservation.Shielded send
withdrawRelease public tokens for a spent note, bound to the destination (dest_bind).Deposit & withdraw
split1-in / N-out (padded to 6) — standard denominations and multi-recipient payouts.Consolidate & split
shielded_swapSwap one shielded asset for another against an in-pool constant-product market.Shielded swap & pay
escrow_contributeFund an escrow privately; the running sum stays hidden (Pedersen over Grumpkin).Escrow
escrow_payoutClaim a funded escrow once terms are met, with refund on expiry.Escrow
channel_closeSettle a merchant-pull channel’s final balance; offline draws authorized by in-circuit Schnorr over Grumpkin.Payment channels

A shared notes library defines the note/commitment/nullifier format used across all of them, so they agree byte-for-byte with the contract and indexer.

Frozen verifying keys

Each circuit’s verifying key is frozen and committed in the repo (frozen_vks/) and set immutably on its on-chain verifier at deployment. The client checks its proofs against the same frozen VKs before submitting, so off-chain and on-chain verification can never diverge.

The on-chain side of this is the pool and the verifier; the user-facing side is Features.