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
2 changes: 1 addition & 1 deletion .github/workflows/sync_labels.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
manifest: .github/labels.yaml
prune: false
prune: true
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
target/*
.DS_Store
.DS_Store
*.bytes
proof.meta.json
103 changes: 102 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

67 changes: 32 additions & 35 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,43 +1,40 @@
[workspace]
members =["prover", "frontend"]
members =["prover", "frontend", "demo"]
resolver="2"

[workspace.dependencies]
bellpepper-core ={ version="0.4.0", default-features=false }
bellpepper ={ git="https://github.com/argumentcomputer/bellpepper", branch="dev", default-features=false }
ff ={ version="0.13.0", features=["derive"] }
bellpepper-core ={ version="0.4.0", default-features=false }
bincode ="1.3"
bitvec ="1.0"
byteorder ="1.4.3"
cfg-if ="1.0.0"
digest ="0.10"
ff ={ version="0.13.0", features=["derive"] }
generic-array ="1.0.0"
group ="0.13.0"
grumpkin-msm ={ git="https://github.com/argumentcomputer/grumpkin-msm", branch="dev" }
halo2curves ={ version="0.6.0", features=["bits", "derive_serde"] }
sha3 ="0.10"
rayon ="1.7"
rand_core ={ version="0.6", default-features=false }
rand_chacha ="0.3"
subtle ="2.5"
hex ="0.4.3"
itertools ="0.13.0" # zip_eq
neptune ={ git="https://github.com/argumentcomputer/neptune", branch="dev", default-features=false }
generic-array ="1.0.0"
num-bigint ={ version="0.4", features=["serde", "rand"] }
num-traits ="0.2"
num-integer ="0.1"
serde ={ version="1.0", features=["derive", "rc"] }
bincode ="1.3"
bitvec ="1.0"
byteorder ="1.4.3"
thiserror ="1.0"
group ="0.13.0"
pairing ="0.23.0"
tracing ="0.1.37"
cfg-if ="1.0.0"
num-traits ="0.2"
once_cell ="1.18.0"
itertools ="0.13.0" # zip_eq
pairing ="0.23.0"
rand ="0.8.5"
rand_chacha ="0.3"
rand_core ={ version="0.6", default-features=false }
rayon ="1.7"
rayon-scan ="0.1.0"
ref-cast ="1.0.20" # allocation-less conversion in multilinear polys # lightens impl macros for pasta
serde ={ version="1.0", features=["derive", "rc"] }
sha3 ="0.10"
static_assertions="1.1.0"
rayon-scan ="0.1.0"
hex ="0.4.3"

# grumpkin-msm has been patched to support MSMs for the pasta curve cycle
# see: https://github.com/argumentcomputer/grumpkin-msm/pull/3
grumpkin-msm={ git="https://github.com/argumentcomputer/grumpkin-msm", branch="dev" }
subtle ="2.5"
thiserror ="1.0"
tracing ="0.1.37"

# wasm32 dependencies
getrandom={ version="0.2.0", default-features=false, features=["js"] }
Expand All @@ -49,26 +46,26 @@ proptest="1.2.0"
criterion={ version="0.5", features=["html_reports"] }

# dev dependencies
anyhow ="1.0.72"
expect-test ="1.4.1"
flate2 ="1.0"
handlebars ="5.1.0"
serde_json ="1.0.1"
sha2 ="0.10.7"
tracing-test ={ version="0.2.4", features=["no-env-filter"] }
expect-test ="1.4.1"
anyhow ="1.0.72"
tap ="1.0.1"
tracing-texray ="0.2.0"
tracing-subscriber={ version="0.3.17", features=["env-filter"] }
handlebars ="5.1.0"
serde_json ="1.0.1"
tracing-test ={ version="0.2.4", features=["no-env-filter"] }
tracing-texray ="0.2.0"

[profile.release]
lto =true
codegen-units=1
lto =true
panic ="abort"

[profile.dev]
opt-level =1
codegen-units=256
debug =true
incremental =true
codegen-units=256
lto =false
opt-level =1
panic ="unwind"
63 changes: 61 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,67 @@

## Project Structure
The repository contains several key components:
- `edge-frontend`: Frontend adapters for both Noir and Circom
- `edge-prover`: Backend implementation of the client side prover
- `edge-prover`: Backend implementation of Supernova NIVC folding scheme
- `edge-frontend`: Frontend adapters for Noir to use `edge-prover`
- `demo`: A demo application for the `edge-frontend` and `edge-prover`

### Prerequisites
Before running the demo, ensure you have:
1. Rust, Noir, and their associated tools installed
2. The Noir programs compiled to JSON (located in the `target/` directory). To do so, just run
```
nargo compile --workspace
```
from the root directory.

### Running the Demo
The demo application has three main commands: setup, prove, and verify. The help command can be used to see the available options.
```
cargo run -p demo -- --help
```
The demo application proves sequences to a fun (and unproven) math called the Collatz conjecture. In short, for any positive integer `n`, the sequence is defined as:
```
if n is 1, stop.
if n is even, repeat this process on n/2.
if n is odd, repeat this process on 3n + 1.
```
So depending on the starting value, you will find a different sequence of circuits is used to prove the sequence. If you happen to find a case where this proof doesn't work, please let us know -- you may have found a counter example to the conjecture! 😁

#### 1. Setup Phase
First, run the offline setup phase:
```
cargo run -p demo -- setup
```
This will create a `setup.bytes` file in the current directory. You can specify an output file name as an argument (see help for more details).

#### 2. Prove Phase
Generate a proof for a specific input value (e.g., 42):
```
cargo run -p demo -- prove --input 42
```
This creates:
- `proof.bytes`: The compressed proof
- `proof.meta.json`: Metadata about the proof, including:
- The input value
- Number of steps in the Collatz sequence
- The complete sequence of even/odd operations
If you'd like, you can run with some logging to see the steps:
```
cargo run -p demo -- prove --input 42 -v
```
and to see more logs, you can use `-vv` or `-vvv`.

#### 3. Verify Phase
To verify a proof, run:
```
cargo run -p demo -- verify --input 42
```
This will verify the proof. Without verbosity, no output implies a valid proof. But if you provided an incorrect input, you will see an error message. For example, if you provide an input of 43, you will see:
```
ERROR demo: ❌ Proof verification failed: NovaError
Error: NovaError(ProofVerifyError)
```


## Usage
This repository and its crates are **not** production ready. Do not use them in production. No audits have been done and none are planned.
Expand Down
12 changes: 12 additions & 0 deletions demo/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[package]
edition="2021"
name ="demo"
version="0.1.0"

[dependencies]
bincode ={ workspace=true }
clap ={ version="4.5", features=["derive"] }
edge-frontend ={ path="../frontend", features=["demo"] }
serde_json ={ workspace=true }
tracing ={ workspace=true }
tracing-subscriber={ workspace=true }
Loading