Skip to main content

Module checkpoint

Module checkpoint 

Source
Expand description

ai.hyprstream.ledger.checkpoint — a signed ledger head (the anchorable object).

{
  "lexicon": 1,
  "id": "ai.hyprstream.ledger.checkpoint",
  "defs": { "main": { "type": "record", "key": "tid", "record": {
    "type": "object",
    "required": ["seq", "headHash", "stateRoots"],
    "properties": {
      "seq":        { "type": "integer", "minimum": 0 },
      "headHash":   { "type": "string", "format": "cid" },
      "stateRoots": { "type": "array", "items": { "type": "object",
                        "required": ["name", "root"], "properties": {
                          "name": { "type": "string" },
                          "root": { "type": "string", "format": "cid" } } } },
      "anchor":     { "type": "string" }
    }
}}}

A checkpoint commits the ledger’s head at a point in time. It is the object an external timestamp/anchor (e.g. OpenTimestamps) attests to — so it carries a reference to the anchor, it never embeds the anchor proof:

  • seq — the monotonically-advancing checkpoint sequence number (u64).
  • headHash — the CID of the ledger head this checkpoint commits (format: "cid" string).
  • stateRoots — the named state-tree roots at this head (StateRoot): each a {name, root-cid} pair (e.g. {"accounts", <cid>}, {"receipts", <cid>}).
  • anchor — optional reference to the external anchor for this checkpoint (an opaque locator: an OTS receipt id, a txid, a CID …). Omitted until the checkpoint is anchored; the anchor proof itself lives outside this record. Per #928 rule 8, anchors carry digests only and are submitted on a fixed cadence — this record holds only the reference, never activity-correlated payload.

Structs§

CheckpointRecord
An ai.hyprstream.ledger.checkpoint record.
StateRoot
A named state-tree root at the checkpoint’s head.

Constants§

COLLECTION_NSID
The NSID of this record type.