Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,9 @@
"Weierstraß",
"zshell",
"nouner",
"devcontainer"
"devcontainer",
"boilerplate",
"boilerplates"
],
"ignorePaths": [
"./**/node_modules/**",
Expand Down
18 changes: 14 additions & 4 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

This is the source code for the Noir documentation site at [noir-lang.org](https://noir-lang.org).

This website is built using [Docusaurus 2](https://docusaurus.io/), a modern static website
This website is built using [Docusaurus 3](https://docusaurus.io/), a modern static website
generator.

## Contributing
Expand All @@ -15,14 +15,20 @@ Check out the contributing guide [here](../CONTRIBUTING.md).

### Installation

This project requires recent versions of rust and cargo to be installed.
Any build errors should indicate dependencies that need installing, and at what version.

On the root folder of the repository, run:

```
yarn
yarn build
```

### Local Development

```
yarn start
yarn workspace docs start
```

This command starts a local development server and opens up a browser window. Most changes are
Expand All @@ -31,8 +37,12 @@ reflected live without having to restart the server.
### Build

```
yarn build
yarn workspace docs build
```

This command generates static content into the `build` directory and can be served using any static
contents hosting service.
contents hosting service. You can see a preview by running:

```
yarn workspace docs serve
```
5 changes: 5 additions & 0 deletions docs/docs/getting_started/hello_noir/_category_.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"position": 1,
"collapsible": true,
"collapsed": true
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: Creating A Project
title: Creating a Project
description:
Learn how to create and verify your first Noir program using Nargo, a programming language for
zero-knowledge proofs.
Expand Down Expand Up @@ -48,7 +48,7 @@ nargo new hello_world
> `test`).

A `hello_world` folder would be created. Similar to Rust, the folder houses _src/main.nr_ and
_Nargo.toml_ that contains the source code and environmental options of your Noir program
_Nargo.toml_ which contain the source code and environmental options of your Noir program
respectively.

### Intro to Noir Syntax
Expand All @@ -69,7 +69,7 @@ x : Field, y : pub Field

Program inputs in Noir are private by default (e.g. `x`), but can be labeled public using the
keyword `pub` (e.g. `y`). To learn more about private and public values, check the
[Data Types](../noir/concepts/data_types/index.md) section.
[Data Types](../../noir/concepts/data_types/index.md) section.

The next line of the program specifies its body:

Expand All @@ -79,7 +79,7 @@ assert(x != y);

The Noir syntax `assert` can be interpreted as something similar to constraints in other zk-contract languages.

For more Noir syntax, check the [Language Concepts](../noir/concepts/comments.md) chapter.
For more Noir syntax, check the [Language Concepts](../../noir/concepts/comments.md) chapter.

## Build In/Output Files

Expand All @@ -96,7 +96,7 @@ _Prover.toml_ houses input values, and _Verifier.toml_ houses public values.

## Prove Our Noir Program

Now that the project is set up, we can create a proof of correct execution on our Noir program.
Now that the project is set up, we can create a proof of correct execution of our Noir program.

Fill in input values for execution in the _Prover.toml_ file. For example:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ keywords:
sidebar_position: 2
---

This section breaks down our hello world program in section _1.2_. We elaborate on the project
structure and what the `prove` and `verify` commands did in the previous section.
This section breaks down our hello world program from the previous section. We elaborate on the project
structure and what the `prove` and `verify` commands did.

## Anatomy of a Nargo Project

Expand Down Expand Up @@ -52,7 +52,7 @@ license = "MIT"
ecrecover = {tag = "v0.9.0", git = "https://github.com/colinnielsen/ecrecover-noir.git"}
```

Nargo.toml for a [workspace](../noir/modules_packages_crates/workspaces.md) will look a bit different. For example:
Nargo.toml for a [workspace](../../noir/modules_packages_crates/workspaces.md) will look a bit different. For example:

```toml
[workspace]
Expand All @@ -62,7 +62,7 @@ default-member = "crates/a"

#### Package section

The package section requires a number of fields including:
The package section defines a number of fields including:

- `name` (**required**) - the name of the package
- `type` (**required**) - can be "bin", "lib", or "contract" to specify whether its a binary, library or Aztec contract
Expand All @@ -75,7 +75,7 @@ The package section requires a number of fields including:

#### Dependencies section

This is where you will specify any dependencies for your project. See the [Dependencies page](../noir/modules_packages_crates/dependencies.md) for more info.
This is where you will specify any dependencies for your project. See the [Dependencies page](../../noir/modules_packages_crates/dependencies.md) for more info.

`./proofs/` and `./contract/` directories will not be immediately visible until you create a proof or
verifier contract respectively.
Expand All @@ -98,7 +98,7 @@ verifying the proof.

The prover supplies the values for `x` and `y` in the _Prover.toml_ file.

As for the program body, `assert` ensures the satisfaction of the condition (e.g. `x != y`) is
As for the program body, `assert` ensures that the condition to be satisfied (e.g. `x != y`) is
constrained by the proof of the execution of said program (i.e. if the condition was not met, the
verifier would reject the proof as an invalid proof).

Expand All @@ -116,8 +116,8 @@ y = "2"

When the command `nargo prove` is executed, two processes happen:

1. Noir creates a proof that `x` which holds the value of `1` and `y` which holds the value of `2`
is not equal. This not equal constraint is due to the line `assert(x != y)`.
1. Noir creates a proof that `x`, which holds the value of `1`, and `y`, which holds the value of `2`,
is not equal. This inequality constraint is due to the line `assert(x != y)`.

2. Noir creates and stores the proof of this statement in the _proofs_ directory in a file called your-project.proof. So if your project is named "private_voting" (defined in the project Nargo.toml), the proof will be saved at `./proofs/private_voting.proof`. Opening this file will display the proof in hex format.

Expand Down Expand Up @@ -183,12 +183,12 @@ When the command `nargo verify` is executed, two processes happen:

In production, the prover and the verifier are usually two separate entities. A prover would
retrieve the necessary inputs, execute the Noir program, generate a proof and pass it to the
verifier. The verifier would then retrieve the public inputs from usually external sources and
verifies the validity of the proof against it.
verifier. The verifier would then retrieve the public inputs, usually from external sources, and
verify the validity of the proof against it.

Take a private asset transfer as an example:

A user on browser as the prover would retrieve private inputs (e.g. the user's private key) and
A person using a browser as the prover would retrieve private inputs locally (e.g. the user's private key) and
public inputs (e.g. the user's encrypted balance on-chain), compute the transfer, generate a proof
and submit it to the verifier smart contract.

Expand Down
3 changes: 3 additions & 0 deletions docs/docs/getting_started/installation/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ keywords: [
Branches
Noirup Repository
]
pagination_next: getting_started/hello_noir/index
---

`nargo` is the one-stop-shop for almost everything related with Noir. The name comes from our love for Rust and its package manager `cargo`.
Expand Down Expand Up @@ -43,3 +44,5 @@ Done. That's it. You should have the latest version working. You can check with
You can also install nightlies, specific versions
or branches. Check out the [noirup repository](https://github.com/noir-lang/noirup) for more
information.

Now we're ready to start working on [our first Noir program!](../hello_noir/index.md)
2 changes: 1 addition & 1 deletion docs/docs/getting_started/tooling/_category_.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"position": 3,
"position": 2,
"label": "Tooling",
"collapsible": true,
"collapsed": true
Expand Down
Loading