# Noir Language Documentation > The Universal ZK Circuit Language This file contains all documentation content in a single document following the llmstxt.org standard. ## Getting Started Manually ## Installing Nargo The Nargo CLI tool provides you the ability to create, compile, execute and test Noir programs from the terminal. Install Nargo by running this in your terminal: ```sh curl -L https://raw.githubusercontent.com/noir-lang/noirup/refs/heads/main/install | bash noirup ``` This installs `noirup`, the installation script, and runs it to install the latest version of Nargo. ## Creating a project Create a new Noir project named _hello\_world_: ```sh nargo new hello_world ``` This command creates a new _hello\_world_ project directory, in which contains _src/main.nr_ that hosts a simple Noir program asserting _x_ does not equal _y_. ## Executing the project Change directory into your _hello\_world_ project: ```sh cd hello_world ``` Generate a _Prover.toml_ input file for specifying input values: ```sh nargo check ``` This command generates a _Prover.toml_ file that hosts input values to be used when executing your Noir program. Specify valid values in the _Prover.toml_ file, for example: ```toml x = 1 y = 2 ``` Then compile and execute your Noir program: ```sh nargo execute ``` This command: 1. Compiles the Noir program into the _target/hello\_world.json_ circuit, and 2. Executes the Noir program with the specified inputs, and generates the _target/hello\_world.gz_ witness Both to be used when proving your Noir program. ## Proving the execution Noir is designed to be proving backend agnostic, which means you can choose to use different proving backends to prove and verify your Noir programs, hence the corresponding workflows could differ. Using Barretenberg as an example, first install `bb` its CLI tool: ```sh curl -L https://raw.githubusercontent.com/AztecProtocol/aztec-packages/refs/heads/next/barretenberg/bbup/install | bash bbup ``` Prove the execution of your Noir program: ```sh bb prove -b ./target/hello_world.json -w ./target/hello_world.gz --write_vk -o target ``` This command: 1. Proves the valid execution of your Noir program and generates the zero-knowledge proof _target/proof_, and 2. Generates the verification key of your Noir program _target/vk_ Both to be used when verifying your proof. ## Verifying the proof Verify your proof: ```sh bb verify -p ./target/proof -k ./target/vk ``` This command verifies validity of the zero-knowledge proof, and returns a success message if valid. In typical workflows, the prover who generates the proof and the verifier who verifies the proof are usually two different parties, where the verifier could verify the validity of the prover's proof without knowing the prover's private inputs, hence zero-knowledge. --- ## Getting Started with AI Paste this into your AI agent to get started: ``` Follow https://noir-lang.org/docs/getting_started_manually and walk me through creating and running my first Noir project step-by-step end-to-end (from installation to proof verification); explain what each step does ``` The prompt walks you through setting up and interacting with a basic Noir project. ## Installing MCP server Additionally, paste this into your AI agent to install Noir's MCP server: ``` If you support MCP, install Noir's MCP server following the instructions in https://github.com/noir-lang/mcp-server/blob/master/README.md#install; test and make sure it is properly installed and configured to be accessible whenever you would need it (e.g. answering Noir questions, writing Noir code) ``` The prompt installs [Noir's MCP server](https://github.com/noir-lang/mcp-server), which provides your AI agent with efficient access to Noir's repository, documentation, libraries, etc. --- ## Building a web app with Noir and Barretenberg NoirJS is a Typescript package meant to work both in a browser and a server environment. In this tutorial, we will combine NoirJS with Aztec's Barretenberg backend to build a simple web app. From here, you should get an idea of how to proceed with your own Noir projects. You can find the complete app code for this guide [here](https://github.com/noir-lang/tiny-noirjs-app). ## Dependencies Before we start, we want to make sure we have Node installed. If you don't have it already you can install it [here](https://nodejs.org/en/download), we recommend using [Yarn](https://yarnpkg.com/getting-started/install) as our package manager for this tutorial. We'll also need version 1.0.0-beta.20 nargo installed, see the Noir [installation guide](../installation.md) for details. We'll keep this barebones. Doing the bare minimum is not only simple, but also allows you to easily adapt it to almost any frontend framework. This means we can start with the dependencies even on an empty folder: ```bash yarn add @noir-lang/noir_js@1.0.0-beta.20 @aztec/bb.js@3.0.0-nightly.20251104 buffer vite vite-plugin-node-polyfills@0.17.0 ``` Wait, what are these dependencies? - `noir_js` is the main Noir package. It will execute our program, and generate the witness that will be sent to the backend. - `bb.js` is the Typescript interface for Aztec's Barretenberg proving backend. It also uses the `wasm` version in order to run on the browser. :::info In this guide, we will install versions pinned to 1.0.0-beta.20. These work with Barretenberg version 3.0.0-nightly.20251104, so we are using that version too. You can also try older or later versions. ::: ## Setting up our Noir program ZK is a powerful technology: an app can prove that a computation was carried out correctly without revealing some of its inputs, and Noir lets you express this in a single line of code. :::tip For syntax highlighting and editor support, check out the [Language Server](../tooling/language_server.md). ::: A Noir program needs a `main.nr` and a `Nargo.toml` file. `nargo new` scaffolds both for us: ```bash nargo new circuit ``` This creates a `circuit` directory containing a `Nargo.toml` (already populated with the package name and `type = "bin"`) and a `src/main.nr`. To make our program interesting, let's give it a real use-case scenario: Bob wants to prove he is older than 18, without disclosing his age. Open `circuit/src/main.nr` and replace its contents with: ```rust title="age_check" showLineNumbers fn main(age: u8) { assert(age > 18); } ``` > Source code: examples/browser/src/main.nr#L1-L5 This program accepts a private input called age, and simply proves this number is higher than 18. This is all that we need to get started with Noir. ## Compiling the circuit Before we can execute a Noir program, we need to compile it into ACIR, an abstract representation of the circuit. This can be done by cd-ing into our circuit directory and running the `nargo compile` command. ```bash cd circuit nargo compile ``` This will write the compiled circuit into the `target` directory, which we'll then load into our JS later on. ## Setting up our app A single `html` file and a single `js` file are enough for this app. Let's create them in the project root: ```bash touch index.html index.js ``` And add something useful to our HTML file: ```html title="index" showLineNumbers
Noir app Logs Proof