pub struct ProofReceipt {
pub version: u32,
pub query: String,
pub query_hash: [u8; 32],
pub timestamp: String,
pub context_hash: [u8; 32],
pub state_root: [u8; 32],
pub chunk_tree_root: [u8; 32],
pub chunk_proofs: Vec<ChunkProof>,
pub sources: Vec<SourceRef>,
pub signature: [u8; 64],
pub signer_public_key: [u8; 32],
pub device_id: [u8; 16],
}Expand description
A complete cryptographic proof receipt.
Contains everything needed to independently verify what context an AI had access to when it made a decision or generated code.
Fields§
§version: u32Schema version (starts at 1)
query: StringThe original query text
query_hash: [u8; 32]BLAKE3 hash of the query
timestamp: StringISO 8601 timestamp
context_hash: [u8; 32]BLAKE3 hash of the assembled context string
state_root: [u8; 32]Merkle root of the entire graph state
chunk_tree_root: [u8; 32]Merkle root of all chunk text hashes (binary tree)
chunk_proofs: Vec<ChunkProof>Per-chunk Merkle inclusion proofs
sources: Vec<SourceRef>Human-readable source references
signature: [u8; 64]Ed25519 signature over signing_bytes()
signer_public_key: [u8; 32]Signer’s Ed25519 public key
device_id: [u8; 16]Signer’s device ID
Implementations§
Source§impl ProofReceipt
impl ProofReceipt
Sourcepub fn signing_bytes(&self) -> Vec<u8> ⓘ
pub fn signing_bytes(&self) -> Vec<u8> ⓘ
Compute deterministic bytes for signing.
Layout: version (4) || query_hash (32) || context_hash (32) || state_root (32) || chunk_tree_root (32)
Total: 132 bytes
Sourcepub fn verify_signature(&self) -> Result<()>
pub fn verify_signature(&self) -> Result<()>
Verify the Ed25519 signature over signing_bytes().
Sourcepub fn verify_chunk_proofs(&self) -> Result<()>
pub fn verify_chunk_proofs(&self) -> Result<()>
Verify all chunk Merkle proofs against chunk_tree_root.
Sourcepub fn verify_context_hash(&self, context: &str) -> bool
pub fn verify_context_hash(&self, context: &str) -> bool
Verify that context_hash matches the BLAKE3 hash of the given context string.
Sourcepub fn verify_all(&self) -> Result<()>
pub fn verify_all(&self) -> Result<()>
Run all verification checks: signature + chunk proofs.
Trait Implementations§
Source§impl Clone for ProofReceipt
impl Clone for ProofReceipt
Source§fn clone(&self) -> ProofReceipt
fn clone(&self) -> ProofReceipt
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more