Struct risc0_zkvm::SegmentReceipt
source · pub struct SegmentReceipt {
pub seal: Vec<u32>,
pub index: u32,
pub hashfn: String,
}
Expand description
A receipt attesting to the execution of a Segment.
A SegmentReceipt attests that a [crate::Segment] was executed in a manner consistent with the ReceiptMetadata included in the receipt.
Fields§
§seal: Vec<u32>
The cryptographic data attesting to the validity of the code execution.
This data is used by the ZKP Verifier (as called by SegmentReceipt::verify_with_context) to cryptographically prove that this Segment was faithfully executed. It is largely opaque cryptographic data, but contains a non-opaque metadata component, which can be conveniently accessed with SegmentReceipt::get_metadata.
index: u32
Segment index within the Receipt
hashfn: String
Name of the hash function used to create this receipt.
Implementations§
source§impl SegmentReceipt
impl SegmentReceipt
sourcepub fn verify_with_context(
&self,
ctx: &VerifierContext
) -> Result<(), VerificationError>
pub fn verify_with_context( &self, ctx: &VerifierContext ) -> Result<(), VerificationError>
Verify the integrity of this receipt.
sourcepub fn get_metadata(&self) -> Result<ReceiptMetadata, VerificationError>
pub fn get_metadata(&self) -> Result<ReceiptMetadata, VerificationError>
Returns the ReceiptMetadata for this receipt.
sourcepub fn get_seal_bytes(&self) -> Vec<u8>
pub fn get_seal_bytes(&self) -> Vec<u8>
Return the seal for this receipt, as a vector of bytes.
Trait Implementations§
source§impl Clone for SegmentReceipt
impl Clone for SegmentReceipt
source§fn clone(&self) -> SegmentReceipt
fn clone(&self) -> SegmentReceipt
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for SegmentReceipt
impl Debug for SegmentReceipt
source§impl<'de> Deserialize<'de> for SegmentReceipt
impl<'de> Deserialize<'de> for SegmentReceipt
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
source§impl PartialEq for SegmentReceipt
impl PartialEq for SegmentReceipt
source§fn eq(&self, other: &SegmentReceipt) -> bool
fn eq(&self, other: &SegmentReceipt) -> bool
self
and other
values to be equal, and is used
by ==
.