Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Noir toolchain integration

How crucible-prover uses the Noir toolchain: which binaries exist today, what the Rust adapters own, and which boundaries the circuit workspace is developed against.

Toolchain split (read this first)

Modern Noir (1.0.0-beta.x, the version this repo is developed against) split proving out of nargo:

StageToolProduces
Compilenargo compileACIR circuit artifacts (target/<pkg>.json)
Executenargo executea solved witness from Prover.toml inputs
Metricsnargo infoper-function ACIR/Brillig opcode counts
Unit testsnargo testin-circuit #[test] execution
Provebb prove (Barretenberg)the actual ZK proof
Verifybb verify (Barretenberg)proof acceptance against a VK

nargo prove / nargo verify no longer exist as subcommands. The Rust adapter split follows the tool split:

  • crucible-noir ends at artifacts + witnesses (compile, execute, info, artifact parsing, version checks). It never shells out to a prover.
  • Real UltraHonk proving belongs to the Barretenberg bb backend, executed through crucible-ultrahonk (BbToolchain + prove/verify in exec); see docs/ultrahonk.md for the validated nargo × bb pairing, the CLI surface the adapter drives, and the live test coverage.

Requiring bb is also why nargo test output — which runs the circuits on an in-process interpreter — is not a substitute for real proofs, only for witness-solvability checks.

Repository layout

The circuit workspace is independent of the Cargo workspace, mirroring the OpenZeppelin stellar-contracts model: circuits/ is its own nargo workspace and the Rust crates consume its outputs. See circuits/README.md for the package layout and commands.

Committed artifacts vs. build output

circuits/target/ holds compiled ACIR and solved witnesses; it is gitignored and rebuilt by CI. What is committed:

  • the Noir source (src/),
  • one synthetic valid test vector per operation circuit (<op>/testdata/Prover.toml), re-included in .gitignore deliberately — these are public fixtures with sample keys only.

Every other Prover.toml is gitignored: witness files can carry real private values and must never land in Git history. This is the same rule the crucible-witness crate enforces for Rust-side witnesses.

Version pinning

Every package declares compiler_version = ">=1.0.0" in its Nargo.toml and nargo enforces it. scripts/check-circuits.sh reports the toolchain version; CI installs via noirup and runs the circuit suites.

Nargo-driven integration tests

crates/noir has integration tests that run a live nargo compile / nargo execute against a scratch project to validate the adapter’s CLI surface, artifact parsing, and witness plumbing. Those tests are the only place in the Rust workspace that requires nargo on PATH; they are gated accordingly (see scripts/check-circuits.sh).