{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://xcim.invalid/ietf/as01/schemas/checkpoint.schema.json",
  "title": "AS01-F01 checkpoint",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "proposal_version",
    "object_type",
    "issuer_id",
    "log_id",
    "genesis_commitment",
    "checkpoint_sequence",
    "previous_checkpoint_commitment",
    "manifest_epoch",
    "manifest_commitment",
    "snapshot_id",
    "permission_batch",
    "authority_history",
    "authority_state_root",
    "this_update",
    "next_update",
    "publication_profile"
  ],
  "properties": {
    "proposal_version": {
      "const": "as-01"
    },
    "object_type": {
      "const": "state_checkpoint"
    },
    "issuer_id": {
      "$ref": "https://xcim.invalid/ietf/as01/schemas/common.schema.json#/$defs/id"
    },
    "log_id": {
      "$ref": "https://xcim.invalid/ietf/as01/schemas/common.schema.json#/$defs/id"
    },
    "genesis_commitment": {
      "$ref": "https://xcim.invalid/ietf/as01/schemas/common.schema.json#/$defs/hash"
    },
    "checkpoint_sequence": {
      "$ref": "https://xcim.invalid/ietf/as01/schemas/common.schema.json#/$defs/positive"
    },
    "previous_checkpoint_commitment": {
      "oneOf": [
        {
          "$ref": "https://xcim.invalid/ietf/as01/schemas/common.schema.json#/$defs/hash"
        },
        {
          "type": "null"
        }
      ]
    },
    "manifest_epoch": {
      "$ref": "https://xcim.invalid/ietf/as01/schemas/common.schema.json#/$defs/positive"
    },
    "manifest_commitment": {
      "$ref": "https://xcim.invalid/ietf/as01/schemas/common.schema.json#/$defs/hash"
    },
    "snapshot_id": {
      "$ref": "https://xcim.invalid/ietf/as01/schemas/common.schema.json#/$defs/hash"
    },
    "permission_batch": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "batch_sequence",
        "batch_manifest_commitment",
        "tree_size",
        "event_root",
        "state_root",
        "created_at"
      ],
      "properties": {
        "batch_sequence": {
          "$ref": "https://xcim.invalid/ietf/as01/schemas/common.schema.json#/$defs/positive"
        },
        "batch_manifest_commitment": {
          "$ref": "https://xcim.invalid/ietf/as01/schemas/common.schema.json#/$defs/hash"
        },
        "tree_size": {
          "$ref": "https://xcim.invalid/ietf/as01/schemas/common.schema.json#/$defs/positive"
        },
        "event_root": {
          "$ref": "https://xcim.invalid/ietf/as01/schemas/common.schema.json#/$defs/hash"
        },
        "state_root": {
          "$ref": "https://xcim.invalid/ietf/as01/schemas/common.schema.json#/$defs/hash"
        },
        "created_at": {
          "$ref": "https://xcim.invalid/ietf/as01/schemas/common.schema.json#/$defs/nonnegative"
        }
      }
    },
    "authority_history": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "tree_size",
        "event_root"
      ],
      "properties": {
        "tree_size": {
          "$ref": "https://xcim.invalid/ietf/as01/schemas/common.schema.json#/$defs/positive"
        },
        "event_root": {
          "$ref": "https://xcim.invalid/ietf/as01/schemas/common.schema.json#/$defs/hash"
        }
      }
    },
    "authority_state_root": {
      "$ref": "https://xcim.invalid/ietf/as01/schemas/common.schema.json#/$defs/hash"
    },
    "this_update": {
      "$ref": "https://xcim.invalid/ietf/as01/schemas/common.schema.json#/$defs/nonnegative"
    },
    "next_update": {
      "$ref": "https://xcim.invalid/ietf/as01/schemas/common.schema.json#/$defs/positive"
    },
    "publication_profile": {
      "const": "as-01-anchored"
    }
  }
}
