GithubHelp home page GithubHelp logo

arajasek / nexus-zkvm Goto Github PK

View Code? Open in Web Editor NEW

This project forked from nexus-xyz/nexus-zkvm

0.0 0.0 0.0 5 MB

The Nexus zkVM: The zero-knowledge virtual machine

Home Page: https://docs.nexus.xyz

License: Apache License 2.0

Shell 0.04% Assembly 0.08% Rust 99.88%

nexus-zkvm's Introduction

Logo

The Nexus zkVM

The zero-knowledge virtual machine.
nexus.xyz »

The Nexus zkVM

The Nexus zkVM is a modular, extensible, open-source, and massively-parallelized zkVM, designed to run at a trillion CPU cycles proved per second given enough machine power.

Folding schemes

If you're interested in our implementation of folding schemes, check the nexus-nova crate.

Quick Start

1. Install the Nexus zkVM

First, install Rust: https://www.rust-lang.org/tools/install.

With the RISC-V target:

rustup target add riscv32i-unknown-none-elf

Then, install the Nexus zkVM:

cargo install --git https://github.com/nexus-xyz/nexus-zkvm nexus-tools

Verify the installation:

cargo nexus --help

This should print the available CLI commands.

2. Create a new Nexus project

cargo nexus new nexus-project

This will create a new Rust project directory with the following structure:

./nexus-project
├── Cargo.lock
├── Cargo.toml
└── src
    └── main.rs

As an example, you can change the content of ./src/main.rs to:

#![no_std]
#![no_main]

fn fib(n: u32) -> u32 {
    match n {
        0 => 0,
        1 => 1,
        _ => fib(n - 1) + fib(n - 2),
    }
}

#[nexus_rt::main]
fn main() {
    let n = 7;
    let result = fib(n);
    assert_eq!(result, 13);
}

3. Run your program

cargo nexus run

This command should run successfully. To print the full step-by-step execution trace on the NVM, run:

cargo nexus run -v

4. Prove your program

Generate a proof for your Rust program using the Nexus zkVM.

cargo nexus prove

This command will save the proof to ./nexus-proof.

5. Verify your proof

Finally, load and verify the proof:

cargo nexus verify

Learn More

Run cargo nexus --help to see all the available commands.

Also check out the documentation at docs.nexus.xyz, or join our Telegram chat to discuss!

Nexus is committed to open-source. All of our code is dual licensed under MIT and Apache licenses. We encourage and appreciate contributions.

nexus-zkvm's People

Contributors

govereau avatar danielmarinq avatar slumber avatar michel-nexus avatar dorebell avatar shuding avatar sjudson avatar abe149 avatar c-eo avatar jensnexus avatar srinathsetty avatar thomas-sciaroni avatar allcontributors[bot] avatar adventureseeker987 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.