#[non_exhaustive]pub struct SetInclusionReceipt<Claim>{
pub claim: MaybePruned<Claim>,
pub root: Option<Receipt>,
pub merkle_path: Vec<Digest>,
pub verifier_parameters: Digest,
}verify only.Expand description
A receipt for a claim that is part of a set of verified claims (i.e. an aggregation).
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.claim: MaybePruned<Claim>Claim containing information about the computation that this receipt proves.
The standard claim type is ReceiptClaim, which represents a RISC-V zkVM execution.
root: Option<Receipt>Root receipt attesting to the validity of all claims included in the set committed to by the Merkle root in the journal of this receipt. It is required that this receipt was produced by running the aggregation set builder, which verifies each receipt before adding it to the set represented by a Merkle tree.
In certain contexts, the root claim can be omitted. In particular, the zkVM guest can
verify the root by making an assumption (i.e. by calling env::verify), and verifies in an
EVM context may reference previously proven claims via a verification cache in storage.
merkle_path: Vec<Digest>Merkle proof for inclusion in the set of claims attested to by the root receipt.
verifier_parameters: DigestA digest of the verifier parameters that can be used to verify this receipt.
Acts as a fingerprint to identify differing proof system or circuit versions between a prover and a verifier. Is not intended to contain the full verifier parameters, which must be provided by a trusted source (e.g. packaged with the verifier code).
Implementations§
Source§impl<Claim> SetInclusionReceipt<Claim>
impl<Claim> SetInclusionReceipt<Claim>
Sourcepub fn from_path_with_verifier_params(
claim: impl Into<MaybePruned<Claim>>,
merkle_path: Vec<Digest>,
verifier_parameters: impl Into<Digest>,
) -> Self
pub fn from_path_with_verifier_params( claim: impl Into<MaybePruned<Claim>>, merkle_path: Vec<Digest>, verifier_parameters: impl Into<Digest>, ) -> Self
Construct a SetInclusionReceipt with the given Merkle inclusion path and claim.
Path should contain all sibling nodes in the tree from the leaf to the root. Note that the path does not include the leaf or the root itself. Resulting receipt will have the given verifier parameter digest and no root receipt.
Sourcepub fn with_root(self, root_receipt: Receipt) -> Self
pub fn with_root(self, root_receipt: Receipt) -> Self
Add the given root receipt to this set inclusion receipt.
See SetInclusionReceipt::root for more information about the root receipt.
Sourcepub fn without_root(self) -> Self
pub fn without_root(self) -> Self
Drops the root receipt from this SetInclusionReceipt.
This is useful when the verifier has a cache of verified roots, as is the case for smart contract verifiers. Use this method when submitting this receipt as part of a batch of receipts to be verified, to reduce the encoded size of this receipt.
Sourcepub fn verify_integrity_with_context(
&self,
ctx: &VerifierContext,
set_verifier_params: SetInclusionReceiptVerifierParameters,
_recursion_verifier_params: Option<RecursionVerifierParameters>,
) -> Result<(), VerificationError>
pub fn verify_integrity_with_context( &self, ctx: &VerifierContext, set_verifier_params: SetInclusionReceiptVerifierParameters, _recursion_verifier_params: Option<RecursionVerifierParameters>, ) -> Result<(), VerificationError>
Verify the integrity of this receipt, ensuring the claim is attested to by the seal.
Sourcepub fn abi_encode_seal(&self) -> Result<Vec<u8>, SetInclusionEncodingError>
pub fn abi_encode_seal(&self) -> Result<Vec<u8>, SetInclusionEncodingError>
Encode the seal of the given receipt for use with EVM smart contract verifiers.
Appends the verifier selector, determined from the first 4 bytes of the verifier parameters digest, which contains the aggregation set builder image ID. If non-empty, the root receipt will be appended.
Trait Implementations§
Source§impl<Claim> Clone for SetInclusionReceipt<Claim>
impl<Claim> Clone for SetInclusionReceipt<Claim>
Source§fn clone(&self) -> SetInclusionReceipt<Claim>
fn clone(&self) -> SetInclusionReceipt<Claim>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl<Claim> Debug for SetInclusionReceipt<Claim>
impl<Claim> Debug for SetInclusionReceipt<Claim>
Source§impl<'de, Claim> Deserialize<'de> for SetInclusionReceipt<Claim>
impl<'de, Claim> Deserialize<'de> for SetInclusionReceipt<Claim>
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>,
Auto Trait Implementations§
impl<Claim> Freeze for SetInclusionReceipt<Claim>where
Claim: Freeze,
impl<Claim> RefUnwindSafe for SetInclusionReceipt<Claim>where
Claim: RefUnwindSafe,
impl<Claim> Send for SetInclusionReceipt<Claim>where
Claim: Send,
impl<Claim> Sync for SetInclusionReceipt<Claim>where
Claim: Sync,
impl<Claim> Unpin for SetInclusionReceipt<Claim>where
Claim: Unpin,
impl<Claim> UnwindSafe for SetInclusionReceipt<Claim>where
Claim: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more