---
# System prepended metadata

title: Noir

---

# Noir
> https://aztec.network/noir/

## Getting Started
> https://noir-lang.org/index.html

- Noir is a domain specific language for creating and verifying proofs. It's design choices are influenced heavily by Rust.
- `nargo` is a command line tool for interacting with Noir programs (e.g. compiling, proving, verifying and more).
    - Alternatively, the interactions can also be performed in TypeScript.
- [Install](https://noir-lang.org/getting_started/nargo/installation.html#option-2-compile-from-source):
    - Install [Git](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git) and [Rust](https://www.rust-lang.org/tools/install).
    - Download Noir's source code from Github by running:
`git clone git@github.com:noir-lang/noir.git`
    - Change directory into the Noir project by running:
`cd noir`
    - Option 2.1: Install Executable with WASM backend
Install Nargo by running:
`cargo install --locked --path=crates/nargo --no-default-features --features plonk_bn254_wasm`
    - Option 2.2: [Install Executable with Native Backend](https://noir-lang.org/getting_started/nargo/installation.html#option-22-install-executable-with-native-backend)
    - Check if the installation was successful by running `nargo --help`


### Notes
___


#### General Commands to Know
> https://noir-lang.org/getting_started/nargo/commands.html


- The `nargo` command (same a `nargo help` / `nargo -h` / `nargo --help`) brings up the menue.
- `nargo new` 
    - <pkg name>
    - nargo check
        - Generate `Prover.toml` and Verifier.toml files for specifying prover and verifier.
    - nargo excecute
        - <witness_name>
    - nargo prove
        - <proof_name>
    - nargo verify
        - <proof>
    - nargo codegen-verifier
        - Generate a Solidity verifier smart contract for the program.
    - nargo compile 
        - <circuit_name>

#### Hello World Program
> https://noir-lang.org/getting_started/hello_world.html

- `nargo new hello_world`
    - In production, the common practice is to name the project folder as `circuits` for better identifiability when sitting alongside other folders in the codebase (e.g. `contracts`, `scripts`, `test`).
- Program inputs in Noir are private by default (e.g. `x`), but can be labeled public using the keyword `pub` (e.g. `y`).
- `cd hello_world` & `cargo check`
- Fill in input values for execution in the `Prover.toml` file.
    - `constrain x != y;`
    - example:
```JSON=
x = "1"
y = "2"
```
- `nargo prove` <proof_name>
- `nargo verify` <proof_name>

