arXiv:2405.12115
arXiv Year 2024 Peer-reviewed
Programming Languages · Static Analysis

Clap: a Rust eDSL for PlonKish Proof Systems with a Semantics-preserving Optimizing Compiler

Marco Stronati Denis Firsov Antonio Locascio Benjamin Livshits
2024
Publication year
arXiv
Venue
Preprint
Type

Problem

Plonkish is a popular circuit format for developing zero-knowledge proof systems that powers a number of major projects in the blockchain space, responsible for holding billions of dollars and processing millions of transactions per day. These projects, including zero-knowledge rollups, rely on highly hand-optimized circuits whose correctness comes at the cost of time-consuming testing and auditing.

Approach

In this paper, we present Clap, the first Rust eDSL with a proof system agnostic circuit format, facilitating extensibility, automatic optimizations, and formal assurances for the resultant constraint system. Clap casts the problem of producing Plonkish constraint systems and their witness generators as a semantic-preserving compilation problem.

Results

Soundness and completeness of the transformation guarantees the absence of subtle bugs caused by under- or over-constraining. Our experimental evaluation shows that its automatic optimizations achieve better performance compared to manual circuit optimization. The optimizer can also be used to automatically derive custom gates from circuit descriptions.

Cite this paper — BibTeX
@TechReport{arxiv240512115,
  title = "{Clap: a Rust eDSL for PlonKish Proof Systems with a Semantics-preserving Optimizing Compiler}",
  author = "Marco Stronati and Denis Firsov and Antonio Locascio and Benjamin Livshits",
  year = "2024",
  month = may,
  institution = "arXiv",
  number = "arXiv:2405.12115",
}
Copied