{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://xcim.invalid/ietf/as01/schemas/permission-evidence.schema.json",
  "title": "AS01-F01 permission-evidence",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "receipt",
    "receipt_event",
    "event_inclusion",
    "state_proof",
    "batch"
  ],
  "properties": {
    "receipt": {
      "$ref": "https://xcim.invalid/ietf/as01/schemas/common.schema.json#/$defs/jws"
    },
    "receipt_event": {
      "$ref": "https://xcim.org/schemas/0.1/transparency-event.schema.json"
    },
    "event_inclusion": {
      "$ref": "https://xcim.invalid/ietf/as01/schemas/event-inclusion.schema.json"
    },
    "state_proof": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "batch_sequence",
        "state_key",
        "state_root",
        "tree_depth",
        "presence",
        "state_value",
        "sibling_bitmap",
        "non_empty_siblings",
        "this_update",
        "next_update"
      ],
      "properties": {
        "batch_sequence": {
          "$ref": "https://xcim.invalid/ietf/as01/schemas/common.schema.json#/$defs/positive"
        },
        "state_key": {
          "$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"
        },
        "tree_depth": {
          "const": 256
        },
        "presence": {
          "const": true
        },
        "state_value": {
          "type": "object",
          "additionalProperties": false,
          "required": [
            "object_id",
            "status",
            "status_epoch",
            "effective_at",
            "latest_event_commitment"
          ],
          "properties": {
            "object_id": {
              "$ref": "https://xcim.invalid/ietf/as01/schemas/common.schema.json#/$defs/id"
            },
            "status": {
              "enum": [
                "active",
                "declined",
                "revoked",
                "expired",
                "suspended",
                "erased"
              ]
            },
            "status_epoch": {
              "$ref": "https://xcim.invalid/ietf/as01/schemas/common.schema.json#/$defs/positive"
            },
            "effective_at": {
              "type": "string",
              "format": "date-time"
            },
            "latest_event_commitment": {
              "$ref": "https://xcim.invalid/ietf/as01/schemas/common.schema.json#/$defs/hash"
            }
          }
        },
        "sibling_bitmap": {
          "$ref": "https://xcim.invalid/ietf/as01/schemas/common.schema.json#/$defs/hash"
        },
        "non_empty_siblings": {
          "type": "array",
          "items": {
            "$ref": "https://xcim.invalid/ietf/as01/schemas/common.schema.json#/$defs/hash"
          },
          "minItems": 0,
          "maxItems": 256
        },
        "this_update": {
          "type": "string",
          "format": "date-time"
        },
        "next_update": {
          "type": "string",
          "format": "date-time"
        }
      }
    },
    "batch": {
      "$ref": "https://xcim.invalid/ietf/as01/schemas/common.schema.json#/$defs/jws"
    }
  }
}
