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.
sudo apt install cmake
sudo apt update
sudo apt install build-essential
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
. "$HOME/.cargo/env"
rustup target add riscv32i-unknown-none-elf
cargo install --git https://github.com/nexus-xyz/nexus-zkvm cargo-nexus --tag 'v0.2.0'
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
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);
}
cargo nexus run
cargo nexus run -v
cargo nexus prove
cargo nexus verify