0259. Canonical unsigned Merkle checkpoint body
- Status: Proposed; RG4.2a implementation default, question for maintainer
- Date: 2026-11-16
- Plan: M15.5; RG4.2a (
hosted registry plan) - Builds on: 0257
Context
0257 specifies origin host, tree size and root hash as checkpoint text, but not their exact separators or root spelling. RG4.2a supplies only the unsigned body; signature framing and I/O belong to later steps.
Decision
Use
<host>\n<decimal-size>\n<lowercase-64-hex-root>\n,
with no blank line or sha256: prefix. Validate the
origin with the existing host validator (including its optional
port). Size is u64, rendered without leading zeroes. A zero-size
checkpoint must use SHA256(empty). Records retain 0257's explicit
sha256: prefix and use the existing package-path and
exact-version validators.
Keep the pure API on binary 32-byte hashes and ordered leaf-hash slices. Invalid coordinates or text fields return None; proof verification returns bool, without allocating user-facing diagnostic codes before there is a command consuming it. The empty prefix has an empty consistency proof and proves only the empty root, not the authenticity of a nonempty new root; signatures remain the caller's job.
Alternatives considered
- Space-separated checkpoint fields: less directly mirrors the three ordered checkpoint fields; separate lines give simple signing bytes.
- Base64 or
sha256:checkpoint root: possible, but unprefixed lowercase hex needs no codec or redundant hash-algorithm marker for this fixed SHA-256 tree. - A persisted tree or signing wrapper: adds state and authority outside RG4.2a.
Consequences
The body is deterministic and injection-safe. Maintainer should confirm this byte spelling before the hosting/client steps expose it as a wire format. No existing registry, lock, golden or command output changes.