{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://thehiveryiq.com/.well-known/schemas/authority-revocation-v1.json",
  "title": "Authority Revocation Receipt, v1",
  "description": "Canonical schema for the Hive authority revocation receipt, canonical type authority.revocation.",
  "type": "object",
  "required": [
    "receipt_id",
    "payload_sha256",
    "sig_b64u",
    "key_id",
    "algorithm",
    "ts",
    "signed_body"
  ],
  "additionalProperties": false,
  "properties": {
    "receipt_id": {
      "type": "string",
      "pattern": "^r_authority[.]revocation_[0-9]{10,}_[0-9a-f]{12}$"
    },
    "payload_sha256": {
      "type": "string",
      "pattern": "^[0-9a-f]{64}$"
    },
    "sig_b64u": {
      "type": "string",
      "pattern": "^[A-Za-z0-9_-]{86}$"
    },
    "key_id": {
      "type": "string",
      "pattern": "^did:(hive|web|key):[A-Za-z0-9._:%-]+$"
    },
    "algorithm": {
      "type": "string",
      "const": "Ed25519"
    },
    "ts": {
      "type": "integer",
      "minimum": 1000000000
    },
    "signed_body": {
      "type": "object",
      "required": [
        "receipt_type",
        "schema",
        "finding_id",
        "authority_ref",
        "action",
        "revocation",
        "propagation",
        "classification",
        "notification_evidence",
        "boundary"
      ],
      "additionalProperties": false,
      "properties": {
        "receipt_type": {
          "type": "string",
          "const": "authority.revocation"
        },
        "schema": {
          "type": "string",
          "const": "r1.0.0"
        },
        "finding_id": {
          "type": "string",
          "minLength": 1,
          "maxLength": 256,
          "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,255}$"
        },
        "authority_ref": {
          "type": "object",
          "required": [
            "authority_commitment",
            "reference_class"
          ],
          "additionalProperties": false,
          "properties": {
            "authority_commitment": {
              "type": "string",
              "pattern": "^[0-9a-f]{64}$"
            },
            "reference_class": {
              "type": "string",
              "enum": [
                "issuer_resolved",
                "caller_supplied",
                "asserted_without_source"
              ]
            }
          }
        },
        "action": {
          "type": "object",
          "required": [
            "action_id",
            "authority_commitment",
            "instant"
          ],
          "additionalProperties": false,
          "properties": {
            "action_id": {
              "type": "string",
              "minLength": 1,
              "maxLength": 256,
              "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,255}$"
            },
            "authority_commitment": {
              "type": "string",
              "pattern": "^[0-9a-f]{64}$"
            },
            "instant": {
              "type": "object",
              "required": [
                "utc",
                "drift_seconds"
              ],
              "additionalProperties": false,
              "properties": {
                "utc": {
                  "type": "string",
                  "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}([.][0-9]{1,9})?Z$"
                },
                "drift_seconds": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 86400
                }
              }
            }
          }
        },
        "revocation": {
          "type": "object",
          "required": [
            "revocation_id",
            "authority_commitment",
            "instant"
          ],
          "additionalProperties": false,
          "properties": {
            "revocation_id": {
              "type": "string",
              "minLength": 1,
              "maxLength": 256,
              "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,255}$"
            },
            "authority_commitment": {
              "type": "string",
              "pattern": "^[0-9a-f]{64}$"
            },
            "instant": {
              "type": "object",
              "required": [
                "utc",
                "drift_seconds"
              ],
              "additionalProperties": false,
              "properties": {
                "utc": {
                  "type": "string",
                  "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}([.][0-9]{1,9})?Z$"
                },
                "drift_seconds": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 86400
                }
              }
            }
          }
        },
        "propagation": {
          "type": "object",
          "required": [
            "propagation_bound_seconds",
            "propagation_bound_commitment",
            "salt_b64u",
            "salt_commitment",
            "prior_receipt"
          ],
          "additionalProperties": false,
          "properties": {
            "propagation_bound_seconds": {
              "type": "integer",
              "minimum": 0,
              "maximum": 2592000
            },
            "propagation_bound_commitment": {
              "type": "string",
              "pattern": "^[0-9a-f]{64}$"
            },
            "salt_b64u": {
              "type": "string",
              "pattern": "^[A-Za-z0-9_-]{16,128}$"
            },
            "salt_commitment": {
              "type": "string",
              "pattern": "^[0-9a-f]{64}$"
            },
            "prior_receipt": {
              "type": "object",
              "required": [
                "receipt_id",
                "receipt_type",
                "envelope_sha256",
                "issuance_instant"
              ],
              "additionalProperties": false,
              "properties": {
                "receipt_id": {
                  "type": "string",
                  "pattern": "^r_authority[.]propagation_policy_[0-9]{10,}_[0-9a-f]{12}$"
                },
                "receipt_type": {
                  "type": "string",
                  "const": "authority.propagation_policy"
                },
                "envelope_sha256": {
                  "type": "string",
                  "pattern": "^[0-9a-f]{64}$"
                },
                "issuance_instant": {
                  "type": "object",
                  "required": [
                    "utc",
                    "drift_seconds"
                  ],
                  "additionalProperties": false,
                  "properties": {
                    "utc": {
                      "type": "string",
                      "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}([.][0-9]{1,9})?Z$"
                    },
                    "drift_seconds": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 86400
                    }
                  }
                }
              }
            }
          }
        },
        "classification": {
          "type": "string",
          "enum": [
            "before_revocation",
            "within_propagation_bound",
            "after_propagation_bound",
            "indeterminate"
          ]
        },
        "notification_evidence": {
          "type": "object",
          "required": [
            "class",
            "evidence_envelope_sha256"
          ],
          "additionalProperties": false,
          "properties": {
            "class": {
              "type": "string",
              "enum": [
                "direct_notification_evidence",
                "publication_evidence",
                "none"
              ]
            },
            "evidence_envelope_sha256": {
              "type": [
                "string",
                "null"
              ],
              "pattern": "^[0-9a-f]{64}$"
            }
          }
        },
        "boundary": {
          "type": "string",
          "const": "This receipt attests only that a named action, a named revocation, and a precommitted propagation bound satisfy the stated deterministic temporal classification procedure. It does not establish that the revocation is authorized, delivered, valid, enforceable, or effective as a matter of contract or law. It does not establish that the action is authorized, unauthorized, excused, ratified, wrongful, binding, or ineffective. A class of within_propagation_bound does not excuse the action and does not allocate risk, fault, responsibility, liability, loss, or remedy. Notification evidence records only the stated evidence class and does not establish that an actor receives, reads, understands, or has actual knowledge of revocation. This receipt does not decide any contractual, statutory, regulatory, evidentiary, or legal consequence, and it does not authorize any action, payment, sanction, denial, or remedy."
        }
      }
    }
  }
}
