MCPcopy Index your code
hub / github.com/MatteoMer/any-zkvm

github.com/MatteoMer/any-zkvm @main

Chat with this repo
repository ↗ · DeepWiki ↗ · + Follow
22 symbols 30 edges 11 files 2 documented · 9% updated 15mo ago★ 57
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Any zkVM template

A rust template that allows any rust dev to easily develop an app made for a zkVM, but abstracting which one to use. also makes it possible to benchmark over every available zkVM

For now, proving and verification is in the same script, but it would great to have two different flow for both

Getting started

You can write your code in ./lib/src/lib.rs.

You can install all the available zkvm using the ./build.sh file

./build.sh

You'll find a trait Processor with some function already implemented; let's go through every function and types to understand them better

Processor::Input

This type represent the public inputs you'll pass to your verifier

Processor::Output

This type represent the public outputs your program will pass to the verifier

get_guest_inputs()

This function is an helper to pass your inputs to the zkvm, you should not have to modify this function (or at least not often)

get_host_inputs()

This function passes the public inputs to the prover, you could for example take these inputs from your user directyl

prove(input: Self::Input)

This is where you'll write the code you want to prove, this code will be the one passed to the prover

process_outputs(_output: Self::Output)

This function is the callback you'll get at the end of the program (after verification), you can then uses the output values to do any verification you need!

Run a specific zkVM

cargo run -p [zkVM] --release

Available zkVMs: [sp1, risczero, powdrVM]

in progress: [jolt]

Run a specific zkVM with AVX

Some zkVMs (e.g. powdrVM, Valida) might have a lot better performance with AVX enabled, if your hardware supports it.

You can enable it via: RUSTFLAGS='-C target-cpu=native' cargo run -p [zkVM] --release

TODO

  • Fix Jolt
  • Add Valida with their custom ISA
  • Add more zkVMs
  • Add benchmarks

Extension points exported contracts — how you extend this code

ZkvmProcessor (Interface)
You can change the definitions here to fit the needs of your program */ [1 implementers]
lib/src/lib.rs
Sp1ZkvmProcessor (Interface)
(no doc) [1 implementers]
lib/src/lib.rs
RiscZeroZkvmProcessor (Interface)
(no doc) [1 implementers]
lib/src/lib.rs
PowdrZkvmProcessor (Interface)
(no doc) [1 implementers]
lib/src/lib.rs

Core symbols most depended-on inside this repo

prove
called by 3
lib/src/lib.rs
fibonacci
called by 1
lib/src/lib.rs
main
called by 0
powdr/guest/src/main.rs
main
called by 0
powdr/src/main.rs
get_guest_inputs
called by 0
lib/src/lib.rs
get_host_inputs
called by 0
lib/src/lib.rs
process_outputs
called by 0
lib/src/lib.rs
process_internal_outputs
called by 0
lib/src/lib.rs

Shape

Function 10
Method 6
Interface 4
Class 1
Enum 1

Languages

Rust100%

Modules by API surface

lib/src/lib.rs13 symbols
sp1/script/src/bin/main.rs1 symbols
sp1/script/build.rs1 symbols
sp1/program/src/main.rs1 symbols
sp1/lib/src/lib.rs1 symbols
risczero/methods/guest/src/main.rs1 symbols
risczero/methods/build.rs1 symbols
risczero/host/src/main.rs1 symbols
powdr/src/main.rs1 symbols
powdr/guest/src/main.rs1 symbols

For agents

$ claude mcp add any-zkvm \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact