Skip to main content

Crate polydigest

Crate polydigest 

Source
Expand description

polydigest — the polydigest combinator.

Lifts the structural Merkle Spine (spine) across N algorithms over one shared data substrate by driving N single-algorithm CML (cml) engines over it. It is not a composition of independent logs (that would duplicate data); the NaryMerkleLog driver holds the one shared store plus, per algorithm, a {hasher, frontier} view, and adds the three epoch concepts the structural core deliberately omits:

The combinator’s frozen snapshot is the Sealed (the BoundSnapshot epoch facet over a structural spine::Seal); the structural Seal carries no epoch field (D13). The fill operation and the SnapshotProof are the trustless verification and aggregate-proof surfaces over a Sealed.

The append-only driver above is polydigest(cml); its mutable peer is EpochTree (polydigest(cmt)), the same combinator lifting a cmt::Cmt: the binding/combined root over the per-algorithm member roots and the combined Sealed currency, with the mutable tree’s trivial active-from-genesis timeline.

Re-exports§

pub use binding_proof::BindingProof;
pub use binding_proof::TrustedBindingRoot;
pub use evolution::verify_consistency_with_coupling;
pub use evolution::verify_epoch_evolution;
pub use filling::FillError;
pub use filling::FillKind;
pub use filling::FilledTree;
pub use filling::fill;
pub use mutable::EpochTree;
pub use root::AuditPayload;
pub use root::CouplingProof;
pub use root::NullRun;
pub use root::VerifierConfig;
pub use root::all_null_runs;
pub use root::combined_root;
pub use root::committed_active_algs;
pub use root::committed_active_at;
pub use root::null_runs_are_trivial;
pub use root::null_runs_for_alg;
pub use root::serialize_null_runs;
pub use root::validate_committed_epochs;
pub use root::verify_inactivity_with_coupling;
pub use root::verify_inclusion_with_coupling;
pub use snapshot::BoundSnapshot;
pub use snapshot_proof::ClaimedLeaf;
pub use snapshot_proof::SnapshotProof;
pub use storage::AlgorithmMetas;
pub use storage::Epochs;
pub use storage::MemoryStorage;
pub use storage::Storage;
pub use tree::NaryMerkleLog;
pub use tree::TreeConfig;

Modules§

binding_proof
Cross-algorithm binding proof — a first-class, named proof API.
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§

CmtConfig
Configuration for a Cmt.
ConsistencyProof
Consistency proof: proves tree at old_size is a prefix of tree at new_size.
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.
Meta
Opaque, application-defined byte payload attached to a Merkle commitment.
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.

Enums§

CmtError
A CMT construction or mutation error.
Error
A polydigest combinator error.
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).

Traits§

Hasher
Hash operations required by the Merkle Spine.

Functions§

bag_peaks
Bag a frontier’s peaks into the single member root under hasher.
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.
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.
null_digest
Dynamically generate a null digest constant using the hasher.
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.
verify_consistency
Verify a consistency 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.
within_subtree_path
Generate the inclusion proof path for a leaf index within a structured subtree.

Type Aliases§

CmtResult
A specialized Result for the mutable tree.
LogResult
A specialized Result alias for the combinator driver.
Result
A specialized Result alias for the polydigest combinator.