{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "urn:orbiplex:schema:capability-passport-revocation:v2",
  "title": "capability-passport-revocation.v2",
  "x-dia-workflow": "project",
  "x-dia-status": "draft",
  "x-dia-basis": [
    "doc/project/40-proposals/076-limited-messaging-grants-decision.md"
  ],
  "type": "object",
  "additionalProperties": false,
  "properties": {
    "schema": {
      "const": "capability-passport-revocation.v2"
    },
    "revocation_id": {
      "type": "string",
      "minLength": 21,
      "maxLength": 128,
      "pattern": "^passport-revocation:[A-Za-z0-9:_-]+$"
    },
    "federation_id": {
      "type": "string",
      "minLength": 1,
      "maxLength": 512
    },
    "target_id": {
      "type": "string",
      "maxLength": 512,
      "pattern": "^(passport:capability:|delegation:issuance:)"
    },
    "delegation_id": {
      "type": "string",
      "minLength": 21,
      "maxLength": 128,
      "pattern": "^delegation:issuance:[A-Za-z0-9:_-]+$"
    },
    "node_id": {
      "type": "string",
      "minLength": 14,
      "maxLength": 512,
      "pattern": "^node:did:key:"
    },
    "revoked_at": {
      "type": "string",
      "format": "date-time"
    },
    "signed_by": {
      "enum": [
        "authority",
        "subject-node"
      ]
    },
    "signatures": {
      "type": "array",
      "minItems": 1,
      "maxItems": 32,
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "alg",
          "key_public",
          "value"
        ],
        "properties": {
          "alg": {
            "const": "ed25519"
          },
          "key_public": {
            "type": "string",
            "pattern": "^z[1-9A-HJ-NP-Za-km-z]+$"
          },
          "value": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128
          }
        }
      }
    }
  },
  "required": [
    "schema",
    "revocation_id",
    "federation_id",
    "target_id",
    "delegation_id",
    "node_id",
    "revoked_at",
    "signed_by",
    "signatures"
  ]
}
