confium_transparency/lib.rs
1//! Transparency log + OpenTimestamps + Evidence Records for Confium.
2//!
3//! Three layers of artifact provenance over time:
4//!
5//! - **Merkle tree transparency log**: every artifact (cert, signature,
6//! revocation, re-share event) is appended. Tree roots periodically
7//! anchored to Bitcoin via OpenTimestamps. Verifiers can prove any
8//! artifact was in the publicly-visible tree as of a given Bitcoin block.
9//! - **OpenTimestamps (OTS)**: anchors hashes to Bitcoin blockchain via
10//! public calendar servers.
11//! - **Evidence Records (RFC 4998 ERS)**: long-term archival protection
12//! via periodic re-timestamping as hash algorithms age.
13//!
14//! See `TODO.roadmap/36-transparency-and-ots.md` and
15//! `TODO.roadmap/37-long-term-archival.md` for full specs.
16//!
17//! # Example
18//!
19//! ```
20//! use confium_transparency::{MerkleTree, entry::{ArtifactType, MerkleEntry}};
21//!
22//! let mut tree = MerkleTree::new();
23//! let hash = [0u8; 32]; // sha256 of your artifact
24//! let entry = MerkleEntry::new(0, ArtifactType::CertificateIssuance, hash);
25//! let seq = tree.append(entry);
26//! let root = tree.root();
27//! let proof = tree.inclusion_proof(seq)?;
28//! let entry_ref = tree.entry(seq)?;
29//! MerkleTree::verify_inclusion(entry_ref, &proof, root)?;
30//! # Ok::<(), confium_transparency::MerkleError>(())
31//! ```
32
33#![forbid(unsafe_code)]
34#![allow(missing_docs)] // TODO: document before 1.0
35
36pub mod entry;
37pub mod ers;
38pub mod merkle;
39pub mod ots;
40pub mod proof;
41pub mod test_vectors;
42pub mod witness;
43
44#[cfg(test)]
45mod props;
46
47pub use entry::*;
48pub use merkle::*;
49pub use proof::*;