Skip to content

selvamgym/nexus-zkvm-sel_2_Proof

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 

Repository files navigation

The Nexus zkVM

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

1. Fork this Repo

2. Login with Gitpod.io

3. Press CNTRL+C

4. Install Cmake

sudo apt install cmake

5. Install Build Essential

sudo apt update
sudo apt install build-essential

6. Install Rust

curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

7. Input 1 and proceed

. "$HOME/.cargo/env"

8. With the RISC-V target:

rustup target add riscv32i-unknown-none-elf

9. Then install the Nexus zkVM:

cargo install --git https://github.com/nexus-xyz/nexus-zkvm cargo-nexus --tag 'v0.2.0'

10. 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

11. Move to Directory, Replace the code and press CNTL+X, Y, Enter

cd nexus-project
cd src
nano 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);
}

12. Run your program

cargo nexus run

13. step-by-step execution trace on the NVM, run:

cargo nexus run -v

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

cargo nexus prove

15. Verify your proof - Finally, load and verify the proof:

cargo nexus verify

Most importanly commit and push the repo in github

About

nexus-zkvm-sel_2_Proof

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published