Skip to main content

Crate eml

Crate eml 

Source
Expand description

eml — the Epoch Merkle Log: a general-purpose append-only log.

The EML library — the polydigest combinator over the cml single- algorithm engine — instantiated at arity k = 2, no prefix (the caller’s Hasher is used directly, with no domain-separation wrapper). It is the behavioral successor of the frozen pre-campaign baseline: its root and inclusion proofs are byte-identical to that baseline (the peak-bag is the same canonical fold), while the consistency proof is upgraded to the MMR prefix-form for durable witnesses. Conformance is anchored by the Lean corpus and the durability property tests, not a byte-equality oracle.

The full EML surface is re-exported, so a consumer reaches the library through eml::*. The instantiation’s only opinion is the arity: the config preset and new/from_storage constructors fix k = 2, while the re-exported NaryMerkleLog still accepts any TreeConfig for callers that need a different arity.

Modules§

binding_proof
Cross-algorithm binding proof — a first-class, named proof API.
error
The EML library’s error surface, reached through eml::error::*. The driver’s storage-parameterised polydigest::LogError is the public Error; this module preserves the eml::error::Error path the historical surface exposed.
evolution
The epoch-coupled append-only evolution surface.
filling
fill — the operator-level filling operation over a sealed crate::Sealed.
hasher
The Hasher seam — the multihash interface of the kernel.
mr
Merkle root and evaluation over the n-ary subtree, with canonicalization.
mutable
polydigest(cmt) — the polydigest combinator over the Canonical Mutable Tree.
proof
The full proof surface a consumer reaches through polydigest::proof::* (and so eml::proof::*): the CML engine’s append-only consistency + inclusion/ leaf proofs, plus the combinator’s binding/coupling/audit proofs and the epoch-coupled evolution checks. The originals live in cml and the combinator modules; this module re-exports them, never a parallel copy.
root
The polydigest combinator’s root construction and coupling verification.
seal
Freezing the combinator’s append-only log into the one commitment currency crate::Sealed.
snapshot
BoundSnapshot — the epoch facet over the general structural Seal.
snapshot_proof
Snapshot proof — the aggregate proof over a sealed Sealed.
storage
Storage abstraction for leaf and node persistence.
subtree
Subtree descriptor for structured appends.
topology
Shared k-ary structural primitives — the perfect-subtree decomposition and the generic grouping fold.
tree
The combinator driver: the multi-algorithm append-only log over one shared data substrate.

Structs§

AuditPayload
The raw payload of an audit verification checkpoint.
BindingProof
A cross-algorithm binding proof.
BoundSnapshot
The epoch facet over a structural Seal: the seal paired with the committed epoch timeline, from which the binding root is derived.
ClaimedLeaf
One claimed leaf in a snapshot proof: a spine::LeafProof paired with the algorithm whose member root it verifies against.
CmtConfig
Configuration for a Cmt.
ConsistencyProof
Consistency proof: proves tree at old_size is a prefix of tree at new_size.
CouplingProof
A coupling proof that opens a binding root to its children: the raw algorithm roots together with the committed epoch timeline. This is the metadata-opening segment of inclusion/inactivity proofs: once authenticated against the binding root, alg_epochs is the trusted source for active(X, p).
EpochTree
The polydigest combinator over a Cmt — the Epoch Merkle Tree (polydigest(cmt)).
FilledTree
A complete (gapless), readable single-algorithm tree produced by fill, verified against the Sealed’s committed binding root.
InclusionProof
Inclusion proof: path from a leaf to the root.
LeafProof
A self-contained leaf proof: a leaf hash bound to its position, ready to verify against a trusted root and the structure’s skeleton.
MemoryStorage
In-memory leaf and node storage backed by collections.
Meta
Opaque, application-defined byte payload attached to a Merkle commitment.
NaryMerkleLog
An n-ary Merkle Append-Only Log — the polydigest combinator’s driver over one shared data substrate.
NullRun
One null collapse run of a single algorithm: the algorithm projects to the null constant across the aligned k-ary block [left, left + k^height).
ProofStep
A single level in a Merkle proof path.
RunExtent
One committed canonicalization run-extent: a contiguous collapse of arity^height consecutive leaves into a single subtree, beginning at leaf index left.
Seal
The general structural commitment lattice: a sealed, resumable frontier.
Sealed
The combinator’s frozen multi-algorithm snapshot: a structural Seal bound to a committed epoch timeline, deriving the binding root.
SkeletonStep
One step of an inclusion skeleton, ordered leaf → root.
SnapshotProof
An aggregate proof over a sealed Sealed.
TreeConfig
Configuration for the n-ary Merkle tree.
TrustedBindingRoot
A trusted per-algorithm binding root presented to a binding proof.
VerifierConfig
Configuration options for proof verification (local node policy).

Enums§

CmtError
A CMT construction or mutation error.
Error
The combinator driver’s error, parameterised by the storage backend’s error type.
FillError
Why a fill request was rejected.
FillKind
Which readable materialization fill produces.
LogError
The combinator driver’s error, parameterised by the storage backend’s error type.
LogKind
Whether log-level appends are flat leaf appends or subtree appends.
Subtree
Describes a subtree to be appended as a single logical unit. Leaves are the atomic data items (czds). Nodes define intermediate n-ary nodes (transactions, commits).

