Skip to main content

Module journal

Module journal 

Source
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§

ChainHead
The head of the hash chain — the constant-size commitment the backend keeps in memory and (for RocksLedger) at CF(meta)/"head".
CheckpointContent
The signable content of a checkpoint (the sig-free projection).
JournalEntry
One committed operation in the hash chain. prev_hash links it to the prior entry; the outcome is in the chain too (plan §2a step 3), so tampering with a result breaks the chain.
OutboxItem
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.
OutboxSeq
Ordered position of an outbox item.
SignedCheckpoint
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.
TickReport
What one tick did (plan §2b.4 sweep + scheduled checkpoint).

Enums§

OutboxKind
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§

CheckpointSigner
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.