Noir Circuit Optimizer: Constraint Reduction Tooling for Efficient Proof Generation #8590
Replies: 2 comments 2 replies
-
Hi @Mikerah, thanks for submitting the proposal! The project sounds very interesting. Intuitively feels like some of the features might exist in the Noir compiler, while some could be immensely powerful, but don't think I understand them enough to tell and share thoughts upon. Great if the proposal could elaborate on the designs and expected behaviors of the features involved! |
Beta Was this translation helpful? Give feedback.
-
Hey @Savio-Sou, thank you for the feedback. Indeed, as any compiler would have, the Noir compiler does do some optimization for a given Noir circuit. However, sometimes, we end up having to optimize the circuit beyond what the compiler itself can provide. It's actually one of the parts that takes us the longest when using Noir. We plan to essentially adapt current R&D for optimizing Plonkish circuits (e.g. Clap) and do our own research for circuit optimization techniques to integrate into this tool. Our current direction involves looking at logic optimization techniques to see which ones can be applied directly to Plonkish circuits like that of Noir. From this, we aim to provide a basic set of optimization techniques for free. Then for the more complicated techniques, we aim to provide this at an extra cost as these tend to actually take more time to run and incur more of a cost, both in terms of R&D and hardware resources. Over time, we expect to not only build a circuit optimization tool for Noir but also a benchmarking platform as well. Please let me know if you have any more questions! |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Summary
We propose developing a Circuit Optimizer for Noir, directly addressing developer pain points related to excessive circuit sizes and proving inefficiencies. The optimizer will apply foundational optimizations (constant folding, dead code elimination, sub-expression elimination) and advanced global optimizations (constraint pruning, custom gate synthesis, backend-specific transformations) to substantially reduce constraint counts. Initially, we will release these foundational optimizations open-source, with more advanced optimizations provided via a sustainable usage-based API. The tool will integrate seamlessly into Noir’s existing compilation pipeline, initially as a CLI tool, subsequently supporting APIs in Rust, JS, TS, and Python, significantly enhancing Noir's usability and accessibility for developers.
Motivation
Noir dramatically simplifies ZK circuit development but the resulting circuits can end up larger than custom designed circuits. This can lead to longer proving times and more time spent optimizing and debugging Noir circuits.
From our past experience with Noir and by speaking with prospective users of Noir, we found this to be a bottleneck in terms of developers wanting to adopt Noir for their own use cases. Previous tools like Circom and Clap have demonstrated the efficacy of systematic optimization methods in significantly reducing constraints. A dedicated optimizer tailored specifically to Noir's PLONKish arithmetic circuits is necessary to address these critical bottlenecks systematically.
Methodology
We will implement a multi-stage optimization pipeline:
The implementation will leverage Rust for core integration and performance, initially providing a CLI tool, followed by exposing APIs via JS, TS, and Python. Rigorous testing and continuous integration will ensure correctness and performance.
Business Model
Our sustainable funding model includes:
Timeline and Deliverables
Deliverables:
Team
HashCloak Inc.
Start Date
1 June 2025
Questions
No outstanding questions at this time.
Beta Was this translation helpful? Give feedback.
All reactions