Enabling private computation on the edge.
- Supernova NIVC folding scheme implementation
- Support for Noir circuit DSL
- Client-side proving capabilities through native x86, aarch64, and WASM
- End-to-end proof setup, running, and verification
The repository contains several key components:
edge-prover
: Backend implementation of Supernova NIVC folding schemeedge-frontend
: Frontend adapters for Noir to useedge-prover
demo
: A demo application for theedge-frontend
andedge-prover
nivc
: A Noir package to use with the NIVC folding scheme
Before running the demo, ensure you have:
- Rust, Noir, and their associated tools installed
- The Noir programs compiled to JSON (located in the
target/
directory). To do so, just run
nargo compile --workspace
from the root directory.
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! 😁
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).
Generate a proof for a specific input value (e.g., 42):
cargo run -p demo -- prove --input 42
This creates:
proof.bytes
: The compressed proofproof.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
.
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)
You can use the edge-frontend
crate to use the NIVC folding scheme for your own Noir programs. In your Cargo.toml
, add the following:
[dependencies]
edge-frontend = { git = "https://github.com/pluto/edge", branch = "main" }
and then add the following to your Nargo.toml
:
[dependencies]
nivc = { tag = "v0.1.0", git = "https://github.com/pluto/edge" }
The edge-frontend
assumes that the structure provided by the nivc
crate is used. Please see the demo
crate for an example of how to use the edge-frontend
with the nivc
crate and the examples
directory for examples of Noir programs that use the nivc
crate inside of other tests (see frontend/tests/nivc/
).
Warning
This repository and its crates are not production ready. Do not use them in production. No audits have been done and none are planned.
With that said, work has been done to make the implementation here work with an offline setup phase. Therefore, this can be used run proofs on an edge device which can later be verified by a remote server.
We welcome contributions to our open-source projects. If you want to contribute or follow along with contributor discussions, join our main Telegram channel to chat about Pluto's development.
Our contributor guidelines can be found in our CONTRIBUTING.md.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be licensed as above, without any additional terms or conditions.
This project is licensed under the Apache V2 License - see the LICENSE file for details.
Note
This repository is a fork of the original hosted at https://github.com/microsoft/nova and also forked from https://github.com/argumentcomputer/arecibo.