/** * Decoded form of a c2sp.org/tlog-checkpoint body. The body shape is * hash-and-algo-agnostic: `rootHash` is 32 bytes for both the SHA-256 and * BLAKE3 trees Phase 7 ships, but the codec only enforces a caller-supplied * length in `parseCheckpointBody`. The signed-note envelope that wraps a * checkpoint is handled in `signed-note.ts`. */ export interface Checkpoint { /** * Log identity, non-empty UTF-8 with no Unicode spaces, plus signs, or * embedded newlines. Per c2sp.org/tlog-checkpoint §Note text the origin * SHOULD be a schemeless URL such as `example.com/log42`, but the codec * only enforces the MUST-level structural constraints; broader URL * shape policy is a caller concern. */ readonly origin: string; /** * Number of leaves in the tree at signing time. Must be a non-negative * safe integer; ASCII decimal serialization carries no leading zeroes * (the literal `0` is the only valid string starting with `0`). */ readonly treeSize: number; /** * Merkle root hash. 32 bytes for both Sha256Tree and Blake3Tree; the * caller-supplied `expectedHashLen` parameter on `parseCheckpointBody` * pins the exact length for a given hasher. */ readonly rootHash: Uint8Array; } /** * Serialize a Checkpoint into its canonical body bytes per * c2sp.org/tlog-checkpoint §Note text. Layout: * * utf8(origin) || 0x0A || utf8(decimal(treeSize)) || 0x0A * || base64(rootHash) || 0x0A * * Base64 uses the RFC 4648 §4 standard alphabet with `=` padding (NOT the * URL-safe variant from §5 and NOT padding-stripped). The body has no * leading or trailing whitespace beyond the final 0x0A; byte stability * is the entire purpose of the codec, since the body bytes are what the * STH signature is computed over. */ export declare function serializeCheckpointBody(c: Checkpoint): Uint8Array; /** * Parse a canonical checkpoint body. Inverse of `serializeCheckpointBody`; * round-trips byte-for-byte. Rejects extension lines, leading or trailing * whitespace beyond the mandatory final 0x0A, non-newline ASCII control * characters, malformed base64, and root hashes whose decoded length does * not match `expectedHashLen` (default 32, the size for both Sha256Tree * and Blake3Tree). * * The caller pins `expectedHashLen` to its hasher's `outputSize`; a future * SignedLog (TASK-4) will bind this to the tree's hasher automatically. * * Per c2sp.org/tlog-checkpoint §Note text and c2sp.org/signed-note * §Format. */ export declare function parseCheckpointBody(bytes: Uint8Array, expectedHashLen?: number): Checkpoint;