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) )withchain_0 = "0"*64
wherestamp_core_k = "SSMCLOCK1|" + iso_utc + "|" + rasi_idx + "|" + theta_deg + "|" + sha256(file).
Steps (deterministic rewalk)
- Set
tip = "0"*64. - For each row
kin ledger order:- Select hash
H_chainfromkv:chain_algoor defaultsha256. - Rebuild
stamp_core_kexactly (ASCII). - Compute
calc = H_chain( ascii(tip + "|" + stamp_core_k) ). - Require
calc == row.chain. - Set
tip = calc.
- Select hash
- 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 declaredkv:chain_algo(or default). - Formatting drift: rebuild
stamp_core_kusing 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)