- 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
- 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. - UltraHonk with the
evmtarget (zero-knowledge, Keccak transcript) for every proof. The Solidity verifiers are generated by bb.js, committed, and checked for reproducibility. - The FEAT-05 suite is kept:
noir-lang/poseidonv0.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. - 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.
- 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-drivenQuantLayerProofVerifierserves all circuits. - Layering:
zk-enginestays framework-neutral, andzk-noiris the adapter. The SDK exposes the engine only through@quantlayer-protocol/sdk/zk. - 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.