Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
a22d895
chore: add example script to generate a verifier contract
TomAFrench May 9, 2024
96b58f7
chore!: remove `codegen-verifier` command
TomAFrench May 9, 2024
8e6c37a
chore: update docs
TomAFrench May 13, 2024
37b68b1
Update noir/noir-repo/examples/codegen-verifier/codegen_verifier.sh
TomAFrench May 13, 2024
836b861
chore: update integration tests to call `bb` directly
TomAFrench May 13, 2024
75e4dd4
chore: update usage to handle bb.js
TomAFrench May 13, 2024
9ccef03
Merge branch 'master' into tf/remove-codegen-verifier
TomAFrench May 13, 2024
b08729d
chore: add simple docs for installing `bb`
TomAFrench May 13, 2024
adc693c
chore: fix codegen-verifiers.sh
TomAFrench May 13, 2024
1a0c641
chore: installs `bb` for noir CI
TomAFrench May 13, 2024
4cf2403
Update noir/noir-repo/examples/codegen-verifier/codegen_verifier.sh
TomAFrench May 16, 2024
b44d4b4
Merge branch 'master' into tf/remove-codegen-verifier
TomAFrench May 16, 2024
45783d7
feat: extend example to show how
TomAFrench May 16, 2024
1270e1b
pull over some more files
TomAFrench May 16, 2024
25dbbeb
Merge branch 'master' into tf/remove-codegen-verifier
TomAFrench May 16, 2024
0016c8d
chore: add `examples` target to CI
TomAFrench May 16, 2024
898cf57
chore: update test
TomAFrench May 16, 2024
fe3cfc7
chore: remove contract.sol
TomAFrench May 16, 2024
1d8acfe
chore(ci): dont look for tags if pure spot (#6446)
ludamad May 16, 2024
1962ead
Merge branch 'master' into tf/remove-codegen-verifier
TomAFrench May 16, 2024
76b7b59
Update noir/noir-repo/examples/codegen-verifier/codegen_verifier.sh
TomAFrench May 16, 2024
eadaa0d
chore!: remove `nargo prove` and `nargo verify` (#6321)
TomAFrench May 16, 2024
7dcc7da
feat!: remove backend interactions from `nargo` (#6369)
TomAFrench May 16, 2024
4a99019
Merge branch 'master' into tf/remove-codegen-verifier
TomAFrench May 16, 2024
fdcb0d8
Update noir/noir-repo/docs/docs/how_to/how-to-solidity-verifier.md
TomAFrench May 16, 2024
999e333
chore: remove dead code
TomAFrench May 16, 2024
9ac2ed1
Merge branch 'master' into tf/remove-codegen-verifier
TomAFrench May 17, 2024
12691b4
Merge branch 'master' into tf/remove-codegen-verifier
TomAFrench May 17, 2024
7fab767
fmt
TomAFrench May 17, 2024
435ab31
chore: update docs to reflect lack of `Verifier.toml` file
TomAFrench May 17, 2024
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
12 changes: 12 additions & 0 deletions noir/Earthfile
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,18 @@ test:
COPY noir-repo/.rustfmt.toml noir-repo/.rustfmt.toml
RUN ./scripts/test_native.sh

examples:
FROM +nargo
ENV PATH="/usr/src/noir-repo/target/release:${PATH}"

COPY --dir noir-repo/examples noir-repo
COPY ../barretenberg/cpp/+preset-clang-assert/bin/bb /usr/src/barretenberg/cpp/build/bin/bb

ENV BACKEND=/usr/src/barretenberg/cpp/build/bin/bb

WORKDIR noir-repo/examples/codegen-verifier
RUN ./test.sh

format:
FROM +nargo
ENV PATH=$PATH:/usr/src/noir-repo/target/release
Expand Down
14 changes: 11 additions & 3 deletions noir/noir-repo/docs/docs/how_to/how-to-solidity-verifier.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,19 @@ Generating a Solidity Verifier contract is actually a one-command process. Howev
This is by far the most straight-forward step. Just run:

```sh
nargo codegen-verifier
nargo compile
```

A new `contract` folder would then be generated in your project directory, containing the Solidity
file `plonk_vk.sol`. It can be deployed to any EVM blockchain acting as a verifier smart contract.
This will compile your source code into a Noir build artifact to be stored in the `./target` directory, you can then generate the smart contract using the commands:

```sh
# Here we pass the path to the newly generated Noir artifact.
bb write_vk -b ./target/<noir_artifact_name>.json
bb contract
```

replacing `<noir_artifact_name>` with the name of your Noir project. A new `contract` folder would then be generated in your project directory, containing the Solidity
file `contract.sol`. It can be deployed to any EVM blockchain acting as a verifier smart contract.

:::info

Expand Down
7 changes: 7 additions & 0 deletions noir/noir-repo/examples/codegen-verifier/Nargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[package]
name = "hello_world"
type = "bin"
authors = [""]
compiler_version = ">=0.29.0"

[dependencies]
10 changes: 10 additions & 0 deletions noir/noir-repo/examples/codegen-verifier/codegen_verifier.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/bash
set -eu

BACKEND=${BACKEND:-bb}

nargo compile

# TODO: backend should automatically generate vk if necessary.
Comment thread
TomAFrench marked this conversation as resolved.
$BACKEND write_vk -b ./target/hello_world.json
$BACKEND contract -v ./target/vk
Comment thread
TomAFrench marked this conversation as resolved.
Outdated
3 changes: 3 additions & 0 deletions noir/noir-repo/examples/codegen-verifier/src/main.nr
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
fn main(x: Field, y: pub Field) {
assert(x != y);
}
13 changes: 13 additions & 0 deletions noir/noir-repo/examples/codegen-verifier/test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/bash
set -eu

# This file is used for Noir CI and is not required.

BACKEND=${BACKEND:-bb}

./codegen_verifier.sh

if ! [ -f ./target/contract.sol ]; then
printf '%s\n' "Contract not written to file" >&2
exit 1
fi
71 changes: 0 additions & 71 deletions noir/noir-repo/tooling/backend_interface/src/cli/contract.rs

This file was deleted.

2 changes: 0 additions & 2 deletions noir/noir-repo/tooling/backend_interface/src/cli/mod.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// Reference: https://github.com/AztecProtocol/aztec-packages/blob/master/barretenberg/cpp/src/barretenberg/bb/main.cpp

mod contract;
mod gates;
mod proof_as_fields;
mod prove;
Expand All @@ -9,7 +8,6 @@ mod version;
mod vk_as_fields;
mod write_vk;

pub(crate) use contract::ContractCommand;
pub(crate) use gates::GatesCommand;
pub(crate) use proof_as_fields::ProofAsFieldsCommand;
pub(crate) use prove::ProveCommand;
Expand Down
1 change: 0 additions & 1 deletion noir/noir-repo/tooling/backend_interface/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ use std::path::PathBuf;
mod cli;
mod download;
mod proof_system;
mod smart_contract;

pub use bb_abstraction_leaks::ACVM_BACKEND_BARRETENBERG;
use bb_abstraction_leaks::BB_VERSION;
Expand Down
55 changes: 0 additions & 55 deletions noir/noir-repo/tooling/backend_interface/src/smart_contract.rs

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@

use clap::{Parser, Subcommand};

mod contract_cmd;
mod gates_cmd;
mod prove_cmd;
mod verify_cmd;
Expand All @@ -20,7 +19,6 @@ struct BackendCli {

#[derive(Subcommand, Clone, Debug)]
enum BackendCommand {
Contract(contract_cmd::ContractCommand),
Gates(gates_cmd::GatesCommand),
Prove(prove_cmd::ProveCommand),
Verify(verify_cmd::VerifyCommand),
Expand All @@ -32,7 +30,6 @@ fn main() {
let BackendCli { command } = BackendCli::parse();

match command {
BackendCommand::Contract(args) => contract_cmd::run(args),
BackendCommand::Gates(args) => gates_cmd::run(args),
BackendCommand::Prove(args) => prove_cmd::run(args),
BackendCommand::Verify(args) => verify_cmd::run(args),
Expand Down
68 changes: 0 additions & 68 deletions noir/noir-repo/tooling/nargo_cli/src/cli/codegen_verifier_cmd.rs

This file was deleted.

3 changes: 0 additions & 3 deletions noir/noir-repo/tooling/nargo_cli/src/cli/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ mod fs;

mod backend_cmd;
mod check_cmd;
mod codegen_verifier_cmd;
mod compile_cmd;
mod dap_cmd;
mod debug_cmd;
Expand Down Expand Up @@ -63,7 +62,6 @@ enum NargoCommand {
Backend(backend_cmd::BackendCommand),
Check(check_cmd::CheckCommand),
Fmt(fmt_cmd::FormatCommand),
CodegenVerifier(codegen_verifier_cmd::CodegenVerifierCommand),
#[command(alias = "build")]
Compile(compile_cmd::CompileCommand),
New(new_cmd::NewCommand),
Expand Down Expand Up @@ -118,7 +116,6 @@ pub(crate) fn start_cli() -> eyre::Result<()> {
NargoCommand::Verify(args) => verify_cmd::run(&backend, args, config),
NargoCommand::Test(args) => test_cmd::run(args, config),
NargoCommand::Info(args) => info_cmd::run(&backend, args, config),
NargoCommand::CodegenVerifier(args) => codegen_verifier_cmd::run(&backend, args, config),
NargoCommand::Backend(args) => backend_cmd::run(args),
NargoCommand::Lsp(args) => lsp_cmd::run(args, config),
NargoCommand::Dap(args) => dap_cmd::run(args, config),
Expand Down
Loading