Skip to main content

FrameAttestation

Struct FrameAttestation 

Source
pub struct FrameAttestation {
    pub frame: FrameId,
    pub attestation: Option<ProvenanceAttestation>,
    pub inclusion_proof: Option<InclusionProof>,
}
Expand description

The one FrameAttestation (SPEC.md §6.5.5). It is defined in contextgraph-types because it is a wire type that rides ContextQueryResult, and it is re-exported here so a host author has one import rather than two. This crate briefly defined two more of its own; see #161. What a result set says about one frame’s attestation — the wire carrier that keeps a ProvenanceAttestation beside the frame it covers (SPEC.md §6.5.5, F11).

§Why the identity is echoed in full

A parallel array indexed by position would be smaller and unusable as evidence: a provider that reorders, omits, or duplicates a frame would shift an attestation onto the wrong one, and a host filtering the set — which is the normal case — would have to re-derive the mapping from an order nobody wrote down. Carrying the whole FrameId triple makes an entry self-describing, which is the same reasoning FrameVerdict already applies to context/verify. It is also exactly what a verifier needs: provider_id and content_digest are two of the three inputs to frame_commitment, and neither is recoverable from the frame body alone.

§Why both members are optional

The cheapest honest way to sign an answer is one signature over the result-set Merkle root, with a per-frame inclusion proof and no per-frame signature at all. Requiring attestation would make that shape unrepresentable and force a provider into n signatures to say what one says. Requiring inclusion_proof would tax a provider that signs frames individually and publishes no root. An entry carrying neither is noise, and carries_evidence is how a host says so.

Fields§

§frame: FrameId

The frame this entry attests, named in full rather than by position.

§attestation: Option<ProvenanceAttestation>

A detached signature over this frame’s own frame_commitment.

Absent when the provider signed only the result-set root: the frame is then attested through inclusion_proof, not on its own.

§inclusion_proof: Option<InclusionProof>

A proof that this frame’s commitment is a leaf of the signed result_attestation root (SPEC.md §6.5.3).

Optional on the wire, and the reason is a host that keeps a subset: once frames are dropped their sibling commitments are gone, and the root can never be recomputed again. See ADR 0014.

Implementations§

Source§

impl FrameAttestation

Source

pub fn signed( frame: FrameId, attestation: ProvenanceAttestation, ) -> FrameAttestation

A per-frame signature with no inclusion proof.

Source

pub fn proven( frame: FrameId, inclusion_proof: InclusionProof, ) -> FrameAttestation

Membership of a signed result set, with no per-frame signature.

Source

pub fn carries_evidence(&self) -> bool

Whether this entry carries anything a verifier can act on.

An entry with neither a signature nor a proof names a frame and asserts nothing about it. A host MUST NOT read that as attested — it is wire noise, and F9’s “unverifiable degrades to unattested” covers it.

Source

pub fn with_inclusion_proof(self, proof: InclusionProof) -> FrameAttestation

Attach an inclusion proof, so a per-frame signature and result-set membership travel together.

Trait Implementations§

Source§

impl Clone for FrameAttestation

Source§

fn clone(&self) -> FrameAttestation

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for FrameAttestation

Source§

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

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

impl<'de> Deserialize<'de> for FrameAttestation

Source§

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

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

impl Eq for FrameAttestation

Source§

impl PartialEq for FrameAttestation

Source§

fn eq(&self, other: &FrameAttestation) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Serialize for FrameAttestation

Source§

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

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for FrameAttestation

Auto Trait Implementations§

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, dest: *mut u8)

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

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

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> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. 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 = !

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

fn try_from(value: U) -> Result<T, !>

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<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