ZK Provenance Proof Library Survey — Feasibility Report for the provenance_proof Envelope Class
Task: R-201 — Survey ZK provenance proof libraries; feasibility report for provenance_proof envelope class.
Prepared by: worker-opus-2026-05-05-R201-par2
Date: 2026-05-05
Sources last checked: 2026-05-05.
0. Frame
[SPEC §11.2] (line 494) names zero-knowledge selective disclosure as "the most load-bearing future research direction." [THREATS §9] (lines 535–562) enumerates exactly the statements a ZK substrate would need to express. [EXT §2.8] (line 201) goes further than SPEC: it promotes ZK provenance proofs to a Phase-1 EXT deliverable on the grounds that the audit-log primitive is otherwise dual-use surveillance infrastructure.
The R-208 finding (manthan/state/findings/R-208/research/dkim-analogy.md) returns to ZK five times as the only path that dissolves the bilateral-conversation lie-detection problem. So the strategic stakes are:
Without ZK, HERALD's most defensible deployments are also its most surveilled. Reputation laundering, conduit collusion, surveillance-by-default audit logs, and lineage-cluster surveillance all collapse if the protocol can prove "I descend validly from a Herald-attested model" without revealing the trace.
This report assesses whether 2026-era ZK proof libraries can express HERALD's required statements, at what maturity, with what tooling, and with what residual risks. It does not propose a circuit, build a prototype, or prescribe a single library. It is a navigation document: which library family to pick for a v0.3-era PoC, and what conditional roadmap follows that choice.
1. The HERALD ZK statements (drawn directly from [THREATS §9])
The threat model lists five statements a verifier should be able to confirm without seeing the trace ([THREATS §9] lines 540–545):
| # | Statement | Required structure |
|---|---|---|
| S1 | Envelope's lineage chain terminates at a Herald-attested model hash. | Recursive verification of N signatures over a chain of parent-linked envelopes ending in a birth envelope counter-signed by a Herald with a known public key. Variable depth (typical N small, but unbounded). |
| S2 | A given envelope has been logged in a conformant audit log. | Merkle-tree inclusion proof against a published Signed Tree Head ([EXT §2.3]). STH itself signed by a known log operator key. |
| S3 | Capability manifest's signer holds a non-deprecated sigil. | Signature verification + non-membership proof (signer not in revocation/molt list at time ts). Non-membership over a published, signed registry. |
| S4 | Trace's genesis matches a participant's claimed genesis. | Equality of trace field across two envelope sets, plus a single signature check on the genesis envelope. Cheapest of the five. |
| S5 | Patina score exceeds threshold t, without revealing the underlying envelope set. | Cardinality / range proof over a privately committed multiset of envelopes, each individually signature-checked, each falling in a declared time window, each tagged with the relevant attestation type. |
Two further candidates not in §9 but mentioned by the R-208 finding are likely to enter [EXT §2.8]'s scope:
- S6 Recipient-observation: "I observed sigil X violate property P at time t" — a signed envelope from a recipient, plus optional ZK redaction of the recipient identity.
- S7 Refusal-rate proof ([EXT §10.2]): "my refusal rate over a given window is below threshold r" — same shape as S5 with different attestation tags.
For library evaluation, the load-bearing primitive across all seven is:
Signature verification (Ed25519) inside the circuit, composed with Merkle-inclusion / non-inclusion proofs, with optional recursion to handle variable-depth chains, and small range/cardinality predicates on top.
If a library does this well, HERALD can express its statements. If it does not, HERALD cannot.
2. Why HERALD is not a typical zk-rollup workload
A clarifying note before the library survey. zkVM marketing in 2024–2026 is dominated by Ethereum block proving: tens of millions of cycles, single proof per ~12s slot, GPU farms, real-time. HERALD is the opposite shape:
| Dimension | zk-rollup workload | HERALD provenance_proof |
|---|---|---|
| Prover | Batched, server-side, well-resourced | Often sigil-side (laptop, phone, edge agent) |
| Frequency | One proof per block | Per-envelope, potentially millions/day system-wide |
| Latency budget | Seconds per proof OK | Milliseconds-to-seconds per proof; verification <10ms |
| Workload size | 10⁶–10⁹ cycles | 10²–10⁴ "cycles" (a handful of sig-checks + a Merkle proof) |
| Dominant cost | Memory / RAM / FFTs | Per-statement constant overhead and signature precompiles |
| Recursion need | Aggregating thousands of proofs | Variable-depth lineage chains (≤20 hops typical) |
| Trusted setup tolerance | Has been accepted (KZG ceremonies) | Should be avoided where possible — HERALD's trust model is "no chokepoint" ([SPEC §0]) |
The mismatch is significant: a zkVM optimised for million-cycle Ethereum blocks is underpowered per dollar for HERALD's tiny circuits, because the constant per-proof overhead dominates. Conversely, a hand-tuned circuit (Halo2, Circom, Noir) where the prover does only the Ed25519 + Merkle work HERALD actually needs may produce a 100ms / kilobyte proof on a phone.
This frames the survey: HERALD wants small, hand-tuned, transparent over large, general-purpose, ceremony-dependent.
3. Per-library survey
For each library: repo URL, license, last-checked release info, proof system, target backend, tooling maturity, audit status, performance ballpark for HERALD-shaped circuits, and a per-statement (S1–S7) readiness column. All "estimated" rows are flagged. All "measured" rows cite a benchmark source.
3.1 Halo2 (Zcash and PSE forks)
- Repo: https://github.com/zcash/halo2 (canonical), https://github.com/privacy-scaling-explorations/halo2 (PSE/KZG fork), https://github.com/privacy-ethereum/halo2 (renamed PSE org as of 2025).
- License: MIT/Apache-2.0.
- Proof system: PLONKish arithmetisation. Zcash variant uses IPA polynomial commitments (transparent — no trusted setup). PSE variant uses KZG (faster proofs, requires trusted setup ceremony).
- Maturity: Zcash variant is in production securing the Orchard pool since NU5 (2022). PSE fork powers Scroll, Taiko, Axiom in production. Backed by multiple deep audits.
- Audit status: Multiple Trail of Bits audits of Axiom's circuits (2025); Kudelski Security analysis 2024; the "query collision" soundness bug disclosed and patched across Zcash/PSE/Axiom in late 2024.
- Performance ballpark (HERALD-shaped): Hand-tuned Halo2 circuits for Ed25519 verification land at ~2¹⁵–2¹⁷ rows for a single signature check; proof sizes ~1–8 KB IPA, ~200–500 B KZG; prover time ~1–10 s on a laptop for a single-signature circuit. Estimated for HERALD's compound circuit (3–5 sig + Merkle): single-digit seconds prover, sub-second verifier, low-tens-of-KB IPA / sub-KB KZG. Estimate, not measured.
- Recursion: Native — Halo2 is descended from "Halo" precisely to provide cycle-free recursion via accumulation. Plonky2 cited as faster for recursion specifically (~170 ms recursive proof on a laptop) but Halo2 has more production usage.
- Per-statement readiness:
| S1 (lineage chain) | S2 (log inclusion) | S3 (manifest + non-revoc) | S4 (genesis eq) | S5 (patina ≥ t) | S6 (recip-obs) | S7 (refusal rate) | |
|---|---|---|---|---|---|---|---|
| Halo2 | Strong (recursion mature) | Strong (mature Merkle gadgets) | Medium (non-membership trickier; needs custom gadget) | Strong (trivial) | Medium (range-proof gadgets exist; cardinality custom) | Strong | Medium |
- Tooling: Mature; halo2_gadgets includes Poseidon / Sinsemilla / SHA-256. Halo2-WASM runs in browsers (Yu Tham tutorial 2023, mature by 2026). Axiom's halo2-base offers a higher-level frontend.
- Verdict: Strongest single candidate for hand-tuned per-statement HERALD circuits, if HERALD accepts (a) the IPA prover overhead or (b) the KZG ceremony as a trade.
3.2 Plonky2 / Plonky3
- Repo: https://github.com/0xPolygonZero/plonky2; https://github.com/Plonky3/Plonky3
- License: MIT/Apache-2.0.
- Proof system: Plonky2 is PLONK + FRI over Goldilocks (64-bit prime). Plonky3 is a toolkit of components for building application-specific zkVMs and circuits over a choice of fields (BabyBear, KoalaBear, Mersenne31).
- Maturity: Plonky2 production-ready since 2022 in Polygon zkEVM. Plonky3 declared "production ready" by Polygon Labs July 2024. Plonky3 already powers SP1 internals (see §3.4) and Valida.
- Audit status: Plonky3 "has been extensively audited for soundness" per Polygon Labs press; specific audit reports not publicly aggregated as of 2026-05.
- Performance ballpark: Plonky2 generates recursive proofs in ~170ms on a laptop ([Polygon blog, 2022]). Compresses any proof to ~43 KB. Estimated HERALD-shaped circuit (single Ed25519 + small Merkle): ~1 s prover, ~50 ms recursive; 30–50 KB proof — possibly compressible further.
- Trusted setup: None (FRI is transparent). This is the strongest privacy/trust property of any candidate.
- Per-statement readiness:
| S1 | S2 | S3 | S4 | S5 | S6 | S7 | |
|---|---|---|---|---|---|---|---|
| Plonky2/3 | Strong (designed for recursion) | Strong | Medium (non-membership needs custom AIR) | Strong | Medium | Strong | Medium |
- Tooling: Plonky3 is a toolkit, not a high-level DSL — Rust API, expects circuit author to know what they are doing. There is no Halo2-style gadget library yet for HERALD's typical primitives. Plonky2 has a more mature gadget set including SHA, Keccak, Poseidon, 32-bit arithmetic.
- Verdict: Strong technical fit (no trusted setup, fast recursion). Weaker tooling story than Halo2 today. The "if HERALD picks Plonky2/3" path has the steepest implementer learning curve.
3.3 RISC Zero zkVM
- Repo: https://github.com/risc0/risc0
- License: Apache-2.0 / MIT.
- Proof system: zk-STARK over RISC-V execution traces, with optional STARK→Groth16 wrapper for short on-chain verification. Transparent setup (STARK part); the wrapper Groth16 needs a one-time ceremony.
- Maturity: zkVM 1.0 shipped 2024; multiple production users by 2026 (Bonsai network, Boundless prover marketplace). Real-time provable for Ethereum-block-shaped workloads on GPU.
- Audit status: Multiple Hexens audits (Oct 2023 zkVM core, May 2024 STARK→SNARK circuit, December 2024 update). Has a public HackenProof bug bounty.
- Performance ballpark: RISC0 produces ~209 KB proofs (uncompressed STARK) or ~256 B (Groth16-wrapped). Prover time per Ethereum block: minutes on CPU, real-time on GPU clusters. Estimated HERALD-shaped circuit: a single Ed25519 verification implemented as
ed25519-dalekRust code inside RISC0 → expected several seconds prover on CPU, ~210 KB proof; Groth16-wrapped on the final proof would shrink to <1 KB but adds the ceremony. - Per-statement readiness: Universally strong — the zkVM model treats every HERALD statement as "Rust code that calls
ed25519_verifyandmerkle_verify." There is no per-statement circuit design effort; the cost is per-cycle. - Trusted setup: None for STARK proofs; required for the Groth16 wrapper (unless a pure-STARK on-chain verifier is acceptable, which doubles verification gas / time).
- Verdict: Lowest implementer effort, highest per-proof cost. Best fit if HERALD prioritises shipping a working PoC fast and is willing to pay the per-proof cycles.
3.4 SP1 (Succinct Labs)
- Repo: https://github.com/succinctlabs/sp1
- License: MIT.
- Proof system: Plonky3-backed STARK over RISC-V execution; supports STARK→PLONK→Groth16 wrapping for on-chain verification.
- Maturity: Audited by Veridise, Cantina, Zellic, KALOS; formally verified RISC-V constraints with Nethermind / Ethereum Foundation. SP1 Hypercube (2026) demonstrated real-time Ethereum block proving on 16 GPUs.
- Audit status: Strongest in this survey: 4 third-party audits + formal verification (rare in zkVM space).
- Performance ballpark: SP1's Ed25519 precompile is the most directly relevant feature for HERALD: signature verification runs as a specialised circuit inside the zkVM, "5–10x faster than equivalent RISC-V cycles." Estimated HERALD circuit (3 signatures + 1 Merkle inclusion + 1 non-membership): ~hundreds of ms on CPU with precompiles. Proof sizes 1–2 MB STARK, <1 KB Groth16-wrapped.
- Per-statement readiness:
| S1 | S2 | S3 | S4 | S5 | S6 | S7 | |
|---|---|---|---|---|---|---|---|
| SP1 | Strong (Ed25519 precompile + recursion) | Strong (SHA256 precompile) | Strong (precompile + Rust logic) | Strong | Medium (Rust logic; cycle cost grows) | Strong | Medium |
- Trusted setup: Same trade-off as RISC0 — STARK is transparent, Groth16 wrapper for on-chain verification needs a ceremony.
- Verdict: Strongest production-readiness signal (audits + formal verification + precompiles for HERALD's exact primitives). Best fit if HERALD wants the lowest-risk path to shipping.
3.5 Noir (Aztec) + Barretenberg backend
- Repo: https://github.com/noir-lang/noir; https://github.com/AztecProtocol/aztec-packages (Barretenberg backend).
- License: Apache-2.0 (Noir), MIT/Apache (Barretenberg).
- Proof system: Noir compiles to ACIR (Abstract Circuit IR), backend-agnostic. Default backend is Barretenberg (UltraHonk PLONK variant + KZG); ACIR can also target Halo2 or Plonky2 via community projects. As of 2026-05, Noir 1.0 pre-release announced; Aztec Network v5 release planned July 2026.
- Maturity: Beta as of late 2025; 1.0 pre-release in 2026; actively used in production by Aztec testnet. Browser deployment via NoirJS is a stated 2026 priority.
- Audit status: Aztec funds ongoing audit work; specific public reports for Noir 1.0 not aggregated as of writing.
- Performance ballpark: UltraHonk + Barretenberg targets sub-second prover for medium circuits in browser. Estimated HERALD-shaped circuit: ~hundreds of ms in browser (NoirJS), ~tens of ms verifier. Proof sizes ~500 B–4 KB.
- Per-statement readiness: Strong for S1–S5; the language is high-level enough that each statement is days, not weeks, of circuit work.
- Trusted setup: Barretenberg uses a universal KZG SRS (Aztec ignite ceremony). HERALD would inherit this trust assumption unless a backend swap to Halo2/Plonky2 is exercised.
- Verdict: Best developer ergonomics of the surveyed options for HERALD-shaped circuits. Backend-agnostic ACIR means the trust-setup decision can be deferred. Primary risk: 1.0 stability and audit timing.
3.6 gnark (Consensys, Go)
- Repo: https://github.com/Consensys/gnark
- License: Apache-2.0.
- Proof system: Groth16, PLONK with KZG, PLONK with FRI; supports BN254, BLS12-381, BW6-761 and others. v0.14.0 released June 2025; gnark-crypto v0.20.0 published March 2026.
- Maturity: Production-deployed (Linea's prover, Polygon Hermez, multiple bridges). Native Go is a unique strength: HERALD has a stated v0.3 conduit reference implementation in Go (
tools/and conduit reference work in TODO). - Audit status: Used in audited production systems; specific gnark-core audit reports less publicly aggregated than SP1's.
- Performance ballpark: "gnark compiles gigantic circuits in seconds, and its solver, prover and verifier are significantly faster than circom/rapidsnark or arkworks. Over 2 million constraints per second on large circuits." For HERALD-shaped: estimated sub-second prover, ~200 B Groth16 or ~500 B PLONK proofs. Optional GPU acceleration via ICICLE.
- Per-statement readiness: Strong for S1–S5; gnark's standard library includes EdDSA-on-BabyJubjub and pairing-based signature schemes. Caveat: Ed25519-as-HERALD-uses-it (RFC 8032) is not the same as EdDSA-on-BabyJubjub. A native Ed25519 gnark circuit exists (e.g. ConsenSys's own bridge work) but is non-trivial.
- Trusted setup: Required (Groth16 needs per-circuit ceremony; PLONK/KZG needs universal ceremony).
- Verdict: Strongest fit for a Go-native HERALD reference. Would minimise polyglot complexity. Per-circuit Groth16 ceremony is a real governance burden for HERALD given the "no chokepoint" tenet.
3.7 arkworks (Rust)
- Repo: https://github.com/arkworks-rs (algebra, snark, groth16, marlin, gemini, plonk crates etc.)
- License: MIT/Apache-2.0.
- Proof system: Multiple — Groth16, GM17, Marlin, Plonk implementations. Field, curve, R1CS, and PCS layers exposed independently.
- Maturity: Active 2026 (algebra crate updated April 2026). The explicit project disclaimer is "academic proof-of-concept prototypes that have not received careful code review and are NOT ready for production use."
- Audit status: Largely unaudited at the SNARK layer (the field/curve crates are battle-tested by downstream projects).
- Performance ballpark: Slower than gnark in published benchmarks (zk-Bench 2023). Adequate for prototyping; not the production target.
- Per-statement readiness: All of S1–S5 are expressible. Effort is higher than Halo2/Noir because arkworks exposes lower-level primitives.
- Trusted setup: Per-scheme; Groth16 + Marlin + Plonk all have ceremony requirements.
- Verdict: Excellent for academic exploration and as a Rust dependency for parts of a HERALD circuit (e.g.
ark-bn254,ark-ed25519for field arithmetic). Not the production-target frontend.
3.8 Circom + snarkjs (iden3)
- Repo: https://github.com/iden3/circom; https://github.com/iden3/snarkjs; https://github.com/iden3/rapidsnark
- License: GPL-3 (snarkjs); circom is Apache.
- Proof system: Groth16, PLONK, fflonk over BN254 — compilable to R1CS via circom DSL.
- Maturity: Production for years (Tornado Cash, World ID, ZKP-passport). Mature ecosystem. snarkjs runs in the browser; rapidsnark is a fast C++ prover.
- Audit status: Iden3 contracts audited; circom DSL has known footguns (signal underconstrained-ness — see Trail of Bits and others on circom-pairing). Multiple cases of soundness bugs from circuit author error, not from circom itself.
- Performance ballpark: rapidsnark Groth16 prover is among the fastest open implementations for medium circuits. HERALD-shaped: estimated <1 s prover, sub-200 B proof. Ed25519 inside circom requires the iden3 circomlib
eddsatemplate (BabyJubjub variant) — for RFC-8032 Ed25519, custom circuits exist (e.g. ZKP-passport's) but require care. - Per-statement readiness: All expressible; circom's Achilles heel is circuit-author error, not capability.
- Trusted setup: Per-circuit Groth16 ceremony, or PLONK universal SRS.
- Verdict: Maturity-and-tooling king for v0.3 PoC, but the snarkjs/circom GPL3 license complicates redistribution; the per-circuit Groth16 ceremony is a governance issue; and the soundness-by-author-mistake risk argues against making it the only HERALD path.
4. Comparison table
The single matrix view, with 2026-05 data:
| Library | Last release (≈) | License | Trusted setup | Recursion | Tooling maturity | Audit status | Ed25519 native | Suited for HERALD? |
|---|---|---|---|---|---|---|---|---|
| Halo2 (Zcash) | 0.3.x line | MIT/Apache | No (IPA) | Native | High | Multiple deep audits | Custom gadget required | Yes — strong |
| Halo2 (PSE/KZG) | active | MIT/Apache | Yes (KZG) | Native | High | Multiple audits | Custom gadget required | Yes (with ceremony) |
| Plonky2 | active | MIT/Apache | No (FRI) | Native, fast | Medium | Polygon-internal | Custom gadget required | Yes — strong |
| Plonky3 | "production ready" 2024-07 | MIT/Apache | No (FRI) | Native | Lower (toolkit) | "Extensively audited" | Via SP1 precompile | Yes (toolkit-level) |
| RISC Zero | 1.x line | Apache/MIT | No (STARK) / Yes (Groth16 wrap) | Yes | High | Hexens (3 audits) | Rust crate, no precompile | Yes (high overhead) |
| SP1 | Hypercube 2026 | MIT | Same trade-off | Yes | High | 4 audits + formal verif | Yes (precompile) | Yes — strong |
| Noir / Barretenberg | 1.0 pre-release 2026 | Apache | Yes (KZG) | Yes | High (DSL) | In progress | Custom impl required | Yes — strong |
| gnark | v0.14.0 2025-06 | Apache | Yes (Groth16/KZG) | Limited | High (Go native) | Production-tested | Custom impl required | Yes (Go-native plus) |
| arkworks | algebra 2026-04 | MIT/Apache | Per-scheme | Per-scheme | Medium (low-level) | Self-declared "not production" | Possible | Prototype only |
| Circom + snarkjs | active | GPL-3 / Apache | Yes | Limited | Highest | Footgun-prone | Custom (iden3 EdDSA is BabyJubjub) | Yes (with care) |
Bold entries indicate first-tier candidates for the v0.3 PoC.
5. Recommendation: which library family for v0.3-era PoC
The recommendation is two-track, not single-library, because HERALD's optimal answer depends on which of two paths the protocol commits to.
Track A — "Ship a working PoC fast." → SP1 (or RISC Zero)
If the goal of v0.3 is to demonstrate that the protocol can produce ZK provenance proofs at all — to unblock [SPEC §11.2] from "open question" status and to give [EXT §2.8]'s Phase-1 promise concrete substance — pick a zkVM. Specifically SP1, on the basis that:
1. Ed25519 verification is a precompile, not a circuit you write.
2. Audit + formal verification posture is the strongest in this survey.
3. The HERALD developer writes a Rust function prove_lineage_chain(envelopes, attestations) -> Proof that is structurally identical to the existing reference verifier. The "circuit" is the existing verifier code.
4. The Groth16 wrapping path lets verifiers be small and on-chain if needed; the STARK path keeps everything transparent.
The cost is per-proof overhead. SP1 provers will be slower per HERALD envelope than a hand-tuned Halo2 circuit by a meaningful margin (estimated 3–10×, not measured in this survey). For low-traffic conduits and Heralds, this is acceptable. For per-envelope provenance proofs at internet scale, it will not be.
RISC Zero is the second-choice in this track — the same model, slightly less aggressive precompile suite, more mature browser/proof-aggregation tooling.
Track B — "Optimise per-envelope cost from day one." → Halo2 (Zcash variant) or Plonky2
If HERALD's intended deployment shape is per-envelope proofs at high frequency (the [EXT §2.8] promotion of provenance_proof to default-mode log entries), the per-proof overhead of a zkVM is too much. Pick a hand-tuned circuit framework.
- Halo2 (Zcash IPA variant) if the highest priority is no trusted setup and you can afford the IPA proof size (~1–8 KB). Best tooling, mature gadget library, multiple production users, deep audit history.
- Plonky2 if recursion frequency is high (e.g. every conduit notarisation aggregates many
provenance_proofs into one log STH proof). The 170ms recursion threshold is genuinely better than competitors for that pattern. - Noir if developer ergonomics matter more than the choice of backend, and HERALD is willing to defer the backend-swap decision. Noir-on-Halo2 is a path the community is actively building; this would let HERALD start with Barretenberg+KZG for speed and migrate to a transparent backend without rewriting circuits.
What to do now (concrete, scoped)
1. Build a minimal SP1-based PoC that proves S1 (lineage chain terminates at a Herald-attested model hash). Time-budget: 1–2 weeks. This validates that the developer-effort claim above is real and produces measurable numbers to replace this report's estimates.
2. In parallel, build the same circuit in Halo2 (Zcash variant). Compare proof size, prover time, verifier time, RAM consumption, on the same input.
3. Use the comparison to decide Track A or Track B at v0.4.
4. Both prototypes should live under experiments/zk/ and explicitly not be promoted to the main spec until reviewed.
This is the substance the report can responsibly recommend. Anything more specific is unfounded without prototyping.
6. Gotchas — known traps that survey-only work cannot dissolve
6.1 Trusted setup vs transparent — politics, not just math
KZG-based systems (PSE Halo2, Noir/Barretenberg, gnark Groth16/PLONK, snarkjs PLONK) require a one-time ceremony. The Aztec ignite ceremony, Ethereum's KZG ceremony, and Filecoin's powers-of-tau are real precedents. For HERALD:
- A ceremony is a chokepoint. [SPEC §0]'s tenets explicitly disclaim chokepoints. The protocol cannot in good faith adopt a system whose security depends on "we did a big ceremony once and you should believe most participants weren't compromised."
- Counter-argument: existing ceremonies (e.g. Ethereum's) are already done; HERALD could piggyback. This delegates the chokepoint to a third-party event rather than creating a HERALD-specific one. Whether that satisfies [SPEC §0] is an open governance question, not a technical one.
Recommendation: prefer transparent setups (Halo2-IPA, Plonky2/3, RISC0/SP1 STARK) at the cost of larger proofs. This is consistent with HERALD's stated values.
6.2 Recursion costs are real
Variable-depth lineage chains (S1) require either:
- Recursion: prove "step N is valid, given recursive proof that step N-1 was valid." Plonky2 (~170ms/step), Halo2 (with accumulation, slower), Nova/SuperNova (~10k constraints/step folding) all support this with different cost curves.
- Bounded depth: declare a maximum chain depth (e.g. 32) and unroll. Simpler circuits but limits HERALD's lineage expressivity.
A bounded-depth-32 circuit is a reasonable v0.3 simplification. It is not what [SPEC §2.3] permits — lineage is unbounded — but it would unblock a PoC.
6.3 Witness-size limits
For Groth16 + Circom on 256M-constraint trusted-setup parameters, Ed25519 batch verification fits at most 99 signatures per proof. HERALD's S5 (patina ≥ threshold over a set of envelopes) hits this limit when the patina set is large. For sets of thousands of envelopes:
- Recursive proof composition (Plonky2/Halo2 accumulation) sidesteps the witness-size limit.
- Or Merkle-commit the patina set off-circuit, prove inclusion + range-bound on a sample. This relaxes the property HERALD is proving; whether that is acceptable is a protocol-design call, not a library call.
6.4 Ed25519-in-circuit is not free
RFC 8032 Ed25519 uses the prime 2^255 - 19 and the non-pairing-friendly Curve25519. Inside a SNARK over (e.g.) BN254, the prover must simulate the curve via non-native field arithmetic. Hand-tuned circuits have brought this to ~1.5M constraints per signature (NEAR Rainbow Bridge work, Electron Labs zk-Ed25519). SP1's Ed25519 precompile is the path of least resistance.
If HERALD ever considers swapping its core signature suite to a SNARK-friendly one (e.g. EdDSA-on-BabyJubjub, or a curve-cycle-friendly choice like Pasta), the ZK story improves dramatically — but [SPEC §3.x] currently mandates Ed25519, and this is a load-bearing interop / browser / hardware-token compatibility decision. Do not change the signature suite for ZK convenience without a separate decision document.
6.5 Soundness bugs from circuit authors, not libraries
The Halo2 "query collision" bug (2024), and the long history of circom circuits with under-constrained signals, illustrate: most ZK soundness failures in the wild come from circuit authors mis-using a sound library. Whatever HERALD picks, the circuit needs:
- An external audit by a ZK-specialist firm (zkSecurity, Veridise, Hexens, Trail of Bits).
- Property-based testing with negative cases (proofs that should fail — does the circuit correctly reject?).
- A formal-verification pass if the budget allows (SP1 has a precedent here).
6.6 Browser / mobile prover feasibility
For HERALD to be honest about the "sigil-side prover" pattern (an agent generates its own provenance proof), browser/mobile feasibility matters. Status:
- Halo2-WASM: mature; demos work in 2026.
- NoirJS: explicitly designed for this; Aztec is investing in browser provers in 2026.
- snarkjs: runs in browser; well-trodden path.
- SP1 / RISC0: WASM ports exist for verifiers; prover in browser is research-grade as of 2026-05 due to memory pressure.
If sigil-side mobile proving is required, Noir or Halo2 are the only mature paths.
7. Conditional roadmaps
7.1 If HERALD picks Halo2 (Zcash IPA variant)
1. Build per-statement gadgets: EnvelopeSig (Ed25519 verification), MerkleInclude (against an STH-rooted tree), LineageStep (recursive accumulator).
2. Compose into per-statement circuits (one for S1, one for S2, etc.). Resist building a monolithic circuit; keep statements composable.
3. Standardise the wire format for provenance_proof.payload as (statement_id, public_inputs, proof_bytes).
4. Audit each gadget separately. Engage a ZK-specialist firm before the first production deployment.
5. Plan a Plonky2/3 migration path for recursion-heavy patterns; Halo2 → Plonky2 inter-op is non-trivial but feasible.
6. Budget: 4–6 person-months for first audited release of S1+S2+S4. S3, S5–S7 are follow-on.
7.2 If HERALD picks Plonky2/3
1. Accept the steeper learning curve. Hire or contract a Plonky2 specialist; the library's tooling assumes circuit-design competence.
2. Use Plonky3 for new work; Plonky2 only for components where existing gadgets save effort.
3. Recursion is the design centre, not an afterthought — design every statement as composable in a recursion tree.
4. Goldilocks field is a quirk: Poseidon hash on Goldilocks is fast; SHA256 (HERALD's hash) is not — there is a real overhead to expressing HERALD's existing hash choice. Either:
- Build SHA256 inside Plonky2 (expensive but feasible);
- Or change HERALD's commitment hash to a SNARK-friendly choice (Poseidon, Rescue) for the ZK envelopes specifically. This is a zk_hash extension, not a SPEC change.
5. Budget: 6–9 person-months for first audited release. Higher than Halo2 due to tooling immaturity.
7.3 If HERALD picks SP1 (Track A)
1. Treat the existing HERALD reference verifier as the "circuit." Compile it for the SP1 RISC-V target.
2. Use Ed25519 + SHA-256 + Keccak precompiles. They cover ~80% of HERALD's per-envelope cost.
3. Decide: STARK proofs (~1–2 MB, transparent) or Groth16-wrapped (~200 B, requires the wrap ceremony). Transparent is the [SPEC §0]-aligned choice; Groth16-wrapped is the on-chain-friendly choice. HERALD does not currently have an on-chain anchor, so the case for Groth16-wrapping is weak.
4. Plan for proof aggregation — prove batches of envelopes together to amortise per-proof overhead. SP1's Plonky3 backbone is good at this.
5. Budget: 1–2 person-months for first PoC; 3–4 person-months for production-quality with audit.
7.4 If HERALD picks Noir + ACIR (deferred backend)
1. Author circuits in Noir, targeting Barretenberg for fast iteration.
2. Plan an ACIR → Halo2 (transparent) migration when the protocol matures.
3. Track Noir 1.0 stability — as of 2026-05, 1.0 is pre-release. Production use is a year-out judgement call.
4. Budget: 2–4 person-months for first audited PoC (lower than Halo2 due to DSL); higher for migration work.
8. Honest residuals — what we cannot judge without prototyping
This is a survey, not a benchmark. Specifically the report cannot answer:
1. Actual proof size, prover time, and verifier time for HERALD's compound circuit (3–5 sig + Merkle + non-membership + small range proof) on each library. Estimates in §3 are extrapolations from public benchmarks of similar primitives. The numbers move within an order of magnitude; ranking between Halo2 and SP1 on HERALD-specific shapes is not knowable without measurement.
2. The audit cost of each circuit. For a small hand-tuned Halo2 circuit, an audit might be $30–80k. For a full SP1 zkVM-resident verifier, the audit reuses SP1's existing audit work and is cheaper for the wrapper but more expensive for the application logic. Real numbers require quotes.
3. The GDPR / right-to-be-forgotten interaction. [SPEC §11.4] (Open Q4) flags this. ZK proofs are immutable commitments; "tombstone with proof of erasure" is unspecified for any of these libraries. Likely an EXT-layer pattern, not a circuit choice.
4. Quantum migration. All surveyed libraries use elliptic-curve cryptography in some part of their stack (KZG ceremonies, Ed25519 verification, signature suites). [SPEC §11.5] flags PQ migration as deferred; the ZK story will need re-evaluation when HERALD's signature suite changes.
5. Composition with multi-signature envelopes ([SPEC §3.4]). A provenance_proof over a multi-sig envelope must verify all signatures and prove the threshold logic. None of the surveyed libraries make this trivial; it is custom circuit work in every case.
6. Plonky3's specific audit content. "Extensively audited" is a press claim; the report could not locate publicly published audit reports for Plonky3 itself (as opposed to SP1 or Polygon zkEVM-using-Plonky3) as of 2026-05. This is a gap a prototyping team should close before commitment.
7. The recipient_observation envelope (S6) is hypothetical from the R-208 finding, not in any of SPEC/EXT/CHARTER. Its ZK shape depends on a SPEC decision that has not happened.
These residuals should drive the prototyping decisions in §5 — measure first, recommend later.
9. Citations
HERALD-internal
- [SPEC §0] — Preamble / design tenets (lines 11–37).
- [SPEC §2.3] — Lineage as a consent graph (lines 91–114).
- [SPEC §3.4] — Multi-signature envelopes (lines 181–191).
- [SPEC §11.2] — ZK selective disclosure as load-bearing future direction (line 494).
- [SPEC §11.4–§11.5] — GDPR and PQ open questions (lines 496–498).
- [EXT §2.3] — Signed Tree Heads / inclusion proofs (line 143).
- [EXT §2.8] — Promotion path: ZK provenance proofs (lines 201–206).
- [EXT §10.2] — Refusal-rate publishing (line 712).
- [EXT §11.3] — ZK-promoted discovery (line 758).
- [THREATS §6.3] — Surveillance-by-default audit logs (line 425).
- [THREATS §9] — What changes when ZK selective disclosure lands (lines 535–562).
manthan/state/findings/R-208/research/dkim-analogy.md§4.5, §6.6 — ZK as the only path that dissolves the bilateral-conversation lie-detection problem.
External (last checked 2026-05-05)
- Halo2 (Zcash): https://github.com/zcash/halo2
- Halo2 (PSE/KZG): https://github.com/privacy-scaling-explorations/halo2
- Halo2 Book: https://zcash.github.io/halo2/
- Trail of Bits — "A deep dive into Axiom's Halo2 circuits": https://blog.trailofbits.com/2025/05/30/a-deep-dive-into-axioms-halo2-circuits/
- Kudelski Security — "On the Security of Halo2 Proof System": https://research.kudelskisecurity.com/2024/09/24/on-the-security-of-halo2-proof-system/
- Plonky2 repo: https://github.com/0xPolygonZero/plonky2
- Plonky2 paper / docs: https://docs.rs/crate/plonky2/latest/source/plonky2.pdf
- Plonky3 repo: https://github.com/Plonky3/Plonky3
- Polygon Labs — "Polygon Plonky3 is Production Ready" (2024-07-16): https://polygon.technology/blog/polygon-plonky3-the-next-generation-of-zk-proving-systems-is-production-ready
- RISC Zero repo: https://github.com/risc0/risc0
- RISC Zero performance benchmarks: https://benchmarks.risczero.com/main
- RISC Zero security audits: https://github.com/risc0/rz-security/tree/main/audits
- Hexens RISC0 audit (2024-12): https://github.com/Hexens/Smart-Contract-Review-Public-Reports/blob/main/risc0-dec-24(Final).pdf
- SP1 repo: https://github.com/succinctlabs/sp1
- Succinct — "Introducing SP1": https://blog.succinct.xyz/introducing-sp1/
- Succinct — "SP1 Hypercube real-time proving": https://blog.succinct.xyz/real-time-proving-16-gpus/
- Succinct — "Optimized bn254 & bls12-381 Precompiles in SP1": https://blog.succinct.xyz/succinctshipsprecompiles/
- Noir docs: https://noir-lang.org/docs/
- Noir 1.0 pre-release: https://aztec.network/blog/the-future-of-zk-development-is-here-announcing-the-noir-1-0-pre-release
- Noir Beta announcement: https://aztec.network/blog/announcing-noir-beta-stable-fast-zk-applications-in-the-browser
- Barretenberg docs: https://barretenberg.aztec.network/docs/
- gnark repo: https://github.com/Consensys/gnark
- gnark releases: https://github.com/Consensys/gnark/releases
- gnark-crypto: https://pkg.go.dev/github.com/consensys/gnark-crypto
- arkworks org: https://github.com/arkworks-rs
- arkworks website: https://arkworks.rs/
- Circom repo: https://github.com/iden3/circom
- snarkjs repo: https://github.com/iden3/snarkjs
- rapidsnark: https://github.com/iden3/rapidsnark
- a16z zkVM benchmarks: https://github.com/a16z/zkvm-benchmarks
- zkVM benchmarks aggregator: https://zkbenchmarks.com/
- Nethermind zkvm-benchmarks: https://github.com/NethermindEth/zkvm-benchmarks
- "SoK: Understanding zkVM" (eprint 2026/525): https://eprint.iacr.org/2026/525.pdf
- Verify Ed25519 cheaply (NEAR Rainbow / Electron Labs): https://ethresear.ch/t/verify-ed25519-signatures-cheaply-on-eth-using-zk-snarks/13139
- Electron Labs — "zk-Ed25519: Underlying Mathematics": https://medium.com/electron-labs/zk-ed25519-underlying-mathematics-8d4f64d9431b
- ZKPROV (LLM dataset provenance, 2025): https://arxiv.org/html/2506.20915v1
- "Verifiable Provenance of Software Artifacts with Zero-Knowledge Compilation": https://arxiv.org/html/2602.11887
10. Final position
The honest framing is this:
- HERALD's required ZK statements (S1–S5+) can be expressed in every library surveyed. The capability question is settled.
- The choice between libraries is a values + cost decision, not a feasibility decision. Transparent vs. ceremony, prover-side resource budget, browser/mobile feasibility, audit-confidence, developer ergonomics — these are the tradeoffs.
- The two-track recommendation (SP1 for shipping fast; Halo2-IPA or Plonky2 for per-envelope cost optimisation) is robust to the next 12–24 months of library evolution. Both tracks lead to a working
provenance_proofenvelope. - Trusted-setup avoidance is a values constraint that excludes some otherwise-strong options (PSE Halo2, gnark Groth16, Barretenberg as default). Honesty: "we accept a one-time ceremony" is a viable position that should be debated openly, not adopted by default.
- The
provenance_proofenvelope class is feasible. The question is no longer "can it be built?" — it is "which library, on which timeline, with whose audit budget, under what governance posture?"
Recommendation 19 in [02-redteam] (promote ZK from open question to Phase-1 deliverable) is technically sound on 2026-05 evidence. The protocol's case for not doing this work is now substantially weaker than it was in 2024. ZK provenance proofs should move from "research direction" to "scoped engineering project with a measurable deliverable" in v0.3+.