Crate chrono_merkle

Crate chrono_merkle 

Source
Expand description

§ChronoMerkle Tree

A time-aware Merkle tree implementation with delta-based updates, programmable nodes, and sparse timestamp indexing. Designed for blockchain and distributed systems.

§Features

  • Time-aware: Each leaf includes a timestamp for efficient time-based queries
  • Delta-based updates: Only affected branches are recomputed on insert
  • Programmable nodes: Custom validation logic at internal nodes
  • Sparse indexing: Fast timestamp-based lookups and range queries
  • Generic: Works with any hash function and hash size

§Example

use chrono_merkle::{ChronoMerkleTree, Blake3Hasher};

let mut tree: ChronoMerkleTree = ChronoMerkleTree::new(Blake3Hasher::default());
tree.insert(b"data1", 1000).unwrap();
tree.insert(b"data2", 1001).unwrap();

let proof = tree.generate_proof(0).unwrap();
assert!(tree.verify_proof(&proof).unwrap());

Re-exports§

pub use error::ChronoMerkleError;
pub use hash::Blake3Hasher;
pub use hash::HashFunction;
pub use node::Node;
pub use node::NodeType;
pub use proof::ChronoProof;
pub use proof::ProofStep;
pub use security::SecurityEvent;
pub use security::SecurityEventType;
pub use security::SecurityLevel;
pub use security::SecurityLogger;
pub use security::NoOpLogger;
pub use security::StdErrLogger;
pub use sparse_index::SparseIndex;
pub use tree::ChronoMerkleTree;
pub use tree::TreeConfig;

Modules§

config
Configuration for ChronoMerkleTree
constructors
Constructor methods for ChronoMerkleTree
delta
Delta operations and rollback functionality for ChronoMerkleTree
error
Error types for ChronoMerkle Tree
hash
Hash function abstraction for ChronoMerkle Tree
node
Node types for ChronoMerkle Tree
operations
Core tree operations for ChronoMerkleTree
proof
Proof generation and verification for ChronoMerkle Tree
proofs
Proof generation and verification for ChronoMerkleTree
rebuild
Tree rebuilding logic for ChronoMerkleTree
security
Security event logging and audit trails for ChronoMerkle trees
serde_impl
Serialization support for ChronoMerkle Tree
sparse_index
Sparse timestamp-based indexing for ChronoMerkle Tree
storage
Storage backend trait and tree state serialization
traits
Trait definitions for extensibility
tree
Core ChronoMerkleTree implementation
validation
Input validation methods for ChronoMerkleTree
visualization
Visualization methods for ChronoMerkleTree

Type Aliases§

DefaultChronoMerkleTree
Type alias for the most common ChronoMerkleTree configuration.