Table of Contents
Fetching ...

Towards Fuzzing Zero-Knowledge Proof Circuits (Short Paper)

Stefanos Chaliasos, Imam Al-Fath, Alastair Donaldson

TL;DR

This paper investigates applying fuzzing to zero-knowledge proof (ZKP) circuits, identifying fundamental challenges such as test oracles, witness generation, and performance, and proposing practical strategies including differential testing, invariant-based oracles, and hybrid methods. It demonstrates the approach with a case study on zk-regex (via zk-email workflows), where a grammar-based fuzzer and differential testing against a reference regex implementation uncovered 13 bugs, all confirmed by developers. The work positions fuzzing as a valuable complement to formal verification and static analysis for improving the reliability and security of ZKP circuits, and outlines open problems and future directions to enhance coverage and cross-DSL applicability. Overall, the paper provides a concrete methodology for fuzzing ZKP circuits and presents compelling evidence of its effectiveness in detecting meaningful bugs in real-world ZKP tooling.

Abstract

Zero-knowledge proofs (ZKPs) have evolved from a theoretical cryptographic concept into a powerful tool for implementing privacy-preserving and verifiable applications without requiring trust assumptions. Despite significant progress in the field, implementing and using ZKPs via \emph{ZKP circuits} remains challenging, leading to numerous bugs that affect ZKP circuits in practice, and \emph{fuzzing} remains largely unexplored as a method to detect bugs in ZKP circuits. We discuss the unique challenges of applying fuzzing to ZKP circuits, examine the oracle problem and its potential solutions, and propose techniques for input generation and test harness construction. We demonstrate that fuzzing can be effective in this domain by implementing a fuzzer for \texttt{zk-regex}, a cornerstone library in modern ZKP applications. In our case study, we discovered \textit{$10$} new bugs that have been confirmed by the developers.

Towards Fuzzing Zero-Knowledge Proof Circuits (Short Paper)

TL;DR

This paper investigates applying fuzzing to zero-knowledge proof (ZKP) circuits, identifying fundamental challenges such as test oracles, witness generation, and performance, and proposing practical strategies including differential testing, invariant-based oracles, and hybrid methods. It demonstrates the approach with a case study on zk-regex (via zk-email workflows), where a grammar-based fuzzer and differential testing against a reference regex implementation uncovered 13 bugs, all confirmed by developers. The work positions fuzzing as a valuable complement to formal verification and static analysis for improving the reliability and security of ZKP circuits, and outlines open problems and future directions to enhance coverage and cross-DSL applicability. Overall, the paper provides a concrete methodology for fuzzing ZKP circuits and presents compelling evidence of its effectiveness in detecting meaningful bugs in real-world ZKP tooling.

Abstract

Zero-knowledge proofs (ZKPs) have evolved from a theoretical cryptographic concept into a powerful tool for implementing privacy-preserving and verifiable applications without requiring trust assumptions. Despite significant progress in the field, implementing and using ZKPs via \emph{ZKP circuits} remains challenging, leading to numerous bugs that affect ZKP circuits in practice, and \emph{fuzzing} remains largely unexplored as a method to detect bugs in ZKP circuits. We discuss the unique challenges of applying fuzzing to ZKP circuits, examine the oracle problem and its potential solutions, and propose techniques for input generation and test harness construction. We demonstrate that fuzzing can be effective in this domain by implementing a fuzzer for \texttt{zk-regex}, a cornerstone library in modern ZKP applications. In our case study, we discovered \textit{} new bugs that have been confirmed by the developers.

Paper Structure

This paper contains 9 sections, 6 figures, 2 tables.

Figures (6)

  • Figure 1: MontgomeryAdd circuit, with a witness sketch and the constraints generated from the circuit
  • Figure 2: Four Circom multiplier examples, illustrating a correct circuit and various kinds of error
  • Figure 3: Simplified compilation and proof generation pipeline of ZKP circuits
  • Figure 4: Fuzzing ZKP circuits
  • Figure 5: Workflow of a mutation-based approach for finding soundness bugs, and a hybrid approach that can be used to improve symbolic and static analyses to detect soundness bugs
  • ...and 1 more figures