Skip to content
For the complete documentation index, see llms.txt. This page is also available as Markdown.

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.0 or npm i @noir-lang/noir_js@1.0.0)

  • Barretenberg 6.0.0 (install with bbup --version 6.0.0 or npm 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 build

This 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/honk

-t evm selects the Ultra Keccak ZK flavor. Other targets produce different keys or transcripts. Generate the key and proof with the same target.

Finally, 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 proof

  • target/honk/public_inputs - the public inputs

This verifier accepts Ultra Keccak ZK proofs. The evm-no-zk, noir-recursive, and starknet targets do not produce receipts for this endpoint.

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:

Using garaga calldata with the --format array lets you paste this array in cairo code for unit tests by doing let proof: Array<felt252> = [...];. The --format starkli has a formatting which is composable with starkli in the command line and also prepends the length of the array so that it can be deserialized by starknet. The --format snforge (default) creates a file that can be used with snforge.

Add the Rust Crate to your project.

Using the garaga Npm package

Using the garaga Python package

BB CLI Reference

Use bb write_vk --help and bb prove --help to see all available options.

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

  1. Generate & deploy an UltraHonk proof verifier to a local Starknet devnet.

  2. Add on‑chain state to your privacy‑preserving app.

  3. 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