Thanks to visit codestin.com
Credit goes to github.com

Skip to content

eth-act/ere

Repository files navigation

Ere logo

Ere – Unified zkVM Interface & Toolkit

Compile. Execute. Prove. Verify.
One ergonomic Rust API, multiple zero‑knowledge virtual machines.


Table of Contents

Features

  • Unified Rust API for compiling, executing, proving & verifying zkVM programs
  • Pluggable back‑ends – easily switch between different zkVMs
  • SDK bootstrap scripts for every supported zkVM
  • End‑to‑end test suite covering compilation → proof → verification for each backend

Supported zkVMs

  • SP1
  • OpenVM
  • Risc Zero
  • Jolt
  • Pico
  • Zisk
  • Nexus
  • Miden

Prerequisites

The following dependencies are required:

  • protobuf-compiler

Quick Start

This guide assumes you have Rust and Cargo installed. If not, please refer to the Rust installation guide. Choose your setup approach:

Option 1: With SDK Installation

Install the required zkVM SDKs locally for better performance and debugging.

1. Install SDKs

bash scripts/sdk_installers/install_sp1_sdk.sh

2. Add Dependencies

# Cargo.toml
[dependencies]
ere-zkvm-interface = { git = "https://github.com/eth-act/ere.git", tag = "v0.0.12" }
ere-sp1        = { git = "https://github.com/eth-act/ere.git", tag = "v0.0.12" }

3. Compile & Prove Example

// main.rs
use ere_sp1::{EreSP1, RV32_IM_SUCCINCT_ZKVM_ELF};
use ere_zkvm_interface::{Compiler, ProofKind, ProverResourceType, zkVM};

fn main() -> Result<(), Box<dyn std::error::Error>> {
    let guest_directory = std::path::Path::new("workspace/guest");

    // Compile guest
    let compiler = RV32_IM_SUCCINCT_ZKVM_ELF;
    let program = compiler.compile(guest_directory)?;

    // Create zkVM instance
    let zkvm = EreSP1::new(program, ProverResourceType::Cpu);

    // Serialize input
    let input = 42u32.to_le_bytes();

    // Execute
    let (public_values, report) = zkvm.execute(&input)?;

    // Prove
    let (public_values, proof, report) = zkvm.prove(&input, ProofKind::Compressed)?;

    // Verify
    let public_values = zkvm.verify(&proof)?;

    Ok(())
}

Option 2: Docker-Only Setup

Use Docker for zkVM operations without installing SDKs locally. Only requires Docker to be installed.

1. Add Dependencies

# Cargo.toml
[dependencies]
ere-zkvm-interface = { git = "https://github.com/eth-act/ere.git", tag = "v0.0.12" }
ere-dockerized = { git = "https://github.com/eth-act/ere.git", tag = "v0.0.12" }

2. Compile & Prove Example

// main.rs
use ere_dockerized::{EreDockerizedCompiler, EreDockerizedzkVM, ErezkVM};
use ere_zkvm_interface::{Compiler, ProofKind, ProverResourceType, zkVM};

fn main() -> Result<(), Box<dyn std::error::Error>> {
    let guest_directory = std::path::Path::new("workspace/guest");

    // Compile guest
    let compiler = EreDockerizedCompiler::new(ErezkVM::SP1, std::path::Path::new("workspace"));
    let program = compiler.compile(guest_directory)?;

    // Create zkVM instance
    let zkvm = EreDockerizedzkVM::new(ErezkVM::SP1, program, ProverResourceType::Cpu)?;

    // Serialize input
    let input = 42u32.to_le_bytes();

    // Execute
    let (public_values, report) = zkvm.execute(&input)?;

    // Prove
    let (public_values, proof, report) = zkvm.prove(&input, ProofKind::Compressed)?;

    // Verify
    let public_values = zkvm.verify(&proof)?;

    Ok(())
}

Directory Layout

crates/
  zkvm-interface/       ← core traits & types
  zkvm/{backend}/       ← backend adapters (sp1, openvm, …)
tests/                  ← guest programs & integration tests
scripts/sdk_installers/ ← SDK install helpers
docker/                 ← Dockerfiles & build contexts

Architecture

The Interface

ere-zkvm-interface exposes two core traits:

  • Compiler – compile a guest project into the correct zkVM artifact. For most this will be a RISCV ELF binary or some type that wraps it and includes extra metadata such as a proving and verifying key.
  • zkVM – execute, prove & verify that artifact. A zkVM instance is created for specific program, where the program comes from the Compiler.

Backend Crates

Each ere-{backend} crate implements the above traits for its zkVM.

Input Handling

The input is opaque to zkVM and will be passed as is, de/serialization needed to be handled by guest/host themselves.

Contributing

PRs and issues are welcome!

Disclaimer

zkVMs evolve quickly; expect breaking changes. Although the API is generic, its primary target is zkEVMs, which may for example, guide the default set of precompiles.

License

Licensed under either of

at your option.

About

Unified zkVM Interface & Toolkit

Topics

Resources

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT

Stars

Watchers

Forks

Packages

 
 
 

Contributors 8