2/5
## Your First Zero-Knowledge Project: A Noir Journey Welcome to your first foray into building with Zero-Knowledge (ZK) proofs! In this initial project, we'll construct a very simple ZK application from the ground up. This hands-on experience is designed to familiarize you with the complete lifecycle of a ZK project. We will cover: 1. **Building a circuit from scratch:** Defining the logic of our ZK program. 2. **Compiling the circuit:** Transforming our human-readable code into a format understandable by proving systems. 3. **Executing the circuit:** Running the compiled program with specific inputs. 4. **Generating a witness:** Producing the set of all values (public and private) that satisfy the circuit's constraints during execution. 5. **Generating a proof:** Creating a succinct cryptographic proof that the circuit was executed correctly with the given witness. 6. **Verifying the proof:** Checking the validity of the generated proof without needing access to the private inputs. By stepping through each of these stages, from installation to final proof verification, you'll gain a solid understanding of the fundamental structure and workflow underpinning ZK projects. This foundational knowledge is crucial as you progress towards building more complex and sophisticated ZK protocols. ## Understanding Noir: The Language for Private Computation At the heart of our ZK development journey is Noir, a specialized programming language. You can find its official home at `noir-lang.org`. Noir is developed by the Aztec team and is specifically engineered for "private and verifiable computing." Its primary purpose is to empower developers to create succinct proofs demonstrating the successful execution of a program. Let's break down some core concepts associated with Noir: * **Proofs of Execution:** Noir focuses on generating proofs that a program ran correctly. This builds upon the idea that by proving correct execution, you implicitly prove knowledge of the private and public inputs that satisfy the program's defined constraints. This distinguishes it from more general proofs of knowledge. * **Domain Specific Language (DSL):** Noir is a DSL tailored for writing ZK circuits, particularly for SNARK (Succinct Non-interactive ARgument of Knowledge) proving systems. This means its design and features are optimized for this specific task. * **ACIR (Arithmetic Circuit Intermediate Representation):** A key feature of Noir is its compilation to ACIR. ACIR is an intermediate representation that standardizes the circuit's logic. This abstraction makes Noir **backend-agnostic**. The compiled ACIR can be used with various proving systems or "backends." For instance, while this course will utilize Aztec's Plonk-based Barretenberg backend, the same Noir code (compiled to ACIR) could potentially be used with a Groth16 backend or others compatible with ACIR. * **Rust Influence:** Developers familiar with Rust will find Noir's syntax quite accessible. Noir's design choices are heavily influenced by Rust, leading to a similar feel and structure in the code. ## Navigating the Noir Documentation: Your Source of Truth As you delve into Noir, the official documentation, accessible via the "Read the Docs" button on `noir-lang.org`, will be your most reliable and up-to-date resource. Given the evolving nature of technologies like Noir, the documentation should always be considered the primary source of truth, especially if any course material becomes slightly outdated due to language updates. The documentation also reveals additional capabilities of Noir: * **Solidity Verifiers:** Noir can generate Solidity smart contracts. These contracts allow you to verify Noir proofs directly on-chain, which is crucial for many blockchain-based ZK applications. * **Full-Stack Development Support:** Aztec Labs provides libraries such as `Noir.js`. This library enables the integration of Noir proofs into JavaScript environments, facilitating their use in web applications, mobile apps, and games. We'll touch upon this briefly in a future section. For community support and to ask questions, the Aztec Discord server is an excellent resource. **A Note on Documentation Versioning:** The Noir documentation website features a version dropdown (initially, it might show a version like `v1.0.0-beta.3`). It's crucial to select the documentation version that aligns with the version of Noir being used in this course. This ensures consistency, as syntax or features can change between versions. It's important to be aware that Noir is an actively developed language. Since the recording of some course materials, Noir has seen updates. The documentation website now defaults to newer versions (e.g., `v1.0.0-beta.6` or `beta.5`). While efforts are made to ensure older documentation versions (like `beta.3`) remain accessible, this may not always be the case. For the most part, newer versions like `beta.6` should function similarly to `beta.3` for the initial parts of this course. There is one significant breaking change related to a dependency expected later, which will be explicitly addressed when we reach it. If you encounter discrepancies between the course content and the documentation, first check the course's GitHub discussions or seek assistance on the Noir Discord. ## Getting Started with Noir: Installation and Next Steps The Noir documentation contains a "Getting Started" section, and within that, a "Quick Start" guide. This guide provides a walkthrough of the installation process and basic workflow, which we will be following closely. Our initial setup will involve installing two main components: 1. **Noir (Nargo CLI):** * `Nargo` is the Command Line Interface (CLI) tool for Noir. * It's used to initiate new Noir projects, compile your Noir code, execute programs, and run tests, all from your terminal. * Installation is typically handled using `noirup`, a script detailed in the documentation (e.g., `curl -L https://raw.githubusercontent.com/noir-lang/noirup/refs/heads/main/install | bash; noirup`). 2. **Proving Backend (Barretenberg):** * Once Noir (via Nargo) is installed, you'll need a proving backend to actually work with your Noir programs. * Proving backends are what enable the generation of proofs, the verification of those proofs, and often, the generation of verifier smart contracts. * This course will utilize **Barretenberg**, a proving backend developed by Aztec Labs. * The installation for Barretenberg is usually done using `bbup`, another script (e.g., `curl -L https://raw.githubusercontent.com/AztecProtocol/aztec-packages/refs/heads/master/barretenberg/cpp/scripts/bbup.sh | bash; bbup`). Following these installations, our subsequent lessons will guide you through: * Installing Nargo. * Installing the Barretenberg proving backend. * Compiling and executing your first circuits. * Generating witnesses and proofs. * Verifying those proofs. * Generating a Solidity verifier contract. Many of these concepts will crystallize as you actively participate, write the code yourself, and observe how these different components interact. We encourage you to follow along with all the steps, experiment with the code, and consider pushing your projects to a GitHub repository. This hands-on approach is the most effective way to learn.
Welcome to your first foray into building with Zero-Knowledge (ZK) proofs! In this initial project, we'll construct a very simple ZK application from the ground up. This hands-on experience is designed to familiarize you with the complete lifecycle of a ZK project. We will cover:
Building a circuit from scratch: Defining the logic of our ZK program.
Compiling the circuit: Transforming our human-readable code into a format understandable by proving systems.
Executing the circuit: Running the compiled program with specific inputs.
Generating a witness: Producing the set of all values (public and private) that satisfy the circuit's constraints during execution.
Generating a proof: Creating a succinct cryptographic proof that the circuit was executed correctly with the given witness.
Verifying the proof: Checking the validity of the generated proof without needing access to the private inputs.
By stepping through each of these stages, from installation to final proof verification, you'll gain a solid understanding of the fundamental structure and workflow underpinning ZK projects. This foundational knowledge is crucial as you progress towards building more complex and sophisticated ZK protocols.
At the heart of our ZK development journey is Noir, a specialized programming language. You can find its official home at noir-lang.org
.
Noir is developed by the Aztec team and is specifically engineered for "private and verifiable computing." Its primary purpose is to empower developers to create succinct proofs demonstrating the successful execution of a program.
Let's break down some core concepts associated with Noir:
Proofs of Execution: Noir focuses on generating proofs that a program ran correctly. This builds upon the idea that by proving correct execution, you implicitly prove knowledge of the private and public inputs that satisfy the program's defined constraints. This distinguishes it from more general proofs of knowledge.
Domain Specific Language (DSL): Noir is a DSL tailored for writing ZK circuits, particularly for SNARK (Succinct Non-interactive ARgument of Knowledge) proving systems. This means its design and features are optimized for this specific task.
ACIR (Arithmetic Circuit Intermediate Representation): A key feature of Noir is its compilation to ACIR. ACIR is an intermediate representation that standardizes the circuit's logic. This abstraction makes Noir backend-agnostic. The compiled ACIR can be used with various proving systems or "backends." For instance, while this course will utilize Aztec's Plonk-based Barretenberg backend, the same Noir code (compiled to ACIR) could potentially be used with a Groth16 backend or others compatible with ACIR.
Rust Influence: Developers familiar with Rust will find Noir's syntax quite accessible. Noir's design choices are heavily influenced by Rust, leading to a similar feel and structure in the code.
As you delve into Noir, the official documentation, accessible via the "Read the Docs" button on noir-lang.org
, will be your most reliable and up-to-date resource. Given the evolving nature of technologies like Noir, the documentation should always be considered the primary source of truth, especially if any course material becomes slightly outdated due to language updates.
The documentation also reveals additional capabilities of Noir:
Solidity Verifiers: Noir can generate Solidity smart contracts. These contracts allow you to verify Noir proofs directly on-chain, which is crucial for many blockchain-based ZK applications.
Full-Stack Development Support: Aztec Labs provides libraries such as Noir.js
. This library enables the integration of Noir proofs into JavaScript environments, facilitating their use in web applications, mobile apps, and games. We'll touch upon this briefly in a future section.
For community support and to ask questions, the Aztec Discord server is an excellent resource.
A Note on Documentation Versioning:
The Noir documentation website features a version dropdown (initially, it might show a version like v1.0.0-beta.3
). It's crucial to select the documentation version that aligns with the version of Noir being used in this course. This ensures consistency, as syntax or features can change between versions.
It's important to be aware that Noir is an actively developed language. Since the recording of some course materials, Noir has seen updates. The documentation website now defaults to newer versions (e.g., v1.0.0-beta.6
or beta.5
). While efforts are made to ensure older documentation versions (like beta.3
) remain accessible, this may not always be the case.
For the most part, newer versions like beta.6
should function similarly to beta.3
for the initial parts of this course. There is one significant breaking change related to a dependency expected later, which will be explicitly addressed when we reach it. If you encounter discrepancies between the course content and the documentation, first check the course's GitHub discussions or seek assistance on the Noir Discord.
The Noir documentation contains a "Getting Started" section, and within that, a "Quick Start" guide. This guide provides a walkthrough of the installation process and basic workflow, which we will be following closely.
Our initial setup will involve installing two main components:
Noir (Nargo CLI):
Nargo
is the Command Line Interface (CLI) tool for Noir.
It's used to initiate new Noir projects, compile your Noir code, execute programs, and run tests, all from your terminal.
Installation is typically handled using noirup
, a script detailed in the documentation (e.g., curl -L https://raw.githubusercontent.com/noir-lang/noirup/refs/heads/main/install | bash; noirup
).
Proving Backend (Barretenberg):
Once Noir (via Nargo) is installed, you'll need a proving backend to actually work with your Noir programs.
Proving backends are what enable the generation of proofs, the verification of those proofs, and often, the generation of verifier smart contracts.
This course will utilize Barretenberg, a proving backend developed by Aztec Labs.
The installation for Barretenberg is usually done using bbup
, another script (e.g., curl -L https://raw.githubusercontent.com/AztecProtocol/aztec-packages/refs/heads/master/barretenberg/cpp/scripts/bbup.sh | bash; bbup
).
Following these installations, our subsequent lessons will guide you through:
Installing Nargo.
Installing the Barretenberg proving backend.
Compiling and executing your first circuits.
Generating witnesses and proofs.
Verifying those proofs.
Generating a Solidity verifier contract.
Many of these concepts will crystallize as you actively participate, write the code yourself, and observe how these different components interact. We encourage you to follow along with all the steps, experiment with the code, and consider pushing your projects to a GitHub repository. This hands-on approach is the most effective way to learn.
A pivotal first step to Your First Zero-Knowledge Project: A Noir Journey - Construct your initial ZK application from the ground up, experiencing the full development lifecycle from circuit creation to final proof verification. This lesson also introduces Noir, its key principles like ACIR, and guides you through installing the Nargo CLI and Barretenberg backend.
Previous lesson
Previous
Next lesson
Next
Give us feedback
Course Overview
About the course
Noir syntax
Create a witness, a proof, and Solidity verifier contracts
Use the Poseidon commitment scheme
Create ZK circuits and build a full ZK protocol
ZK Merkle trees and hashing in Noir
Verify signatures without revealing the signer
Build the backend for a full-stack ZK application with noir.js and bb.js
How to create proofs and verify them in a front-end
Last updated on June 12, 2025
Duration: 6min
Duration: 1h 11min
Duration: 2h 12min
Duration: 3h 19min
Course Overview
About the course
Noir syntax
Create a witness, a proof, and Solidity verifier contracts
Use the Poseidon commitment scheme
Create ZK circuits and build a full ZK protocol
ZK Merkle trees and hashing in Noir
Verify signatures without revealing the signer
Build the backend for a full-stack ZK application with noir.js and bb.js
How to create proofs and verify them in a front-end
Last updated on June 12, 2025