Expand description
Canonical-JSON (RFC 8785 / JCS) + content-addressed identity.
For our string-only payload, serde_json’s default output (sorted BTreeMap
keys, compact separators, raw non-ASCII, no /-escape) IS JCS — verified by
the golden vectors. Liveness arrays are sorted+deduped here so set-valued
fields are order-insensitive; grounds[] keeps authored order.
Functions§
- canonical_
json - Canonical bytes for our string-only hashed
Value. serde_json’s compact output over a sorted-keyValueequals RFC-8785/JCS only because the payload contains no numbers/bools/nulls (JCS number canonicalization is not applied). Do not reuse on a number-bearingValue(see module header). - compute_
id - id = first 12 hex of SHA-256 over the canonical-JSON of the hashed fields.
- hashed_
value - The Value containing ONLY the hashed fields (decision, observe, grounds, parent_id).