Building with Noir: ZK Smart Contracts and Private Applications
Noir is Aztec's domain-specific language for writing zero-knowledge proofs. This guide covers what it is, how to write circuits, and how it enables private blockchain applications.
Noir is a domain-specific language for writing zero-knowledge circuits — programs that can prove computation was executed correctly without revealing the inputs. It's developed by Aztec and is the foundation for Aztec Network's private Layer 2. But Noir is also useful beyond Aztec — you can compile Noir circuits that verify on any EVM chain.
What ZK Proofs Enable
Zero-knowledge proofs let you prove you know something without revealing what you know. For blockchains: prove you're over 18 without revealing your birthdate, prove you have enough balance to cover a transaction without revealing your balance, prove you participated in a vote without revealing how you voted, prove a computation was executed correctly without re-running it. These properties enable private, verifiable applications impossible with standard smart contracts.
Noir Basics
Noir syntax is inspired by Rust. You write functions that operate on witnesses (private inputs) and public inputs. The compiler converts your Noir code to an arithmetic circuit, then to a ZK proof system (currently Barretenberg, a PLONK-based system from Aztec). The proof can be verified on-chain by a Solidity verifier contract that Noir generates.
Private vs Public Inputs
In Noir, inputs are either public (part of the proof statement, visible to verifiers) or private (witnesses, known only to the prover). The circuit defines relationships between them that must hold. Example: private input = my balance (10 ETH), public input = minimum threshold (5 ETH). Circuit: assert balance >= threshold. The verifier confirms this holds without learning the actual balance.
Common Noir Use Cases
Private payments: prove you have sufficient funds without on-chain balance tracking. Merkle inclusion proofs: prove membership in a set (allowlists, eligible voters) without revealing which member you are. Age/identity verification: prove attribute satisfies condition without revealing the attribute. Recursive proofs: prove that you correctly computed a chain of state transitions (used for ZK rollups). Private gaming: prove game state transitions are valid without revealing game state.
Aztec Network
Aztec is building a private Ethereum L2 using Noir. Their model: smart contracts can have private state (encrypted on-chain, readable only by the owner) alongside public state. Users prove transactions are valid using Noir circuits. The result: DeFi applications with genuinely private user data — your positions, balances, and transaction history aren't visible on-chain.
Getting Started with Noir
Install Noir via Noirup. Create a circuit with nargo new. Write your Noir program. Generate a proof with nargo prove. Verify with nargo verify. For Ethereum integration: use the Solidity verifier generated by nargo. The Noir documentation (noir-lang.org) is well-maintained. The Aztec community Discord has active support. noir-starter on GitHub has example circuits for common patterns.
Proof Generation Performance
Proof generation is computationally expensive — expect 1–60 seconds per proof depending on circuit complexity on modern hardware. For consumer applications, this is done on the client side (user's browser or device). WASM-compiled Barretenberg runs in browsers, but generating proofs for complex circuits can take 10–30 seconds. For circuits where latency matters, optimize for minimal constraint count (simpler logic = faster proofs).
Frequently Asked Questions
Related Guides
Ready to build your Web3 project?
Tell us about your project and get a precise quote.
Get a Project Quote