Function risc0_zkvm::guest::env::verify

source ·
pub fn verify(
    image_id: impl Into<Digest>,
    journal: &[impl Pod]
) -> Result<(), VerifyError>
Expand description

Verify there exists a receipt for an execution with image_id and journal.

Calling this function in the guest is logically equivalent to verifying a receipt with the same image ID and journal. Any party verifying the receipt produced by this execution can then be sure that the receipt verified by this call is also valid. In this way, multiple receipts from potentially distinct guests can be combined into one. This feature is know as composition.

In order to be valid, the crate::Receipt must have ExitCode::Halted(0) or ExitCode::Paused(0), an empty assumptions list, and an all-zeroes input hash. It may have any post crate::SystemState.

§Example

use risc0_zkvm::guest::env;

env::verify(HELLO_WORLD_ID, b"hello world".as_slice()).unwrap();