risc0_aggregation

Struct SetInclusionReceipt

Source
#[non_exhaustive]
pub struct SetInclusionReceipt<Claim>
where Claim: Digestible + Clone + Serialize,
{ pub claim: MaybePruned<Claim>, pub root: Option<Receipt>, pub merkle_path: Vec<Digest>, pub verifier_parameters: Digest, }
Available on crate feature 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
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional 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: Digest

A digest of the verifier parameters that can be used to verify this receipt.

Acts as a fingerprint to identity 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>
where Claim: Digestible + Clone + Serialize,

Source

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.

Source

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.

Source

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.

Source

pub fn verify_integrity_with_context( &self, ctx: &VerifierContext, set_verifier_params: SetInclusionReceiptVerifierParameters, _recursion_verifier_params: Option<RecursionVerifierParamters>, ) -> Result<(), VerificationError>

Verify the integrity of this receipt, ensuring the claim is attested to by the seal.

Source

pub fn abi_encode_seal(&self) -> Result<Vec<u8>, EncodingError>

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>
where Claim: Digestible + Clone + Serialize + Clone,

Source§

fn clone(&self) -> SetInclusionReceipt<Claim>

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<Claim> Debug for SetInclusionReceipt<Claim>
where Claim: Digestible + Clone + Serialize + Debug,

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de, Claim> Deserialize<'de> for SetInclusionReceipt<Claim>
where Claim: Digestible + Clone + Serialize + Deserialize<'de>,

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl<Claim> Serialize for SetInclusionReceipt<Claim>
where Claim: Digestible + Clone + Serialize + Serialize,

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dst: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,