Skip to content

pluto/edge

Repository files navigation

Pluto Logo
Pluto

Telegram Docs License


Edge

Enabling private computation on the edge.

Features

  • 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

Project Structure

The repository contains several key components:

  • 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
  • nivc: A Noir package to use with the NIVC folding scheme

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

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.

Contributing

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.

License

This project is licensed under the Apache V2 License - see the LICENSE file for details.

Acknowledgements

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.