Skip to content

grandchildrice/zkvm-benchmarks

 
 

Repository files navigation

This repo is used for academic workshop, with the title "Benchmarking zkVMs: Efficiency, Bottlenecks, and Best Practices", at ZKProof7 in Sofia.

zkVM Benchmarks

See bench result here

Current status

We are so welcome to your contribution!

Fibonacci SHA2 ECDSA ETHTransfer Notes
Jolt
Jolt (GPU) Optimization by GPU is still only partially implemented
Nexus
Novanet
OpenVM
Powdr
RISC Zero
RISC Zero (GPU)
SP1
SP1 (GPU)
ZKM Curious compile error
Ceno No SDK yet
zkWASM
Valida The repo is currently private, and the latest docker image is not available.
Snarkify

Hardware Requirement

Architecture: Linux x86_64 (When I tried to build on my Mac/M1 using docker, some toolchains were unable to build.)

CPU Cores RAM GPU RAM
Jolt 8 100GB 8GB
Nexus 8 32GB -
Novanet 8 32GB -
OpenVM 8 32GB -
RISC Zero 8 32GB 8GB
SP1 8 64GB 24GB
ZKM 8 80GB -

Installation

Install Jolt/Nexus

rustup target add riscv32i-unknown-none-elf

Install Risc Zero

cargo install cargo-binstall
cargo binstall cargo-risczero
cargo risczero install

Install SP1

curl -L https://sp1.succinct.xyz | bash

Follow the instructions outputted by this command then run:

sp1up

Install zkm

curl --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/zkMIPS/toolchain/refs/heads/main/setup.sh | sh
source ~/.zkm-toolchain/env

When Open SSL error occurs:

wget https://github.com/openssl/openssl/releases/download/openssl-3.3.2/openssl-3.3.2.tar.gz -O openssl-3.3.2.tar.gz
tar -xvzf openssl-3.3.2.tar.gz
cd openssl-3.3.2
./config --prefix=/usr zlib-dynamic --openssldir=/etc/ssl shared
make test
sudo make install
export LD_LIBRARY_PATH=/usr/lib64:$LD_LIBRARY_PATH

Install zkm2

curl --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/zkMIPS/toolchain/refs/heads/main/setup.sh | sh
  • Modify ~/.cargo/config:
[target.mips-unknown-linux-musl]
linker = "<path-to>/mips-linux-muslsf-cross/bin/mips-linux-muslsf-gcc"
rustflags = ["--cfg", 'target_os="zkvm"',"-C", "target-feature=+crt-static", "-C", "link-arg=-g"]

Install Open VM

cargo +nightly install --git http://github.com/openvm-org/openvm.git cargo-openvm
cargo openvm --version

Install Novanet

Novanet (zkEngine) requires the wasm2wat tool to build a guest programs into WebAssembly Text Fromat. https://github.com/WebAssembly/wabt?tab=readme-ov-file#installing-prebuilt-binaries

and install wasm32 target:

rustup target add wasm32-unknown-unknown

MacOS

brew install wabt

Linux

sudo apt install wabt

Others

Please build wabt from here on your own.

Running

To run all benchmarks run:

make bench-all

The benchmark results should be outputted in CSV form in benchmark_outputs.

To run an individual benchmark run make bench-zkm, make bench-jolt, make bench-risczero or make bench-sp1.

Profiling

First, you need to install these tools:

  • flamegraph

Then, run this command:

make perf-all

Disclaimer

This code is being provided as is. No guarantee, representation or warranty is being made, express or implied, as to the safety or correctness of the code. It has not been audited and as such there can be no assurance it will work as intended, and users may experience delays, failures, errors, omissions or loss of transmitted information. Nothing in this repo should be construed as investment advice or legal advice for any particular facts or circumstances and is not meant to replace competent counsel. It is strongly advised for you to contact a reputable attorney in your jurisdiction for any questions or concerns with respect thereto. a16z is not liable for any use of the foregoing, and users should proceed with caution and use at their own risk. See a16z.com/disclosures for more info.

Submission Guide

If you want to add new zkVM schemes for this benchmark, please follow them:

  1. Submit issue
  2. Assign
  3. Create PR

About

Fair&Comprehensive zkVM benchmarks

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Jupyter Notebook 60.7%
  • Rust 37.0%
  • Makefile 1.3%
  • Other 1.0%