Skip to Content
PoC BatteryP20 — Tamper-Evident Log

P20 — Append-Only Hash-Chained Log with Pinned HEAD

Status green · Claim PC18 · Corpus anchor matrix MM-E16 (transparency-log backing) · Effort S · Execution host external: omarchy

What it proves

A tamper-evident audit log is a few lines of standard-library Python. You will build a log where each entry commits to its predecessor over SHA-256, pin the tip (HEAD) separately, then attack it twice — modify a middle record, and quietly drop the tail. Both are caught; the second is the entire reason the HEAD must be pinned outside the log.

Why it matters

The corpus’s artifact-signing row rests on a transparency primitive: “signing events are recorded to Sigstore’s append-only transparency log” (matrix MM-E16). Weight-access auditing — who touched the checkpoint archive, and would we notice a rewritten history — depends on the same primitive. If it were subtle or hard, the book’s logging advice would be aspirational; this run shows the load-bearing minimum fits on one page.

Why this, not that

We do (Y)We don’t (X)Because
Hash chain plus a separately pinned HEADHash chain aloneA chain alone detects edits but not truncation — the attacker keeps a valid shorter chain; the pinned HEAD is what makes deletion visible
Three gates, including truncationOnly the happy pathThe truncation gate is the one that justifies pinning; without it the demo proves half the property

What you need

  • Python 3.9+, standard library only.

How to run it

  1. python3 scripts/tamper_evident_log.py — builds the log, verifies it, runs both attacks, prints all three gates.

What “done” looks like

python3 scripts/tamper_evident_log.py # MUST print: # POC-P20-OK-CHAIN-VERIFIES: 5-entry append-only log verifies against pinned HEAD # POC-P20-OK-TAMPER-DETECTED: modified record flagged at index 2 # POC-P20-OK-TRUNCATION-DETECTED: dropped tail breaks the pinned HEAD

Where the evidence goes

  • evidence/run.log — full output; all three gate lines.

What this does not prove

  • This is the primitive, not the service: no gossip protocol, no witnesses, no inclusion or consistency proofs. Rekor adds those; chain-plus-pinned-HEAD is the load-bearing minimum the corpus claim rests on.
  • A HEAD pinned next to the log protects nothing — an attacker who can rewrite the log can re-pin. The demo keeps the HEAD as a separate variable on purpose; in deployment it lives in a second trust domain.
Last updated on
Superdefence II — defensive security research.