SSM-Clock Stamp – Minimal Verifier Outline (2.10)

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)

  1. Parse & syntax
    • Split on |; arity 6 or 7 (with kv:).
    • Enforce shapes: iso_utc="YYYY-MM-DDThh:mm:ssZ", rasi_idx∈[0..11], theta_deg∈[0,360), digests are lowercase 64-hex.
    • Reject 23:59:60.
    • Parse kv: (if present), apply defaults, enforce domains; ignore unknown keys.
  2. Hash — content integrity (HASH_OK)
    • algo = kv:algo else sha256.
    • h' = H_algo(file_bytes) (binary mode; streaming allowed).
    • HASH_OK = (h' == recorded sha).
  3. 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_prec else 5 using IEEE-754 binary64 round-half-to-even → theta_fmt; require theta_fmt == theta_deg.
    • CLOCK_OK = (sector_ok && angle_ok_or_policy_tolerance).
  4. Chain — append-only rewalk (CHAIN_OK)(if ledger present)
    • stamp_core_k = "SSMCLOCK1|" + iso_utc + "|" + rasi_idx + "|" + theta_deg + "|" + h_file
    • tip = chain_0 = "0"*64
    • For each row k (ledger order):
      Hk = kv:chain_algo else sha256
      tip = Hk( ascii(tip + "|" + stamp_core_k) )
      Require: tip == chain_k.
    • If no ledger: CHAIN_OK = na.
  5. 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 to rollup_sha256.
    • If count provided, also require n == count.
    • If no anchor: ANCHOR_OK = na.
  6. 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-joined source "|" iso_z), verify obs_evidence_sha256.
    • Absence of sidecar → EVIDENCE_OK = absent (advisory).
  7. 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)