pub fn commit<T: Serialize>(data: &T)
Expand description
Serialize the given data and commit it to the journal.
Data in the journal is included in the receipt and is available to the verifier. It is considered “public” data.
§Example
use risc0_zkvm::guest::env;
use std::collections::BTreeMap;
let data: BTreeMap<u64, bool> = BTreeMap::from([
(1, true),
(2, false),
]);
env::commit(&data);
More examples can be found in RISC Zero’s example page.
Additional explanation on I/O in the zkVM can be found in RISC Zero’s I/O documentation.