Skip to main content

Attestation

Struct Attestation 

Source
pub struct Attestation {
    pub frame_count: u32,
    pub final_hash: u64,
    pub checkpoints: Vec<u64>,
}
Expand description

A rolling hash of a run’s video output, and the checkpoints along the way.

§What is attested

Per frame, the input applied and the framebuffer it produced, folded into one rolling hash. Both halves are load-bearing:

  • The framebuffer is the user-visible output the determinism contract promises is bit-identical for the same ROM, seed, and input sequence.
  • The input is folded in because output alone does not pin the input stream. A ROM that ignores the controller — a test ROM, an attract-mode demo, a cutscene — produces identical video no matter what buttons the movie claims were pressed, so an output-only hash would confirm a tampered input log as genuine. Found by exactly that: an end-to-end tamper test flipped a button bit in a movie for an input-ignoring ROM and the run still verified.

Together they attest the real claim: these inputs, applied to this ROM, produced this output.

Hashing the core snapshot instead would be strictly stronger at detecting divergence, and was rejected for one reason: the snapshot schema is versioned and bumps between releases (PPU_SNAPSHOT_VERSION has reached 8), so every schema bump would silently invalidate every previously-recorded attestation. A 256x240 RGBA framebuffer is stable for as long as the NES is the NES. An attestation is only worth recording if it can still be checked years later.

Audio is not covered: samples are drained by the host as they are produced, so the core cannot see a whole run’s audio without the frontend cooperating. Saying so is better than implying coverage that is not there.

Fields§

§frame_count: u32

Number of frames the attestation covers. Cross-checked against the input stream on load, so a tail that describes a different run is rejected rather than compared against the wrong frame count.

§final_hash: u64

Rolling hash after the final frame.

§checkpoints: Vec<u64>

Rolling hash after frames INTERVAL-1, 2*INTERVAL-1, … in order.

Trait Implementations§

Source§

impl Clone for Attestation

Source§

fn clone(&self) -> Attestation

Returns a duplicate 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 Debug for Attestation

Source§

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

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

impl PartialEq for Attestation

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Eq for Attestation

Source§

impl StructuralPartialEq for Attestation

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> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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