SSM-Clock Stamp – Ledger Break (row deletion/reorder) (5.4)

Objective. Demonstrate that deleting or reordering any ledger row is detected by a chain rewalk — deterministic, plain ASCII.

Setup (inputs)

  • A ledger with at least 3 valid rows (append-only history).
  • Each row contains the full stamp line:
    SSMCLOCK1|iso_utc|rasi_idx|theta_deg|sha256(file)|chain[|kv:...]

Attack (what goes wrong)

  • Delete a middle row or swap two adjacent rows.
  • This breaks the recurrence:
    chain_k = H_chain( ascii(chain_{k-1} + "|" + stamp_core_k) ) with chain_0 = "0"*64
    where stamp_core_k = "SSMCLOCK1|" + iso_utc + "|" + rasi_idx + "|" + theta_deg + "|" + sha256(file).

Steps (deterministic rewalk)

  1. Set tip = "0"*64.
  2. For each row k in ledger order:
    • Select hash H_chain from kv:chain_algo or default sha256.
    • Rebuild stamp_core_k exactly (ASCII).
    • Compute calc = H_chain( ascii(tip + "|" + stamp_core_k) ).
    • Require calc == row.chain.
    • Set tip = calc.
  3. Stop at the first mismatch and report k.

Expected output (stdout, ASCII)

HASH_OK=true CLOCK_OK=true CHAIN_OK=false
VERDICT=FAIL
# detail (tooling may print):
CHAIN_BREAK_AT_ROW=k
EXPECTED=<calc_tip_64hex>
FOUND   =<row.chain_64hex>

Why detection is immediate

  • The recurrence uses the prior tip plus the exact stamp_core_k.
  • Deleting or reordering any row changes the input to the very next step; the mismatch appears at the first affected k.

Triage (quick fixes)

  • Deletion/reorder: restore the ledger order from sidecars and recompute from chain_0 = "0"*64.
  • Wrong chain_algo: ensure each step uses the row’s declared kv:chain_algo (or default).
  • Formatting drift: rebuild stamp_core_k using exact ASCII fields; no spaces or Unicode punctuation.

Navigation
Back: SSM-Clock Stamp – Tamper Detection (file bytes) (5.3)
Next: SSM-Clock Stamp – Resync from Sidecars (repair local ledger) (5.5)