{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://eips.ethereum.org/assets/eip-8419/schemas/kya-discovery.schema.json",
  "title": "KYA Discovery Document v1",
  "description": "Served at https://{domain}/.well-known/kya.json and/or referenced from an ERC-8004 registration file `services` entry named \"KYA\".",
  "type": "object",
  "required": ["type", "kyaRegistry"],
  "properties": {
    "type": { "const": "https://eips.ethereum.org/EIPS/eip-8419#kya-discovery-v1" },
    "kyaRegistry": { "type": "string", "pattern": "^eip155:[0-9]+:0x[0-9a-fA-F]{40}$" },
    "schemeRegistry": { "type": "string", "pattern": "^eip155:[0-9]+:0x[0-9a-fA-F]{40}$" },
    "subjects": {
      "type": "array",
      "description": "Subjects this agent can present for (usually one ERC-8004 registration).",
      "items": {
        "type": "object",
        "required": ["subjectType"],
        "properties": {
          "subjectType": { "type": "string", "examples": ["erc8004", "account", "erc721", "did"] },
          "agentRegistry": { "type": "string", "pattern": "^eip155:[0-9]+:0x[0-9a-fA-F]{40}$" },
          "agentId": { "type": "integer", "minimum": 0 },
          "subjectKey": { "type": "string", "pattern": "^0x[0-9a-fA-F]{64}$" }
        }
      }
    },
    "presentableSchemes": { "type": "array", "items": { "type": "string", "pattern": "^0x[0-9a-fA-F]{64}$" } },
    "acceptedPolicies": { "type": "array", "items": { "type": "string", "pattern": "^0x[0-9a-fA-F]{64}$" } },
    "challengeEndpoint": { "type": "string", "format": "uri", "description": "HTTP endpoint accepting POST KYAChallenge and returning KYAPresentation." },
    "bridges": {
      "type": "array",
      "description": "ERC-8004 KYA bridges whose mirrored validations this agent participates in.",
      "items": { "type": "string", "pattern": "^eip155:[0-9]+:0x[0-9a-fA-F]{40}$" }
    }
  }
}
