Canonical digests¶
Approval and artifact bindings use SHA-256 over RFC 8785 JSON Canonicalization Scheme bytes. This is a cross-language protocol, not an implementation detail.
Canonical value rules¶
- Pydantic models exclude their
content_digestfield before serialization. - Object keys follow JCS ordering; arrays retain their declared order because tuple order is semantic in every ZEO Creator contract.
- Numbers use the ECMAScript/JCS representation. Values outside the JCS number domain fail rather than silently changing representation.
- Every datetime must contain an offset. It is normalized to UTC and serialized
as
YYYY-MM-DDTHH:MM:SS.ffffffZbefore JCS serialization. - Strings are preserved as Unicode. Canonically equivalent but byte-distinct Unicode strings are not normalized implicitly.
- The digest is lowercase
sha256:followed by 64 hexadecimal characters.
Golden vectors live in reference/digest-vectors.json. The Python suite and the
Node/TypeScript-consumer proof both verify those same bytes and hashes.
Changing any rule is a breaking cross-runtime contract change.