This guide walks you through creating a Noir project, compiling it, and generating a witness — the input to a proving backend.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/noir-lang/noir/llms.txt
Use this file to discover all available pages before exploring further.
Prerequisites
Install Nargo before starting. See Installation for instructions.Create a project
Scaffold a new project
Use Nargo creates two files:
nargo new to create a project in a new directory:src/main.nr— the entry point for your Noir programNargo.toml— project configuration (name, type, dependencies)
Understand the boilerplate
Open In Noir, inputs are private by default. The
src/main.nr. The default program looks like this:pub keyword marks y as a public input — it is visible to the verifier. The assert constrains that x and y are not equal. A valid proof convinces a verifier of this fact without revealing the private value x.Generate Prover.toml
Navigate into the project directory and run This generates a
nargo check:Prover.toml file with placeholder entries for each input parameter:Fill in input values
Edit
Prover.toml to supply concrete values for x and y. They must satisfy the constraint x != y:Noir encodes all field element values as strings in TOML. Use quoted numeric strings for
Field and integer types.Compile and execute
Run This command:
nargo execute to compile your program and generate a witness:- Compiles the Noir program to
./target/hello_world.json - Executes the program with the inputs from
Prover.toml - Writes the witness to
./target/hello_world.gz
Next steps: connect a proving backend
Nargo compiles your program to ACIR and produces a witness, but it does not generate proofs itself. You need a proving backend for that. The most widely used backend for Noir is Barretenberg, which lets you:Generate and verify proofs
Create cryptographic proofs from your witness and verify them
Recursive proof aggregation
Prove the verification of another proof inside a Noir circuit
Solidity verifier contracts
Generate an on-chain verifier contract for your proof
Circuit size analysis
Inspect and compare the gate count of your compiled circuit