{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://www.hoodbuybutton.com/canon/manifest.schema.json",
  "title": "The Buy Button Canonical Identity Manifest",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "$schema",
    "schemaVersion",
    "recordType",
    "recordVersion",
    "issuedAt",
    "issuedAtUnix",
    "canonicalUri",
    "subject",
    "declaration",
    "signing",
    "evidence"
  ],
  "properties": {
    "$schema": { "type": "string", "format": "uri" },
    "schemaVersion": { "const": "1.0.0" },
    "recordType": { "const": "canonical-project-identity" },
    "recordVersion": { "type": "integer", "minimum": 1 },
    "issuedAt": { "type": "string", "format": "date-time" },
    "issuedAtUnix": { "type": "integer", "minimum": 1 },
    "canonicalUri": { "type": "string", "format": "uri" },
    "subject": {
      "type": "object",
      "required": [
        "name",
        "symbol",
        "projectType",
        "chain",
        "token",
        "primaryPool",
        "treasury",
        "official",
        "assets"
      ],
      "properties": {
        "name": { "type": "string" },
        "symbol": { "type": "string" },
        "projectType": { "type": "string" },
        "chain": { "type": "object" },
        "token": { "type": "object" },
        "primaryPool": { "type": "string", "pattern": "^0x[0-9A-Fa-f]{40}$" },
        "treasury": { "type": "string", "pattern": "^0x[0-9A-Fa-f]{40}$" },
        "official": { "type": "object" },
        "assets": { "type": "array", "minItems": 1 }
      }
    },
    "declaration": { "type": "object" },
    "signing": {
      "type": "object",
      "required": ["standard", "expectedSigner", "signerRole", "domain"],
      "properties": {
        "standard": { "const": "EIP-712" },
        "expectedSigner": { "type": "string", "pattern": "^0x[0-9A-Fa-f]{40}$" },
        "signerRole": { "type": "string" },
        "domain": { "type": "object" }
      }
    },
    "evidence": { "type": "array", "minItems": 1 }
  }
}
