Expand description
External anchor sinks for signed audit checkpoints.
A Checkpoint commits (seq, chain_tip, timestamp) with an Ed25519 signature. Anchoring those checkpoints to an
independent, append-only store is what makes tail-truncation and
rewrite of the local chain detectable by a host attacker who controls the
primary database: they cannot reproduce a previously anchored signed tip
(see verify_checkpoints).
This module defines a small CheckpointSink interface with two backends:
PostgresCheckpointSink— writes checkpoints to an append-onlyaudit_checkpointstable on a separate Postgres database. INSERT-only by construction (this code never issues UPDATE/DELETE). Operators should additionally grant the SysKnife role onlyINSERT/SELECTon the table andREVOKE UPDATE, DELETEso a stolen daemon credential cannot rewrite the anchor either. Append-only permissions alone do not stop a DB superuser; the signature is what makes tampering detectable.InMemoryCheckpointSink— for tests and dry runs.
Additional verifiable backends (immudb, WORM object storage, an RFC 3161 timestamp authority) can implement the same trait.
Structs§
- InMemory
Checkpoint Sink - In-memory checkpoint sink for tests and dry runs. Append-only.
- Postgres
Checkpoint Sink - Postgres append-only checkpoint sink. Anchors signed checkpoints to a
separate database so a host attacker cannot silently rewrite or truncate
the local chain without being detected on the next
verify.
Enums§
- Anchor
Outcome - Result of one anchoring attempt.
- Checkpoint
Sink Error
Constants§
- DEFAULT_
ANCHOR_ INTERVAL - How often the daemon anchors a checkpoint when a sink is configured.
Traits§
- Checkpoint
Sink - An append-only sink that stores signed checkpoints and hands them back for verification. Implementations must never mutate or delete a stored checkpoint.
Functions§
- anchor_
once - Sign the current chain tip and anchor it to
sink, then prove the anchor landed and still agrees with the local chain. - spawn_
periodic_ anchor - Periodically anchor the chain tip to
sinkfor as long as the daemon runs.