{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://thehiveryiq.com/.well-known/schemas/issuer-registry-v1.json",
  "title": "Hive Issuer Registry v1",
  "description": "Schema for the canonical Hive Issuer Registry. Maps issuer DIDs to verified bindings (domain, X handle, email) and signing keys.",
  "type": "object",
  "required": ["version", "registry_root_pubkey", "issuers", "last_updated"],
  "properties": {
    "version": { "type": "string", "pattern": "^\\d+\\.\\d+\\.\\d+$" },
    "name": { "type": "string" },
    "description": { "type": "string" },
    "schema": { "type": "string", "format": "uri" },
    "registry_root_pubkey": { "type": "string", "pattern": "^ed25519:[A-Za-z0-9_-]+$" },
    "policy": { "type": "string", "format": "uri" },
    "issuers": {
      "type": "array",
      "items": {
        "type": "object",
        "required": ["did", "name", "tier", "pubkey", "registered_at", "status"],
        "properties": {
          "did": { "type": "string", "pattern": "^did:hive:[a-z0-9-]+$" },
          "name": { "type": "string" },
          "tier": { "enum": ["pro", "scale", "enterprise"] },
          "bindings": {
            "type": "object",
            "properties": {
              "domain": { "type": "string" },
              "x_handle": { "type": "string" },
              "email": { "type": "string", "format": "email" }
            }
          },
          "pubkey": { "type": "string", "pattern": "^ed25519:[A-Za-z0-9_-]+$" },
          "registered_at": { "type": "string", "format": "date-time" },
          "expires_at": { "type": "string", "format": "date-time" },
          "status": { "enum": ["active", "suspended", "revoked"] }
        }
      }
    },
    "last_updated": { "type": "string", "format": "date-time" }
  }
}
