A zero-knowledge proof (ZKP) lets one party (the prover) convince another party (the verifier) that a statement is true, without revealing any information beyond the truth of the statement itself. The classic example: Alice wants to prove she knows the solution to a puzzle without showing Bob the solution. A ZKP lets her generate a short piece of evidence — the proof — that convinces Bob she knows it, while Bob learns nothing about what the solution actually is.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.
The prover and verifier
Every ZK system involves two roles:| Role | Responsibility |
|---|---|
| Prover | Has access to private inputs (the “secret”). Runs the computation and generates a proof. |
| Verifier | Has access to public inputs only. Checks the proof is valid — fast, regardless of how complex the original computation was. |
Private and public inputs
Noir programs distinguish between two kinds of inputs:- Private inputs — known only to the prover. They appear in the proof but are cryptographically hidden from the verifier.
- Public inputs — known to both prover and verifier. They appear as plain values alongside the proof.
x is private and y is public. The proof demonstrates that the prover knows some x that differs from the publicly visible y, without revealing what x is.
SNARKs
ZK proof systems used in practice are almost always SNARKs: Succinct Non-interactive ARguments of Knowledge. Each word matters:- Succinct — the proof is short (a few hundred bytes) and fast to verify, regardless of the size of the computation.
- Non-interactive — the prover sends a single message. There is no back-and-forth challenge protocol.
- Argument of Knowledge — soundness holds under cryptographic assumptions. A prover who doesn’t actually know the witness cannot forge a valid proof (except with negligible probability).
How Noir programs become circuits
Zero-knowledge proofs operate over arithmetic circuits — networks of addition and multiplication gates over a finite field. Proving a computation means proving that a particular assignment of values to wires satisfies all the gates. Writing circuits by hand is error-prone and difficult. Noir handles this automatically:Write Noir source
You write ordinary-looking Rust-inspired code. Noir’s type system and syntax abstract away the underlying mathematics.
Compile to ACIR
The Noir compiler lowers your program to ACIR (Abstract Circuit Intermediate Representation), a backend-agnostic format consisting of arithmetic constraints and black-box function calls.
Backend generates a circuit
The proving backend (e.g., Barretenberg) translates ACIR into its native constraint system (UltraPlonk gates, lookup tables, etc.).
Witness generation
Given the private and public inputs, the prover evaluates the circuit to assign a concrete value to every wire. This assignment is the witness.
Proof generation
The backend uses the witness to produce a SNARK proof: a compact cryptographic commitment to the witness that can be verified without seeing the witness itself.
Circuit efficiency
Unlike conventional programs, the cost of a ZK circuit is proportional to its gate count, not its execution time. A loop that runs 1000 iterations generates 1000 times the gates of a single iteration. This changes how you think about optimization. Key principles for writing efficient Noir circuits:- Prefer arithmetic operations (
+,*) over bitwise operations (<<,|), which require many more gates. - Prefer the
Fieldtype over fixed-width integers where possible — integer range checks add gates. - Move expensive computation into
unconstrainedfunctions and verify the result cheaply inside the circuit. - Keep loop bodies and conditional branches as simple as possible.
Common use cases
Private authentication
Private authentication
Prove you know a password, private key, or secret — without revealing it. A ZKP lets a server verify the claim without storing the secret or learning it during authentication.
On-chain voting
On-chain voting
Prove you are an eligible voter and have not yet voted, without linking your identity to your choice. The vote is cast anonymously while eligibility is publicly verified.
Identity and credential verification
Identity and credential verification
Prove membership in a set (e.g., KYC-verified users, NFT holders, DAO members) without revealing which member you are or any identifying attributes.
Private transactions
Private transactions
Prove that a transaction is valid — inputs equal outputs, all values are positive, the sender has sufficient balance — without revealing the amounts or addresses involved.
Aztec contracts
Aztec contracts
Noir powers smart contracts on the Aztec network, where private state and private function execution are enforced by ZK proofs generated from Noir programs.
Recursive proof aggregation
Recursive proof aggregation
Verify the proof of a Noir program inside another Noir program. This enables batching many proofs into one, reducing the cost of on-chain verification. See the recursion standard library.