{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "ᛖᚹᛁ ᚱᚢᚾᛁᚲ ᛗᚨᚲᚺᛁᚾᛖ ᚲᛟᛗᛗᚢᚾᛁᚲᚨᛏᛁᛟᚾ ᛖᚾᚹᛖᛚᛟᛈᛖ 1.2",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "protocol",
    "version",
    "messageId",
    "senderId",
    "recipientId",
    "tokenSequence",
    "glyphSequence",
    "schemaId",
    "purposeCode",
    "authorityRef",
    "authorityExpiresAt",
    "issuedAt",
    "expiresAt",
    "nonce",
    "payload",
    "payloadDigest",
    "registryDigest",
    "negotiation",
    "previousMessageId",
    "correctionOf",
    "signatureState"
  ],
  "properties": {
    "protocol": {
      "const": "EVI-RUNE-M2M"
    },
    "version": {
      "enum": [
        "1.1.0",
        "1.2.0"
      ]
    },
    "messageId": {
      "type": "string",
      "pattern": "^RMCP-[A-Z0-9-]{8,64}$"
    },
    "senderId": {
      "type": "string",
      "minLength": 3,
      "maxLength": 128
    },
    "recipientId": {
      "type": "string",
      "minLength": 3,
      "maxLength": 128
    },
    "tokenSequence": {
      "type": "array",
      "minItems": 1,
      "maxItems": 32,
      "items": {
        "type": "string",
        "pattern": "^T(?:0[1-9]|[12][0-9]|3[0-3])$"
      }
    },
    "glyphSequence": {
      "type": "string",
      "minLength": 1,
      "maxLength": 64
    },
    "schemaId": {
      "type": "string",
      "minLength": 3,
      "maxLength": 128
    },
    "purposeCode": {
      "type": "string",
      "pattern": "^[A-Z0-9_]{3,64}$"
    },
    "authorityRef": {
      "type": "string",
      "minLength": 3,
      "maxLength": 256
    },
    "authorityExpiresAt": {
      "type": "string",
      "format": "date-time"
    },
    "issuedAt": {
      "type": "string",
      "format": "date-time"
    },
    "expiresAt": {
      "type": "string",
      "format": "date-time"
    },
    "nonce": {
      "type": "string",
      "pattern": "^[A-Za-z0-9_-]{16,128}$"
    },
    "payload": {},
    "payloadDigest": {
      "type": "string",
      "pattern": "^sha256:[0-9a-f]{64}$"
    },
    "registryDigest": {
      "type": "string",
      "pattern": "^sha256:[0-9a-f]{64}$"
    },
    "negotiation": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "selectedVersion",
        "capabilityAdvertisementDigest",
        "registryDigest",
        "downgradeProofDigest"
      ],
      "properties": {
        "selectedVersion": {
          "enum": [
            "1.1.0",
            "1.2.0"
          ]
        },
        "capabilityAdvertisementDigest": {
          "type": "string",
          "pattern": "^sha256:[0-9a-f]{64}$"
        },
        "registryDigest": {
          "type": "string",
          "pattern": "^sha256:[0-9a-f]{64}$"
        },
        "downgradeProofDigest": {
          "type": [
            "string",
            "null"
          ],
          "pattern": "^sha256:[0-9a-f]{64}$"
        }
      }
    },
    "previousMessageId": {
      "type": [
        "string",
        "null"
      ]
    },
    "correctionOf": {
      "type": [
        "string",
        "null"
      ]
    },
    "signatureState": {
      "enum": [
        "NOT_IMPLEMENTED",
        "TEST_ONLY_ED25519"
      ]
    }
  },
  "truthBoundary": "ᛊᛏᚱᚢᚲᛏᚢᚱᚨᛚ ᚹᚨᛚᛁᛞᚨᛏᛁᛟᚾ ᚨᚾᛞ ᚱᛖᛈᛟᛊᛁᛏᛟᚱᛃ-ᛚᛟᚲᚨᛚ ᛁᚾᛏᛖᚱᛟᛈᛖᚱᚨᛒᛁᛚᛁᛏᛃ ᛟᚾᛚᛃ. ᚾᛟ ᛈᚱᛟᛞᚢᚲᛏᛁᛟᚾ ᚨᛞᛟᛈᛏᛁᛟᚾ, ᛈᚱᛟᛞᚢᚲᛏᛁᛟᚾ ᛊᛁᚷᚾᛁᛜ, ᚱᛖᛗᛟᛏᛖ ᛖᚲᛊᚲᚺᚨᛜᛖ, ᛟᚱ ᚨᚱᛒᛁᛏᚱᚨᚱᛃ ᛊᛖᛗᚨᚾᛏᛁᚲ ᛖᚲᚹᛁᚹᚨᛚᛖᚾᚲᛖ ᛁᛊ ᚨᛊᛊᛖᚱᛏᛖᛞ."
}
