0013. ZK engine: Noir 1.0 and Barretenberg 6 (UltraHonk)

Design document, published from the repository at docs/adr/0013-zk-engine-noir-barretenberg.md.

  • Status: Accepted
  • Date: 2026-11-13

Context

QuantLayer needs production proofs for credential ownership, validity, balance thresholds, membership, one-time nullifiers and eligibility, verified on EVM chains and bound to where they are used. FEAT-05 fixed the primitives (circomlib Poseidon over BN254) and provided Circom reference templates. The task named Noir and Barretenberg as the candidate stack, subject to checking compatibility first (see ZK_ENGINE.md §1).

Decision

  1. Noir 1.0.0 with Barretenberg 6.0.0, pinned exactly, through npm (@noir-lang/noir_wasm, @noir-lang/noir_js, @aztec-foundation/bb.js). There is no native toolchain dependency for building, proving or verifying.
  2. UltraHonk with the evm target (zero-knowledge, Keccak transcript) for every proof. The Solidity verifiers are generated by bb.js, committed, and checked for reproducibility.
  3. The FEAT-05 suite is kept: noir-lang/poseidon v0.4.0 matches circomlib, so TypeScript, Circom and Noir all agree. Poseidon2, a bb black box, would be cheaper but is deferred to a new suite version.
  4. ZK credentials as issuer Merkle trees, with roots published on-chain by the issuer's authority. Authenticity comes from that on-chain write, not from an in-circuit signature. Revocation re-roots the tree, with a grace period.
  5. Binding: every circuit's first public input is a context derived on-chain from (chain, verifier, msg.sender, app, circuit, nonce). Single-use contexts and per-scope nullifiers prevent replay. A single data-driven QuantLayerProofVerifier serves all circuits.
  6. Layering: zk-engine stays framework-neutral, and zk-noir is the adapter. The SDK exposes the engine only through @quantlayer-protocol/sdk/zk.
  7. On-chain truth: verification counts only when confirmed from a receipt (confirmOnChainVerification), never from an API response.

Consequences

  • Proving takes about 0.7–0.9 s per circuit (2^16 gates) and on-chain verification about 2.6M gas, which suits L2s more than L1 for frequent use.
  • The universal SRS (Aztec Ignition) means no per-circuit ceremony, but soundness rests on it (ZK_ENGINE.md §9).
  • Artifacts are large (about 1.5 MB each) because of non-native Poseidon.
  • Toolchain upgrades are breaking by design: bb 5 and 6 proofs are incompatible. An upgrade means rebuilding artifacts, regenerating fixtures, redeploying verifiers and registering new circuit ids.
  • The Circom templates from FEAT-05 stay as an independent reference implementation of the primitives. Noir is the production circuit stack.