TL;DR
Researchers have developed Circuzz, the first systematic fuzzing tool designed to find logic bugs in the complex pipelines that power Zero-Knowledge (ZK) protocols. By using metamorphic testing to ensure that semantically identical circuits produce identical results, the tool uncovered 16 critical bugs across four major ZK frameworks, 15 of which have already been fixed by developers.
What Problem Does This Paper Address?
Zero-Knowledge (ZK) protocols allow a "prover" to convince a "verifier" that a statement is true without revealing any underlying secrets. These protocols are the backbone of modern privacy-preserving tech, from anonymous voting to blockchains like Linea, which secures hundreds of millions of dollars in assets.
However, the "pipelines" that process these ZK circuits are incredibly complex. As shown in Figure 1, a pipeline involves a compiler, a witness generator, a prover, and a verifier.

A logic bug in any of these stages could be catastrophic—either allowing an attacker to forge a proof (unsoundness) or preventing a valid proof from being accepted (incompleteness). Traditional formal verification is often too expensive for these rapidly evolving systems, leaving a massive security gap in the infrastructure of decentralized finance.
Methods
The authors introduce Circuzz, a fuzzer that uses metamorphic testing. The core idea is simple but powerful: if you take a circuit and change its structure without changing its meaning (e.g., swapping a + b to b + a), the ZK pipeline should still produce the same result.
The Circuzz workflow follows five steps:
- Circuit Generation: It creates random circuits using a custom intermediate language called CircIL.
- Circuit Transformation: It applies a sequence of 87 rewrite rules (like associativity or identity properties) to create a semantically equivalent but syntactically different version of the circuit.
- Circuit Translation: It translates both the original and transformed circuits into a target ZK language (like Circom or Noir).
- Input Generation: It generates random public and private inputs.
- Bug Detection: It runs both circuits through the entire ZK pipeline and checks for any discrepancies in the outputs, witnesses, or proofs.

To handle the fact that generating ZK proofs is computationally expensive, the authors implemented a "power schedule" that dynamically balances time spent on fast stages (compilation) versus slow stages (proving).
Datasets
The authors evaluated Circuzz by testing four popular and diverse ZK pipelines:
- Circom: An imperative, low-level circuit language.
- Corset: A functional, Lisp-like language used for the Linea blockchain.
- Gnark: A Go-based library for high-performance ZK-SNARKs.
- Noir: A Rust-like, strongly-typed language for ZK programs.
Key Insights and Ideas
- The "Oracle" Problem Solved: In compiler testing, it's hard to know what the "correct" output should be for a random program. By using metamorphic transformations, Circuzz creates its own "ground truth"—the two circuits must behave identically.
- Bugs in the "Sugar": Many bugs weren't in the core math, but in the "syntactic sugar" or constant handling. For example, one bug in Circom occurred because it failed to apply a modulo operation to constants before using them in bitwise expressions.
- Cross-Language Generality: By using an intermediate language (CircIL), the researchers proved that a single fuzzing strategy can be applied to vastly different ZK architectures, from Lisp-based to Rust-based systems.
- Efficiency via Scheduling: Because ZK proving can take minutes while compilation takes milliseconds, the "power schedule" optimization was essential to keep the fuzzer from getting bogged down in slow proof generations for every single test case.
Key Results
- 16 Unique Logic Bugs: Circuzz found critical issues in all four tested pipelines.
- High Impact: 15 of the 16 bugs were confirmed and fixed by the developers within months.
- Efficiency: For 13 out of 15 bugs, the median time to find the bug was less than one hour.
- Diversity of Bugs: The tool found issues ranging from "polynomial is not divisible" errors in Circom to stack overflows in Noir and incorrect handling of nested
ifconditions in Corset.
Limitations and Future Work
While highly effective, Circuzz currently relies on blackbox fuzzing for input generation. This means it might struggle to find bugs that require very specific, highly-constrained inputs to trigger. The authors suggest that moving toward greybox (coverage-guided) or whitebox (constraint-solving) input generation could uncover even deeper logic errors.
Additionally, the authors plan to expand the tool to test the verification stage more rigorously, such as testing the Solidity contracts that Gnark generates for on-chain proof verification.
Summary updated