{
  "$defs": {
    "CheckpointSignature": {
      "additionalProperties": false,
      "properties": {
        "key_id": {
          "title": "Key Id",
          "type": "string"
        },
        "name": {
          "title": "Name",
          "type": "string"
        },
        "signature": {
          "description": "base64 Ed25519 signature over the checkpoint body.",
          "title": "Signature",
          "type": "string"
        }
      },
      "required": [
        "name",
        "key_id",
        "signature"
      ],
      "title": "CheckpointSignature",
      "type": "object"
    },
    "TimestampToken": {
      "additionalProperties": false,
      "description": "RFC 3161 time-stamp token held beside a checkpoint, never a cosignature (spec \u00a718). The POC signs with a\nlocal key standing in for a TSA (``tsa: poc-standin``); a real token is a CMS SignedData blob.",
      "properties": {
        "cert_req": {
          "default": true,
          "title": "Cert Req",
          "type": "boolean"
        },
        "gen_time": {
          "description": "genTime: the checkpoint's time.",
          "format": "date-time",
          "title": "Gen Time",
          "type": "string"
        },
        "key_id": {
          "description": "Key hash of the TSA key, as for a signed-note signer.",
          "title": "Key Id",
          "type": "string"
        },
        "message_imprint": {
          "description": "hex SHA-256 over the checkpoint's signed-note bytes as first published by the log (body, blank line and the log's own signature lines), before any cosignature.",
          "pattern": "^[0-9a-f]{64}$",
          "title": "Message Imprint",
          "type": "string"
        },
        "name": {
          "description": "TSA key name.",
          "title": "Name",
          "type": "string"
        },
        "nonce": {
          "title": "Nonce",
          "type": "string"
        },
        "signature": {
          "description": "base64 Ed25519 signature over the canonical token fields (stand-in).",
          "title": "Signature",
          "type": "string"
        },
        "tsa": {
          "default": "poc-standin",
          "description": "Which TSA issued the token; poc-standin is the local key.",
          "title": "Tsa",
          "type": "string"
        }
      },
      "required": [
        "name",
        "key_id",
        "gen_time",
        "message_imprint",
        "nonce",
        "signature"
      ],
      "title": "TimestampToken",
      "type": "object"
    }
  },
  "$id": "https://schemas.ump.dev/v1/checkpoint.json",
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "additionalProperties": false,
  "description": "C2SP tlog-checkpoint: the signed body is origin, decimal tree size and base64 root hash only. Its time is\nthe genTime of the RFC 3161 token held beside it (``tsa_token``), never a line in the body.",
  "properties": {
    "origin": {
      "default": "ump.poc/log",
      "title": "Origin",
      "type": "string"
    },
    "root_hash": {
      "description": "hex",
      "title": "Root Hash",
      "type": "string"
    },
    "signatures": {
      "items": {
        "$ref": "#/$defs/CheckpointSignature"
      },
      "title": "Signatures",
      "type": "array"
    },
    "size": {
      "minimum": 0,
      "title": "Size",
      "type": "integer"
    },
    "timestamp": {
      "description": "genTime of tsa_token once stamped; not part of the signed body.",
      "format": "date-time",
      "title": "Timestamp",
      "type": "string"
    },
    "tsa_token": {
      "anyOf": [
        {
          "$ref": "#/$defs/TimestampToken"
        },
        {
          "type": "null"
        }
      ],
      "default": null
    }
  },
  "required": [
    "size",
    "root_hash",
    "timestamp"
  ],
  "title": "Checkpoint",
  "type": "object"
}
