noir-optimize-acir

Optimize ACIR circuit size for Noir programs using nargo and bb.

1.4k|409|Updated Aug 4, 2020
One-click install
npx skills add https://github.com/noir-lang/noir --skill noir-optimize-acir
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: noir-optimize-acir
Source: https://github.com/noir-lang/noir/tree/main/.claude/skills/noir-optimize-acir
Command: npx skills add https://github.com/noir-lang/noir --skill noir-optimize-acir

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill provides a structured workflow to measure and minimize the ACIR circuit size of constrained Noir programs, reducing prover time and resource usage.

Core Features & Use Cases

  • ACIR size measurement: Baseline the circuit size for constrained Noir programs and compare with subsequent optimizations.
  • Iterative optimization: Apply single changes at a time and evaluate impact on circuit_size and acir_opcodes.
  • Real-world use: When optimizing for large circuits in privacy-preserving apps, e.g., reduce gate count in SNARK-backed computation.

Quick Start

Baseline the circuit by compiling the Noir project and measuring gates with nargo and bb, then iteratively apply a single optimization change, re-measure, and compare circuit_size and acir_opcodes.

Frequently Asked Questions about noir-optimize-acir

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I reduce ACIR circuit size for Noir programs?

You reduce ACIR circuit size by baselining the current circuit_size with the Noir toolchain, applying a single optimization change, re-compiling, and comparing the resulting acir_opcodes to evaluate the improvement.

What is the best way to measure circuit gates in a Noir project?

Measuring circuit gates in a Noir project requires compiling the code with nargo and measuring the output with bb to record baseline metrics like circuit_size and acir_opcodes for optimization comparison.

Do I need nargo and bb to optimize Noir circuit size?

Yes, optimizing Noir circuit size requires the nargo and bb toolchain components to compile the constrained program and accurately measure circuit_size and acir_opcodes across optimization iterations.

Why does my Noir ACIR circuit have a high gate count?

A high ACIR gate count in Noir programs often indicates unoptimized constrained logic, which you can minimize by applying iterative single optimizations and measuring the impact on acir_opcodes to reduce proving time.

Can I iteratively compare ACIR opcodes after applying Noir optimizations?

Yes, you can iteratively compare ACIR opcodes by applying a single optimization change at a time to your Noir program, recompiling with nargo, and recording the new acir_opcodes against the previous baseline.

What are the limitations of optimizing ACIR size for SNARK-backed computation?

Optimizing ACIR size for SNARK-backed computation requires a strict iterative approach, limiting changes to a single optimization per iteration to accurately attribute reductions in circuit_size and acir_opcodes.