Purpose. Shared language and exact tokens for implementers and auditors. All math and comparisons use plain ASCII; formulas appear as inline code.
Core tokens (exact shapes)
- Stamp marker (constant):
SSMCLOCK1 - UTC timestamp (canonical):
iso_utc = "YYYY-MM-DDTHH:MM:SSZ"(UTC Z only; no subseconds;:60forbidden) - POSIX seconds:
unix_seconds = seconds_since_1970_UTC(iso_utc) - Angle wrap to [0,360):
wrap360(x) = x - 360*floor(x/360) - Deterministic clock from UTC:
theta_deg = wrap360( (unix_seconds / 86400) * 360 ) - Discrete index:
rasi_idx = floor(theta_deg / 30)(sorasi_idx ∈ {0..11}) - File digest algorithm:
H_algo ∈ {sha256, sha3_256, blake2b-256} - File digest:
digest(file) = H_algo(file_bytes)(historical field name:sha256(file); value followsH_algo) - Stamp core (before chain):
stamp_core = "SSMCLOCK1|" + iso_utc + "|" + rasi_idx + "|" + theta_deg + "|" + digest(file) - Chain seed:
chain_0 = "0"*64 - Append-only chain:
chain_k = H_chain( ascii(chain_{k-1} + "|" + stamp_core_k) ), withH_chain ∈ {sha256, sha3_256, blake2b-256} - Full stamp line (single ASCII line):
SSMCLOCK1|iso_utc|rasi_idx|theta_deg|sha256(file)|chain[|kv:...]
Canonical formatting rules (must-haves)
- UTC only.
iso_utcmust be exactlyYYYY-MM-DDTHH:MM:SSZ(zero offset; no subseconds; reject:60). - Angle print.
theta_degmust print with exactlytheta_precfractional digits using round-half-to-even (defaulttheta_prec = 5). Example:"163.48750". - Lowercase hex. All digests must be lowercase 64-hex (
[0-9a-f]{64}). - ASCII discipline. All concatenations under hashing use
ascii(...); the only delimiter is|; no spaces; no Unicode punctuation.
Anchoring (day-level)
- Day key (UTC):
day = "YYYY-MM-DD"derived fromiso_utc. - Canonical order (ascending, string compare):
(iso_utc, stamp_core, chain) - Daily roll-up digest (anchor):
rollup_D = sha256( ascii(Stamp_1 "|" ... "|" Stamp_n) )(no leading/trailing|) - Optional witness:
witness_chain_tip = chain_last(lastchain_kfor that day)
Verification flags & verdict
- Hash:
HASH_OK = ( H_algo(file_bytes) == digest(file) ) - Clock:
CLOCK_OK = ( floor(theta'_deg/30) == rasi_idx )(with recommended exacttheta_degstring check) - Chain:
CHAIN_OK =result of local chain rewalk (ornaif no ledger) - Anchor:
ANCHOR_OK =result of roll-up recomputation (ornaif none) - Verdict:
VERDICT = "PASS"if all applicable checks are true; else"FAIL"
Error classes (diagnostic language)
- Hash mismatch:
HASH_OK=false→ file bytes changed. - Clock mismatch:
CLOCK_OK=false→ non-canonicaliso_utcortheta_deg. - Chain break: first index
kwherechain_krecomputation fails. - Orphan sidecar: stamp exists but original file missing.
- Anchor mismatch: recomputed
rollup_D'orcountdiffers from published note. - Leap-second violation: any
iso_utcwith:60is invalid.
Optional metadata (non-breaking)
- Policy pinning:
policy_sha256 = sha256( ascii(policy_text) ),tool_sha256 = sha256(file_bytes_of_stamper),config_sha256 = sha256( ascii(config_blob) ) - Algo tags (pack/day hints):
algo_hash = "sha256",algo_chain = "sha256"(per-stamp authority remains thekv:tail) - Signature (authorship, optional):
sig = Ed25519_sign(privkey, ascii(SSMCLOCK1|...|chain))
Verify withEd25519_verify(pubkey, ascii(SSMCLOCK1|...|chain), sig)
Minimal grammar (EBNF-style, ASCII)
stamp := "SSMCLOCK1" "|" iso_utc "|" rasi "|" theta "|" h64 "|" h64 [ "|" kv_tail ]
iso_utc := YYYY "-" MM "-" DD "T" hh ":" mm ":" ss "Z" # ss != "60"
rasi := DIGITS # 0..11
theta := DIGITS "." DIGITS{theta_prec} # theta_prec digits; default 5
h64 := HEXLOWER{64} # [0-9a-f], length 64
kv_tail := "kv:" kvpair { ";" kvpair }
kvpair := key "=" value
key := ALPHA { ALPHA | DIGIT | "_" | "-" }
value := { ALPHA | DIGIT | "." | "_" | "-" | "+" } # ASCII-safe values
# Notes: DIGITS=[0-9]+, HEXLOWER=[0-9a-f], ALPHA=[A-Za-z]
Invariants (quick checks)
0 <= theta_deg < 360rasi_idx == floor(theta_deg / 30)len(digest(file)) == 64and hex is[0-9a-f]len(chain_k) == 64and hex is[0-9a-f]rollup_Drecomputes identically for the same set and canonical orderiso_utchasZand not:60- Printing uses
theta_precdigits (default5), ties-to-even
Navigation
Back: SSM-Clock Stamp – Quickstart (9)
Next: SSM-Clock Stamp – Reference Pseudocode (11)