{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "body",
    "proof"
  ],
  "properties": {
    "body": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "type",
        "pair",
        "self",
        "to",
        "card",
        "revision",
        "issuedAt"
      ],
      "properties": {
        "type": {
          "const": "anchor-mapping@2"
        },
        "pair": {
          "type": "string",
          "pattern": "^did:key:z6Mk[1-9A-HJ-NP-Za-km-z]{44}$"
        },
        "self": {
          "type": "string",
          "pattern": "^did:key:z6Mk[1-9A-HJ-NP-Za-km-z]{44}$"
        },
        "to": {
          "type": "string",
          "pattern": "^did:key:z6Mk[1-9A-HJ-NP-Za-km-z]{44}$"
        },
        "card": {
          "$schema": "https://json-schema.org/draft/2020-12/schema",
          "type": "object",
          "additionalProperties": false,
          "required": [
            "body",
            "proof"
          ],
          "properties": {
            "body": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "type",
                "anchor",
                "keyAgreement"
              ],
              "properties": {
                "type": {
                  "const": "self-card@1"
                },
                "anchor": {
                  "type": "string",
                  "pattern": "^did:key:z6Mk[1-9A-HJ-NP-Za-km-z]{44}$"
                },
                "keyAgreement": {
                  "type": "string",
                  "pattern": "^z6LS[1-9A-HJ-NP-Za-km-z]{44}$"
                }
              }
            },
            "proof": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "proofValue"
              ],
              "properties": {
                "proofValue": {
                  "type": "string",
                  "pattern": "^z[1-9A-HJ-NP-Za-km-z]{64,88}$"
                }
              }
            }
          }
        },
        "revision": {
          "type": "string",
          "pattern": "^[1-9][0-9]{0,17}$"
        },
        "issuedAt": {
          "type": "string",
          "pattern": "^[0-9]{4}-((0[13578]|1[02])-(0[1-9]|[12][0-9]|3[01])|(0[469]|11)-(0[1-9]|[12][0-9]|30)|02-(0[1-9]|[12][0-9]))T([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9](\\.[0-9]{1,3})?Z$"
        }
      }
    },
    "proof": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "mac1",
        "mac2"
      ],
      "properties": {
        "mac1": {
          "type": "string",
          "pattern": "^u[A-Za-z0-9_-]{42}[AEIMQUYcgkosw048]$"
        },
        "mac2": {
          "type": "string",
          "pattern": "^u[A-Za-z0-9_-]{42}[AEIMQUYcgkosw048]$"
        }
      }
    }
  },
  "title": "RLTP anchor-mapping@2 (rltp-visibility@0.29)"
}