Constants§

LOG_ARITY
The log arity: binary (k = 2).

Traits§

Hasher
Hash operations required by the Merkle Spine.
Storage
Backend for persisting and retrieving raw leaf payloads and sealed internal node hashes.

Functions§

all_null_runs
All algorithms’ null collapse runs at (tree_size, arity), derived from the committed epoch intervals: (alg_id, runs) for every registered algorithm, sorted by algorithm ID, omitting algorithms with no null run (fully active over [0, tree_size)). This is the activation committed in every binding root; the redundancy physically binds the trees.
bag_peaks
Bag a frontier’s peaks into the single member root under hasher.
combined_root
The combined root: the canonicalization fold (spine::nary_mr) over the per-algorithm member roots as children, under one algorithm’s own hash H.
committed_active_algs
Derive the active algorithm set at tree_size from a committed timeline: the algorithms whose epochs cover the final position tree_size - 1. Returned sorted by algorithm ID (inherited from the timeline ordering).
committed_active_at
Read the authenticated activity of alg_id at position index from a committed epoch timeline. Returns None if the algorithm has no committed timeline.
config
The EML configuration: arity k = 2, no prefix.
constant_time_eq
Timing-safe comparison of two byte slices.
count_leaves
Count the total number of leaves in a structured subtree.
evaluate
Recursively evaluate the root hash of a structured subtree.
fill
Rebuild a complete (gapless) single-algorithm tree from a sealed Sealed and the real historical leaf data, verifying the rebuilt binding root against the committed one — the trustless verification path.
from_storage
Reconstruct an existing log from storage at the EML arity (k = 2).
frontier_for_size
Frontier decomposition of a log of n leaves at arity k.
mountain_skeleton
Compute the MMR inclusion skeleton for a leaf index in a tree of tree_size leaves at arity k.
nary_mr
Compute the Merkle root of an ordered sequence of child digests.
new
Create a new, empty log over storage, hashing with hasher under algorithm 0.
null_digest
Dynamically generate a null digest constant using the hasher.
null_runs_are_trivial
Whether the committed activation is trivial: no algorithm has any null run over [0, tree_size) (every registered algorithm is fully active). A trivial activation carries no information beyond the member roots, so the binding-root fold omits its coverage child — absence of the child is the trivial encoding.
null_runs_for_alg
Decompose algorithm eps’s inactive positions in [0, tree_size) into the canonical null collapse runs: the maximal aligned k-ary blocks the tree folds to null, greatest-block-first within each contiguous inactive span (the same greedy decomposition spine::frontier_for_size applies to the whole tree, here applied to each inactive gap).
rebalanced_bag
Bag a frontier’s peaks into the CMT member root under hasher — the rebalanced fold, grouping the rightmost k (the mutable peer of the append-only log’s backward-bag). Mirrors build’s grouping so the folded member root equals the live crate::Cmt::root over the same peaks. An empty peak set is the empty-tree root.
rebalanced_skeleton
The CMT’s concrete inclusion skeleton for index in a tree of size leaves at arity k — the rebalanced topology the spine verifier pins a proof against.
reconstruct_consistency_roots
Reconstruct the old and new raw roots from a consistency proof.
reconstruct_inclusion_root
Reconstruct the raw root from an inclusion proof path and its trusted skeleton.
reduction_count
Number of k-ary merges after appending an item at 0-based index n.
serialize_null_runs
Canonical serialization of all algorithms’ null runs — the preimage of the binding root’s coverage child; the committed activation form.
validate_committed_epochs
Validate the structural well-formedness of a committed epoch timeline at tree_size: entries strictly sorted by algorithm ID; at least one epoch per algorithm; intervals ordered and non-overlapping (start <= end, start >= prior end); only the final interval may be open (end == u64::MAX); closed ends and open starts do not exceed tree_size.
verify_consistency
Verify a consistency proof.
verify_consistency_with_coupling
Helper wrapper demonstrating consistency verification with decoupled coupling proofs.
verify_epoch_evolution
Verify that a committed epoch timeline at new_size is an append-only evolution of one previously committed at old_size — the temporal analog of a consistency proof.
verify_inactivity_with_coupling
Verify an inactivity claim for a leaf at index using a coupling proof.
verify_inclusion
Verify an inclusion proof against a consumer-supplied skeleton.
verify_inclusion_path_structure
Validate that the trailing steps of an inclusion proof path match the consumer-supplied skeleton.
verify_inclusion_with_coupling
Helper wrapper demonstrating inclusion verification with decoupled coupling proofs.
within_subtree_path
Generate the inclusion proof path for a leaf index within a structured subtree.

Type Aliases§

AlgorithmMetas
Reconstructed metadata for registered algorithms: a list of (alg_id, epochs) pairs.
CmtResult
A specialized Result for the mutable tree.
Epochs
Epoch metadata for a registered algorithm: a sequence of half-open [start, end) intervals.
LogResult
A specialized Result alias for the combinator driver.
Result
A specialized Result alias for the combinator driver.