vex_anchor/lib.rs
1//! # VEX Anchor
2//!
3//! Public anchoring layer for VEX audit logs.
4//!
5//! Provides cryptographic anchoring of Merkle roots to external systems for
6//! tamper-evident, publicly-verifiable audit trails.
7//!
8//! ## Supported Backends (2026)
9//!
10//! - **FileAnchor**: Local append-only JSON log (default, for development)
11//! - **GitAnchor**: Commits roots to a Git repository
12//! - **OpenTimestampsAnchor**: Bitcoin calendar anchoring via the public OTS protocol
13//! - **EthereumAnchor**: Ethereum calldata anchoring via JSON-RPC
14//! - **CelestiaAnchor**: Celestia DA blob anchoring
15//!
16//! ## Quick Start
17//!
18//! ```rust,no_run
19//! use vex_anchor::{AnchorBackend, FileAnchor, AnchorMetadata};
20//! use vex_core::Hash;
21//!
22//! #[tokio::main]
23//! async fn main() -> Result<(), Box<dyn std::error::Error>> {
24//! let anchor = FileAnchor::new("./anchors.json");
25//!
26//! let root = Hash::digest(b"merkle_root_data");
27//! let metadata = AnchorMetadata::new("tenant-1", 100);
28//!
29//! let receipt = anchor.anchor(&root, metadata).await?;
30//! println!("Anchored at: {}", receipt.anchor_id);
31//!
32//! Ok(())
33//! }
34//! ```
35
36mod backend;
37mod error;
38
39#[cfg(feature = "file")]
40mod file;
41
42#[cfg(feature = "git")]
43mod git;
44
45#[cfg(feature = "opentimestamps")]
46mod opentimestamps;
47
48#[cfg(feature = "ethereum")]
49mod ethereum;
50
51#[cfg(feature = "celestia")]
52mod celestia;
53
54pub use backend::{AnchorBackend, AnchorMetadata, AnchorReceipt};
55pub use error::AnchorError;
56
57#[cfg(feature = "file")]
58pub use file::FileAnchor;
59
60#[cfg(feature = "git")]
61pub use git::GitAnchor;
62
63#[cfg(feature = "opentimestamps")]
64pub use opentimestamps::OpenTimestampsAnchor;
65
66#[cfg(feature = "ethereum")]
67pub use ethereum::EthereumAnchor;
68
69#[cfg(feature = "celestia")]
70pub use celestia::CelestiaAnchor;