Purpose. A compact, plain-ASCII checklist to implement a verifier for SSM-Clock Stamp. Produces deterministic flags and a final PASS/FAIL.
Inputs
- File bytes.
- Stamp line:
SSMCLOCK1|iso_utc|rasi_idx|theta_deg|sha256(file)|chain[|kv:...] - Optional: local ledger (for chain rewalk), published daily anchor (
rollup_sha256), observed-time sidecar.
Outline (steps)
- Parse & syntax
- Split on
|; arity6or7(withkv:). - Enforce shapes:
iso_utc="YYYY-MM-DDThh:mm:ssZ",rasi_idx∈[0..11],theta_deg∈[0,360), digests are lowercase64-hex. - Reject
23:59:60. - Parse
kv:(if present), apply defaults, enforce domains; ignore unknown keys.
- Split on
- Hash — content integrity (
HASH_OK)algo = kv:algoelsesha256.h' = H_algo(file_bytes)(binary mode; streaming allowed).HASH_OK = (h' == recorded sha).
- Clock — UTC → angle/sector (
CLOCK_OK)unix_seconds = seconds_since_1970_UTC(iso_utc)wrap360(x) = x - 360*floor(x/360)theta' = wrap360( (unix_seconds/86400)*360 )rasi' = floor(theta'/30)- MUST:
rasi' == rasi_idx. - SHOULD: format with
p = kv:theta_precelse5using IEEE-754 binary64 round-half-to-even →theta_fmt; requiretheta_fmt == theta_deg. CLOCK_OK = (sector_ok && angle_ok_or_policy_tolerance).
- Chain — append-only rewalk (
CHAIN_OK)(if ledger present)stamp_core_k = "SSMCLOCK1|" + iso_utc + "|" + rasi_idx + "|" + theta_deg + "|" + h_filetip = chain_0 = "0"*64- For each row
k(ledger order):Hk = kv:chain_algoelsesha256tip = Hk( ascii(tip + "|" + stamp_core_k) )
Require:tip == chain_k. - If no ledger:
CHAIN_OK = na.
- Anchor — daily roll-up (
ANCHOR_OK)(if anchor present)- Select same-UTC-day stamps.
- Canonical sort by
(iso_utc, stamp_core, chain). - Join:
"Stamp_1|...|Stamp_n"(literal|, no leading/trailing). rollup_D' = sha256( ascii(joined) ); compare torollup_sha256.- If
countprovided, also requiren == count. - If no anchor:
ANCHOR_OK = na.
- Observed-time evidence (
EVIDENCE_OK)(if sidecar present)- Recompute
delta_sec' = abs( unix(iso_utc) - unix(obs_iso_utc) ) <= tolerance_sec. - Rebuild canonical
concat_of_sources_and_reported_times(LF-joinedsource "|" iso_z), verifyobs_evidence_sha256. - Absence of sidecar →
EVIDENCE_OK = absent(advisory).
- Recompute
- Verdict
- PASS iff all applicable checks are true; otherwise FAIL with first failing reason.
Reference pseudo-code (ASCII)
# parse
ok, kv = parse_stamp_line(line)
if not ok: FAIL("syntax")
# hash
algo = kv.get("algo","sha256")
HASH_OK = (H(algo, file_bytes) == sha_field)
# clock
p = int(kv.get("theta_prec","5"))
theta = wrap360((unix(iso_utc)/86400)*360)
rasi_ok = (floor(theta/30) == rasi_idx)
theta_fmt = format_fixed(theta, p, rounding="half_even", float="ieee75464")
theta_ok = (theta_fmt == theta_deg)
CLOCK_OK = (rasi_ok and theta_ok) # or policy_tolerance
# chain
if ledger_present:
CHAIN_OK = rewalk_ledger(ledger_rows) # per-row chain_algo; ascii("tip|stamp_core")
else:
CHAIN_OK = "na"
# anchor
if anchor_present:
ANCHOR_OK = verify_anchor(day_rows, rollup_sha256)
else:
ANCHOR_OK = "na"
# evidence
if sidecar_present:
EVIDENCE_OK = verify_observed_sidecar(sidecar, iso_utc)
else:
EVIDENCE_OK = "absent"
# verdict
if not HASH_OK: FAIL("HASH mismatch")
elif not CLOCK_OK: FAIL("CLOCK mismatch")
elif CHAIN_OK is False: FAIL("CHAIN rewalk failed")
elif ANCHOR_OK is False: FAIL("ANCHOR digest mismatch")
elif kv.get("time_mode")=="observed" and policy_requires_evidence and EVIDENCE_OK != True:
FAIL("Observed-time evidence not accepted")
else:
PASS()
Suggested report (copy-ready)
HASH_OK=true
CLOCK_OK=true
CHAIN_OK=na # or true/false
ANCHOR_OK=na # or true/false
EVIDENCE_OK=absent # or true/false
VERDICT=PASS
Navigation
Back: SSM-Clock Stamp – Observed-time Evidence (2.9)
Next: SSM-Clock Stamp – Anchoring & Daily Roll-Up (3)