Crate risc0_zkvm

source ·
Expand description

The RISC Zero zkVM is a RISC-V virtual machine that produces zero-knowledge proofs of code it executes. By using the zkVM, a cryptographic receipt is produced which anyone can verify was produced by the zkVM’s guest code. No additional information about the code execution (such as, for example, the inputs provided) is revealed by publishing the receipt.

Additional (non-reference) resources for using our zkVM that you may also find helpful, especially if you’re new to the RISC Zero zkVM. These include:

  • Our zkVM Tutorial, which walks you through writing your first zkVM project.
  • The cargo risczero tool. It includes a new command which generates code for building and launching a zkVM guest and guidance on where projects most commonly modify host and guest code.
  • The examples, which contains various examples using our zkVM.
  • This clip from our presentation at ZK Hack III gives an overview of the RISC Zero zkVM. Our YouTube channel has many more videos as well.
  • We track zkVM issues with known workarounds using the rust guest workarounds GitHub tag. If you’re having problems running your code in the zkVM, you can see if there’s a workaround, and if you’re using a workaround, you can track when it gets resolved to a permanent solution.
  • And more on the RISC Zero developer website!

§Crate Feature Flags

The following feature flags are supported.

Note that in order to use risc0-zkvm in the guest, you must disable the “prove” feature by setting default-features = false.

FeatureTarget(s)ImpliesDescription
clientall except rv32imstdEnables the client API.
cudaprove, stdEnables CUDA GPU acceleration for the prover. Requires CUDA toolkit to be installed.
disable-dev-modeall except rv32imDisables dev mode so that proving and verifying may not be faked. Used to prevent a misplaced RISC0_DEV_MODE from breaking security in production systems.
metalmacosprove, stdEnables Metal GPU acceleration for the prover.
proveall except rv32imstdEnables the prover, incompatible within the zkvm guest.
stdallSupport for the Rust stdlib.

Modules§

  • The RISC Zero zkVM’s guest-side RISC-V API.
  • Serialization and deserialization tools for the RISC Zero zkVM
  • SHA-256 hashing services

Macros§

  • Construct a SyscallName declaration at compile time.
  • Used for defining the guest’s entrypoint and main function.

Structs§

Enums§

Constants§

Traits§

  • Connects a zkVM client and server
  • An Executor can execute a given ELF binary.
  • A Prover can execute a given ELF binary and produce a Receipt that can be used to verify correct computation.

Functions§

Type Aliases§