Noir Verifier
Toolchain
Garaga CLI built from the source revision that generates the Cairo contract.
Noir 1.0.0 (install with
noirup --version 1.0.0ornpm i @noir-lang/noir_js@1.0.0)Barretenberg 6.0.0 (install with
bbup --version 6.0.0ornpm i @aztec-foundation/bb.js@6.0.0)
Until this integration is released, install Garaga from this checkout:
uv pip install -e .To install noirup and bbup, follow the quickstart guide from aztec.
Generate a Starknet smart contract for your Noir program
First, create a new Noir project and compile it with nargo build.
nargo new hello
cd hello
nargo buildThis will create a json file in hello/target/hello.json
Now, generate the corresponding verifying key vk using barretenberg:
bb write_vk -t evm -b target/hello.json -o target/honkFinally, generate a smart contract from the verifying key using the garaga CLI.
This will create a smart contract folder with the following structure.
The main function of interest is located in honk_verifier.cairo
The contract interface will be
In order to interact with the endpoint, we need to generate the full_proof_with_hints array.
To do so, we need a specific proof for your program. But first, Noir requires to specify the inputs of the program in hello/Prover.toml
Now, generate a proof with barretenberg:
This writes the proof, public inputs, key, and key hash in target/honk/:
target/honk/proof- the ZK prooftarget/honk/public_inputs- the public inputs
Generating the calldata (full_proof_with_hints array)
Finalizing the above CLI example, you can obtain the full_proof_with_hints array using the garaga CLI. From within the "hello" directory:
Add the Rust Crate to your project.
Using the garaga Npm package
Using the garaga Python package
BB CLI Reference
Verification Key Generation:
Proof Generation (ZK mode is default):
Proof Verification (optional, for local testing):
Version migration and proof artifacts
Barretenberg 6 changes the proof layout, entity order, relation parameters, and transcript challenges. Regenerate verification keys, proofs, calldata, and Cairo contracts together. Old verifier classes cannot verify these receipts.
The verifier validates canonical scalar values, point coordinates, and accumulator limbs. It aggregates nondefault recursive pairing accumulators before the final pairing check. The generated contract tests include public outputs and rejection cases.
From the Garaga repository, regenerate the example, memory, and recursive proof bundles with:
The recursive fixture verifies the example circuit with an SDK-generated inner proof. The regeneration command updates its inner key constant and witness before the outer proof. Proof generation is explicit and changes the stored artifacts.
Verify the stored artifacts without proof generation:
This command compiles the Noir sources, rebuilds their verification keys, and compares the keys with the stored artifacts. It also verifies the stored proofs with the pinned Barretenberg CLI and rejects modified receipts. The Noir CI workflow runs this command. Python tests compare the Python and Rust calldata with the generated Cairo fixtures.
See the Cairo measurements for steps, Sierra gas, contract size, and profiling results.
Complete dApp Tutorial
Follow the Scaffold‑Garaga repository. This starter kit combines Noir, Garaga, and Starknet with in‑browser proving to help you ship a privacy‑preserving dApp fast.
What you'll learn
Generate & deploy an UltraHonk proof verifier to a local Starknet devnet.
Add on‑chain state to your privacy‑preserving app.
Connect a wallet and deploy to a public testnet.
Need Support ?
The Lean package proves the relation identities and conditional RLC guarantees. Its scope document lists the remaining obligations for complete verifier equivalence.
Last updated