Documentation Index
Fetch the complete documentation index at: https://mintlify.com/risc0/risc0/llms.txt
Use this file to discover all available pages before exploring further.
Zero-Knowledge Basics
What is a zero-knowledge proof?
What is a zero-knowledge proof?
- Alice executes code inside the zkVM
- Alice receives a receipt as proof
- Alice passes the receipt to Bob
- Bob verifies the receipt
Do I need to write ZK circuits to use RISC Zero?
Do I need to write ZK circuits to use RISC Zero?
- RISC-V circuit: Executes your compiled code
- Recursion circuit: Compresses multiple receipts into one
- STARK-to-SNARK circuit: Enables on-chain verification
What languages can I use to develop zkVM applications?
What languages can I use to develop zkVM applications?
Building zkVM Applications
What should I compute in the guest vs. the host?
What should I compute in the guest vs. the host?
- The computation must be verifiable
- Others need to trust the result
- The output is used by downstream systems
- Security and correctness are critical
- The computation doesn’t need to be proven
- It’s purely for convenience or preprocessing
- Performance is more important than verifiability
What do I do with the receipt once I've created it?
What do I do with the receipt once I've created it?
- Pass it to a verifier who wants to check the computation
- Provide the Image ID of the expected program
- Optionally share the source code or ELF binary so the verifier can reconstruct the Image ID
- The correct code was executed (via Image ID matching)
- The execution was valid (via cryptographic proof)
- The public outputs (journal) are correct
What is the Image ID and why is it important?
What is the Image ID and why is it important?
- Merkleization of the initial zkVM memory state
- Deterministically computed from the ELF binary
- Only includes functional code (excludes debug info, timestamps)
- Cryptographically links the binary to its receipts
How do I prevent buffer overflows when sharing data with the guest?
How do I prevent buffer overflows when sharing data with the guest?
- Write-once memory: Host-writable memory can only be written once
- No adjacent overwrites: Adjacent memory regions cannot be overwritten and executed
- Controlled input: Data is sent during program execution via secure channels
Performance and Limitations
What is the maximum execution length for a zkVM program?
What is the maximum execution length for a zkVM program?
How can I speed up processing in the zkVM?
How can I speed up processing in the zkVM?
- Use precompiles for cryptographic operations (SHA-256, BigInt, Keccak, ECDSA)
- Offload to the host - Perform non-critical computation on the host and verify results in the zkVM
- Enable GPU proving with CUDA or Metal backends
- Profile and optimize using
RISC0_INFO=1and the profiling guide - Use composition to split large programs into smaller, parallelizable parts
How do I handle large volumes of data in the guest?
How do I handle large volumes of data in the guest?
- Stream data incrementally rather than loading everything at once
- Use Merkle proofs to verify data integrity without loading all data
- Compute SHA hashes of large datasets externally and verify in the guest
- Leverage continuations to process data across multiple segments
env::read_frame() and env::read_framed() for improved cycle counts when reading input from the host.Security
Can't the host tamper with the guest code if it runs on the host machine?
Can't the host tamper with the guest code if it runs on the host machine?
- Modified binary: The seal won’t match the expected Image ID
- Modified execution: The execution trace will be invalid
- Modified output: The journal hash won’t match the hash in the receipt
How can I verify that specific source code was executed?
How can I verify that specific source code was executed?
- Reproduce the build using deterministic builds:
- Compare Image IDs: Check that the computed Image ID matches the Image ID in the receipt
- Verify the receipt: Use the Image ID to verify the receipt cryptographically
Troubleshooting
I'm running into build errors. Where should I look for help?
I'm running into build errors. Where should I look for help?
- Check the Troubleshooting Guide for common issues
- Search GitHub issues tagged “rust guest workarounds”
- Open a new issue if your problem isn’t documented
- Ask for help on the RISC Zero Discord