Skip to main content

ChainAnchor

Trait ChainAnchor 

Source
pub trait ChainAnchor: Send + Sync {
    // Required methods
    fn anchor(&self, hash: &[u8; 32]) -> Result<AnchorReceipt, String>;
    fn verify(&self, receipt: &AnchorReceipt) -> Result<bool, String>;
    fn backend_name(&self) -> &str;
}
Expand description

Trait for anchoring chain state to an external ledger or store.

Implementations might target Bitcoin (via OpenTimestamps), Ethereum, a ruvector root chain, or simply a mock for testing.

Required Methods§

Source

fn anchor(&self, hash: &[u8; 32]) -> Result<AnchorReceipt, String>

Anchor the given hash to the external backend.

Source

fn verify(&self, receipt: &AnchorReceipt) -> Result<bool, String>

Verify a previously anchored hash against its receipt.

Source

fn backend_name(&self) -> &str

Return the backend name for display/logging.

Implementors§