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: u32Number 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: u64Rolling 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
impl Clone for Attestation
Source§fn clone(&self) -> Attestation
fn clone(&self) -> Attestation
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more