{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://bitmap-memory-atlas.yen524.chatgpt.site/open/atlas-schema.json",
  "title": "The Bitcoin Codex Asset Manifest",
  "type": "object",
  "required": ["protocol", "model", "asset", "block", "normalized", "memories", "provenance"],
  "properties": {
    "protocol": { "const": "memory-atlas" },
    "model": {
      "type": "object",
      "required": ["id", "version", "license"],
      "properties": {
        "id": { "const": "atlas-model-03" },
        "version": { "type": "string" },
        "license": { "const": "MIT" }
      }
    },
    "asset": {
      "type": "object",
      "required": ["id", "district", "canonicalCamera"],
      "properties": {
        "id": { "type": "string", "pattern": "^[0-9]+\\.bitmap$" },
        "district": { "type": "integer", "minimum": 0 },
        "canonicalCamera": { "type": "object" }
      }
    },
    "block": {
      "type": "object",
      "required": ["height", "hash", "timestamp", "txCount", "size", "weight", "merkleRoot"],
      "properties": {
        "height": { "type": "integer", "minimum": 0 },
        "hash": { "type": "string", "pattern": "^[0-9a-f]{64}$" },
        "timestamp": { "type": "integer" },
        "txCount": { "type": "integer", "minimum": 1 },
        "size": { "type": "integer", "minimum": 1 },
        "weight": { "type": "integer", "minimum": 1 },
        "merkleRoot": { "type": "string", "pattern": "^[0-9a-f]{64}$" },
        "extras": { "type": "object" }
      }
    },
    "normalized": { "type": "object" },
    "bitmap": { "type": ["object", "null"] },
    "memories": { "type": "array", "items": { "type": "object" } },
    "provenance": { "type": "array", "items": { "type": "object", "required": ["role", "url"] } },
    "generatedAt": { "type": ["string", "null"], "format": "date-time" }
  }
}
