{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://xcim.org/schemas/0.1/proof-bundle.schema.json",
  "title": "XCIM 0.1 Full Proof Bundle",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "xcim_version", "object_type", "bundle_id", "generated_at", "receipt", "receipt_commitment",
    "receipt_event", "event_inclusion_proof", "current_status_proof", "batch_manifests", "anchors"
  ],
  "properties": {
    "xcim_version": { "const": "0.1" },
    "object_type": { "const": "xcim_proof_bundle" },
    "bundle_id": { "type": "string", "pattern": "^urn:xcim:proof-bundle:[A-Za-z0-9._~-]+$" },
    "generated_at": { "type": "string", "format": "date-time" },
    "receipt": { "$ref": "jws-envelope.schema.json" },
    "receipt_commitment": { "$ref": "#/$defs/hash" },
    "receipt_event": { "$ref": "transparency-event.schema.json" },
    "event_inclusion_proof": { "$ref": "event-inclusion-proof.schema.json" },
    "current_status_proof": { "$ref": "status-proof.schema.json" },
    "batch_manifests": {
      "type": "array", "minItems": 1,
      "items": {
        "type": "object", "additionalProperties": false, "required": ["batch_sequence", "manifest"],
        "properties": {
          "batch_sequence": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 },
          "manifest": { "$ref": "jws-envelope.schema.json" }
        }
      }
    },
    "anchors": { "type": "array", "minItems": 1, "items": { "$ref": "chain-anchor.schema.json" } }
  },
  "$defs": {
    "hash": { "type": "string", "minLength": 43, "maxLength": 43, "pattern": "^[A-Za-z0-9_-]+$" }
  }
}
