[package] name = "risc0-zkvm" description = "RISC Zero zero-knowledge VM" version = { workspace = true } edition = { workspace = true } license = { workspace = true } homepage = { workspace = true } repository = { workspace = true } [[bench]] name = "fib" harness = false required-features = ["prove"] [[bench]] name = "guest_run" harness = false [[example]] name = "datasheet" required-features = ["prove"] [[example]] name = "fib" required-features = ["prove"] [[example]] name = "recursion" required-features = ["prove"] [dependencies] anyhow = { version = "1.0", default-features = false } borsh = { version = "1.5", default-features = false, features = ["derive"] } bytemuck = { version = "1.13", features = ["extern_crate_alloc"] } getrandom = { version = "0.2", features = ["custom"] } hex = { version = "0.4.3", default-features = false, features = ["alloc"] } risc0-binfmt = { workspace = true } risc0-circuit-keccak = { workspace = true } risc0-circuit-recursion = { workspace = true } risc0-circuit-rv32im = { workspace = true } risc0-core = { workspace = true } risc0-groth16 = { workspace = true } risc0-zkp = { workspace = true } risc0-zkvm-platform = { workspace = true, features = [ "rust-runtime", "export-getrandom", ] } rrs-lib = "0.1" semver = { version = "1.0", default-features = false } serde = { version = "1.0", default-features = false, features = [ "alloc", "derive", ] } stability = "0.2" tracing = { version = "0.1", default-features = false, features = [ "attributes", ] } # Host dependencies [target.'cfg(not(target_os = "zkvm"))'.dependencies] addr2line = { version = "0.22", features = ["rustc-demangle"], optional = true } bincode = { version = "1.3", optional = true } bonsai-sdk = { workspace = true, optional = true } bytes = { version = "1.7", features = ["serde"], optional = true } elf = { version = "0.7", default-features = false, optional = true } keccak = { version = "0.1.5", optional = true } lazy-regex = { version = "3.3", optional = true } num-bigint = { version = "0.4", default-features = false, optional = true } num-traits = { version = "0.2", default-features = false, optional = true } prost = { version = "0.13", optional = true } rand = { version = "0.8", optional = true } rayon = { version = "1.5", optional = true } redis = { version = "0.27.2", default-features = false, features = [ "tls-native-tls", ], optional = true } risc0-build = { workspace = true, optional = true } rustc-demangle = { version = "0.1", optional = true } sha2 = { version = "0.10", default-features = false } sha3 = { version = "0.10", default-features = false } tempfile = { version = "3", optional = true } typetag = { version = "0.2", optional = true } [dev-dependencies] bincode = "1.3" chrono = { version = "0.4", default-features = false, features = ["serde"] } ciborium = "0.2" clap = { version = "4.5", features = ["derive"] } mini-redis = { version = "0.4.1", default-features = false } postcard = { version = "1.1", features = ["alloc"] } rand = "0.8" rmp-serde = "1.3" tokio = { version = "1.42.0", default-features = false, features = ["macros"] } tracing-forest = "0.1" tracing-subscriber = { version = "0.3", features = ["env-filter"] } [target.'cfg(not(target_os = "zkvm"))'.dev-dependencies] crypto-bigint = { version = "0.5", default-features = false, features = [ "rand", ] } enum-iterator = "2.1" flate2 = "1.0" hotbench = { workspace = true } human-repr = { version = "1.0", features = ["1024"] } puffin = "0.19" puffin_http = "0.16" risc0-circuit-keccak-methods = { path = "../circuit/keccak/methods" } risc0-zkvm-methods = { path = "methods", features = ["std"] } serde_json = "1.0" serde_with = "3.11" tabled = "0.16" tar = "0.4" tempfile = "3" test-log = { version = "0.2", default-features = false, features = ["trace"] } [package.metadata.docs.rs] rustdoc-args = ["--cfg", "docsrs"] # NOTE: cuda and metal are excluded because their build scripts require external tools. features = ["client", "prove", "getrandom", "std", "unstable"] [features] client = [ "dep:bincode", "dep:bytes", "dep:lazy-regex", "dep:risc0-build", "dep:prost", "dep:tempfile", "std", ] bonsai = ["dep:bonsai-sdk"] cuda = [ "prove", "risc0-circuit-keccak/cuda", "risc0-circuit-recursion/cuda", "risc0-circuit-rv32im/cuda", "risc0-zkp/cuda", ] default = ["client", "bonsai"] r0vm-ver-compat = [] disable-dev-mode = [] # This flag uses the docker environment to build test guests such as multi-test # to ensure accurate cycle and segment counts. Tests that have been gated on # this flag measure cycles and segments. Without this flag, the rust build # system will generate binaries that not identical across all architectures. # While this is acceptable for most tests, the tests counting cycles and # segments will fail intermittently. It does not effect non-test code. docker = [] dual = [] # The zkVM exposes a getrandom implementation that panics by default. This will # expose a getrandom implementation that uses the `sys_random` ecall. getrandom = ["risc0-zkvm-platform/getrandom"] # The zkVM uses a bump-pointer heap allocator by default which does not free # memory. This will use a slower linked-list heap allocator to reclaim memory. heap-embedded-alloc = ["risc0-zkvm-platform/heap-embedded-alloc"] metal = ["prove"] prove = [ "client", "dep:addr2line", "dep:bincode", "dep:elf", "dep:keccak", "dep:lazy-regex", "dep:num-bigint", "dep:num-traits", "dep:prost", "dep:rand", "dep:rayon", "dep:rustc-demangle", "dep:tempfile", "dep:typetag", "risc0-circuit-keccak/prove", "risc0-circuit-recursion/prove", "risc0-circuit-rv32im/prove", "risc0-core/perf", "risc0-groth16/prove", "risc0-zkp/prove", "std", ] redis = ["dep:redis"] std = [ "anyhow/std", "hex/std", "risc0-binfmt/std", "risc0-groth16/std", "risc0-zkp/std", "serde/std", "sha2/std", ] unstable = ["risc0-zkvm-platform/unstable"]