Expand description
Journal, checkpoint, and outbox types + the checkpoint signing seam (plan §2a, §2d, §2e).
Scope note: the hash-chained journal data model and the checkpoint
commitments live here so the crate::LedgerBackend trait is complete and
MemLedger is a true oracle. The RocksDB-persisted journal, group commit, and
the standalone hyprstream ledger verify offline tool are later work items
(1.2/1.3/1.10); this module builds only the in-memory reference.
Structs§
- Chain
Head - The head of the hash chain — the constant-size commitment the backend keeps
in memory and (for RocksLedger) at
CF(meta)/"head". - Checkpoint
Content - The signable content of a checkpoint (the
sig-free projection). - Journal
Entry - One committed operation in the hash chain.
prev_hashlinks it to the prior entry; the outcome is in the chain too (plan §2a step 3), so tampering with a result breaks the chain. - Outbox
Item - A committed-but-unemitted proof-plane item, staged transactionally with the
ledger commit (the outbox pattern) and drained by
crate::LedgerBackend::outbox_peek/outbox_ack. - Outbox
Seq - Ordered position of an outbox item.
- Signed
Checkpoint - A periodic, PQC-hybrid-signed commitment to ledger state (plan §2d). It is the anchorable object and the settlement reference. Per-commit chaining is cheap and unsigned; only checkpoints carry a signature.
- Tick
Report - What one
tickdid (plan §2b.4 sweep + scheduled checkpoint).
Enums§
- Outbox
Kind - What a proof-plane item evidences (plan §2e). The ledger crate only stages these; the service layer drains and emits them to the PDS.
Constants§
- CHECKPOINT_
DOMAIN - Domain-separation tag for checkpoint signatures (plan §2d).
Traits§
- Checkpoint
Signer - The injection seam for checkpoint signing (mirrors
mac::audit::AuditSigner).
Functions§
- balances_
root - Root over accounts sorted by id:
blake3(concat(blake3(id || cbor(account)))). A deterministic commitment (not a sparse-Merkle proof system — sufficient for the drift/equivalence properties; a full accumulator can replace it later without changing the trait). - checkpoint_
signing_ input - Assemble the domain-separated signing input from a 32-byte content hash.
- pending_
root - Root over open (
Pending) reservations sorted by id. - verify_
checkpoint_ signature - Verify a checkpoint’s composite signature against the ledger DID’s key
material, delegating to
hyprstream_crypto::cose_sign::verify_composite.