Function sp1_lib::io::commit

source ·
pub fn commit<T: Serialize>(value: &T)
Expand description

Commit a serializable object to the public values stream.

§Examples

use serde::{Deserialize, Serialize};

#[derive(Serialize, Deserialize)]
struct MyStruct {
    a: u32,
    b: u32,
}

let data = MyStruct {
    a: 1,
    b: 2,
};
sp1_zkvm::io::commit(&data);