ACIR to R1CS transpiler. ACVM Backend Gnark. #8547
Replies: 2 comments 2 replies
-
I have used pluto/edge to compile noir circuits into a R1CS representation for SuperNova folding scheme. I suggest you to refer to this repo. |
Beta Was this translation helpful? Give feedback.
-
Hi @Alex-distributed-lab, thanks for submitting the proposal! Reads good overall, where my main recommendation is to think and elaborate on possible business models. Might be tricky, but having seen proving backends fell out of date as they ran out of funding makes this perhaps even the most critical problem to solve imo. Feel free to share if you have ideas, even if they are rough and uncertain; happy to help brainstorm further together! |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
ACIR to R1CS transpiler. ACVM Backend Gnark.
Summary
We propose implementing a CLI utility that may serve as either a standalone binary for solely the purposes of R1CS formation or a full-fledged ACVM backend with the Gnark library in the role of engine.
Motivation
Given Noir’s status as one of the leading ZK DSLs, an increasing number of projects are adopting it as their primary circuit development solution. Concurrently, there remains substantial interest in R1CS systems, such as Groth16, for specific applications. This preference is driven by established on-chain contracts, existing libraries, performance considerations, cost efficiency, proof compression techniques, and other critical factors.
Projects such as Bionetta exemplify this focus on optimizing R1CS arithmetization efficiency. Currently, the integration of Noir within such systems is limited due to the absence of readily available solutions.
The selection of the Gnark library is based on its recognized robustness, particularly in terms of performance and maintainability.
Methodology
Rust CLI binary may be implemented to accept Noir’s program compilation artifact and execution’s compressed witness. This binary will transform extracted ACIR into R1CS and may save it in a format acceptable to Gnark’s interfaces.
Extending this crate may be complemented with FFI calls to the Go module, which will enable serving proving/verifying commands under the Groth16 system, available in the Gnark library over the BN254 curve.
We propose the following architecture specification diagram:
As per the transpilation process of fundamental Expression Noir’s type, we propose encoding each multiplication term as one rank-1 constraint, while accumulating them with linear combinations and a constant term in another rank-1 constraint. This strategy requires us to shift witness indices, accounting for each multiplication term’s product internal witness and shift for the coefficient one-value.
Timeline and Deliverables
Development of an MVP implementing the AssertZero opcode for basic single-circuit Noir programs, establishing an end-to-end workflow with ACVM Backend Gnark.
Implementation of FunctionCall opcode support, enabling multiple circuit functionality.
Research and development of gate elimination optimizations.
Investigation into the black box function support.
Integration of blackbox functions within the ACVM Backend Gnark.
Team
Distributed Lab
[email protected]
Start Date
26.05.25
Beta Was this translation helpful? Give feedback.
All reactions