Trait ZkvmHost

Source
pub trait ZkvmHost: Zkvm {
    type Guest: ZkvmGuest;

    // Required methods
    fn add_hint<T: Serialize>(&self, item: T);
    fn simulate_with_hints(&mut self) -> Self::Guest;
    fn run(&mut self, with_proof: bool) -> Result<(), Error>;
}
Expand description

A trait implemented by the prover (“host”) of a zkVM program.

Required Associated Types§

Source

type Guest: ZkvmGuest

The associated guest type

Required Methods§

Source

fn add_hint<T: Serialize>(&self, item: T)

Give the guest a piece of advice non-deterministically

Source

fn simulate_with_hints(&mut self) -> Self::Guest

Simulate running the guest using the provided hints.

Provides a simulated version of the guest which can be accessed in the current process.

Source

fn run(&mut self, with_proof: bool) -> Result<(), Error>

Run the guest in the true zk environment using the provided hints.

This runs the guest binary compiled for the zkVM target, optionally creating a SNARK of correct execution. Running the true guest binary comes with some mild performance overhead and is not as easy to debug as simulate_with_hints.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§