Expand description
§EML — Epoch Merkle Log
A single RFC 9162 append-only Merkle tree supporting dynamic sets of hash algorithms over a shared topology. Algorithms activate and deactivate between appends. A new algorithm’s view of pre-activation positions consists of deterministic null constants, enabling O(log n) algorithm addition without retroactive computation.
See docs/models/epoch-merkle-log.md for the formal model.
§Architecture
EML is algorithm-agnostic. Callers provide hash implementations via the
Hasher trait. Leaf storage is decoupled via the Storage trait.
The crate has zero runtime dependencies.
§Proofs
EML generates standard RFC 9162 inclusion and consistency proofs per
algorithm. Proofs verify against the standard verify_inclusion and
verify_consistency functions — no modified verifier is needed.
Specification vs. implementation. The formal model (§11) defines
project(S, a) as an O(n) specification oracle — the conceptual
per-algorithm leaf sequence that establishes correctness via equational
laws. The implementation does not materialize this sequence. Proof
generation instead uses subtree_root (§11c), which resolves sibling
hashes via O(1) stored-node lookups, achieving O(log n) proof generation.
The correctness bridge (§12) proves these produce identical output.
§Usage
use eml::{Log, Hasher, MemoryStorage};
// Implement Hasher for your algorithm, then:
let mut log = Log::new(MemoryStorage::new());
log.add_algorithm(0, my_hasher); // algorithm 0 active from genesis
log.append(b"first entry");
let root = log.root(0).unwrap();Structs§
- Algorithm
Info - Per-algorithm metadata snapshot (Definition 13).
- Consistency
Proof - Consistency proof — proves a tree of
old_sizeis a prefix ofnew_size. - Elided
Inclusion Proof - An inclusion proof with null subtree siblings elided.
- Inclusion
Proof - Inclusion proof — proves a leaf at
indexexists in a tree oftree_size. - Log
- An Epoch Merkle Log.
- Memory
Storage - In-memory leaf and node storage backed by collections.
- Memory
Storage Error - Error type for
MemoryStorageoperations. - Null
Table - Precomputed null subtree constants for a single algorithm.
Enums§
- Error
- Errors that can occur during EML operations.
Traits§
- Hasher
- Hash operations required by the EML tree.
- Storage
- Backend for persisting and retrieving raw leaf payloads and sealed internal node hashes.
Functions§
- elide_
inclusion_ proof - Elide null subtree siblings from a full inclusion proof.
- rehydrate_
inclusion_ proof - Rehydrate an elided inclusion proof by synthesizing null subtree hashes.
- verify_
consistency - Verify a consistency proof (RFC 9162 §2.1.4.2).
- verify_
inclusion - Verify an inclusion proof (RFC 9162 §2.1.3.2).
Type Aliases§
- Algorithm
Metas - Reconstructed metadata for registered algorithms: a list of
(alg_id, epochs)pairs. - Epochs
- Epoch metadata for a registered algorithm: a sequence of half-open
[start, end)intervals. - Result
- Convenience alias.