Skip to main content

Module log

Module log 

Source
Expand description

An append-only Merkle log over the deeds a store has issued, hashed as RFC 9162 (doi:10.17487/RFC9162): leaf SHA-256(0x00 || entry), node SHA-256(0x01 || left || right). Inclusion proofs catch a dropped deed; consistency proofs catch a rewritten log. Signatures alone bind neither. Gossip lives outside this file. Two consistent logs shown to two readers both verify here.

Structs§

Entry
One entry: the deed’s content address and the instant it was logged.
Head
What a store publishes: how many entries it has, and the root over them.

Functions§

consistency_proof
The consistency proof that a tree of old leaves is a prefix of these, RFC 9162 section 2.1.4. The nodes recompute both roots; a rewritten log cannot produce a set that yields both. None when old is zero or wider than the tree.
from_hex
A 32 byte hash from the lower-case hex hex writes. Any other text yields nothing.
hex
Hex, lower case, fixed width.
inclusion_proof
The audit path for the leaf at index, RFC 9162 section 2.1.3: sibling subtree roots, innermost first.
leaf_hash
Leaf hash, SHA-256(0x00 || entry).
node_hash
Interior hash, SHA-256(0x01 || left || right).
root
The Merkle root over leaves, RFC 9162 section 2.1: the tree splits at the largest power of two below the width, which is the shape the proofs below are sound over.
verify_consistency
Whether the tree of old leaves with old_root is a prefix of the tree of new leaves with new_root; both roots are recomputed from nodes.
verify_inclusion
Whether leaf sits at index of a tree of size leaves with that root.