Skip to main content

rvm_types/
proof.rs

1//! Proof-system types.
2
3/// Proof tier (P1, P2, P3).
4#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
5#[repr(u8)]
6pub enum ProofTier {
7    /// P1: Capability check (< 1 us).
8    P1 = 1,
9    /// P2: Policy validation (< 100 us).
10    P2 = 2,
11    /// P3: Deep proof (< 10 ms).
12    P3 = 3,
13}
14
15/// Result of a proof verification.
16#[derive(Debug, Clone, Copy, PartialEq, Eq)]
17pub enum ProofResult {
18    /// Proof passed.
19    Passed,
20    /// Proof failed.
21    Failed,
22    /// Proof was escalated to a higher tier.
23    Escalated,
24}
25
26/// A proof token that attests to a verified proof.
27#[derive(Debug, Clone, Copy)]
28pub struct ProofToken {
29    /// The tier that was verified.
30    pub tier: ProofTier,
31    /// Epoch when the proof was generated.
32    pub epoch: u32,
33    /// Truncated hash of the proof payload.
34    pub hash: u32,
35}