{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://degrees-of-satoshi.pages.dev/history/data/v2.1.0/bitcoin-history-timeline.schema.json",
  "title": "Bitcoin Historical Event Catalog",
  "description": "Schema for the Degrees of Satoshi source-linked Bitcoin history catalog.",
  "type": "object",
  "required": [
    "schema_version",
    "dataset",
    "identifier",
    "version",
    "date_modified",
    "canonical",
    "schema",
    "methodology",
    "temporal_coverage",
    "event_count",
    "events"
  ],
  "properties": {
    "schema_version": {
      "const": "2.0"
    },
    "dataset": {
      "const": "Bitcoin Historical Event Catalog"
    },
    "identifier": {
      "type": "string"
    },
    "version": {
      "const": "2.1.0"
    },
    "date_modified": {
      "type": "string",
      "format": "date"
    },
    "canonical": {
      "type": "string",
      "format": "uri"
    },
    "schema": {
      "type": "string",
      "format": "uri"
    },
    "methodology": {
      "type": "string",
      "format": "uri"
    },
    "temporal_coverage": {
      "type": "string"
    },
    "event_count": {
      "type": "integer",
      "minimum": 1
    },
    "events": {
      "type": "array",
      "minItems": 1,
      "items": {
        "type": "object",
        "required": [
          "id",
          "chapter",
          "record_number",
          "date",
          "start_date",
          "end_date",
          "date_precision",
          "display_date",
          "plane",
          "locator",
          "title",
          "summary",
          "sources",
          "related_pages"
        ],
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$"
          },
          "chapter": {
            "enum": [
              "foundations",
              "launch",
              "infrastructure",
              "governance",
              "institutions"
            ]
          },
          "record_number": {
            "type": "string",
            "pattern": "^REC [0-9]{2}$"
          },
          "date": {
            "type": "string",
            "pattern": "^[0-9]{4}(?:-[0-9]{2}(?:-[0-9]{2})?)?$"
          },
          "start_date": {
            "type": "string",
            "pattern": "^[0-9]{4}(?:-[0-9]{2}(?:-[0-9]{2})?)?$"
          },
          "end_date": {
            "type": "string",
            "pattern": "^[0-9]{4}(?:-[0-9]{2}(?:-[0-9]{2})?)?$"
          },
          "date_precision": {
            "enum": [
              "day",
              "month",
              "year"
            ]
          },
          "display_date": {
            "type": "string"
          },
          "plane": {
            "enum": [
              "Pre-chain",
              "Protocol",
              "On-chain",
              "Network launch",
              "Market",
              "Consensus",
              "Governance",
              "Issuance",
              "Law & policy",
              "Custody",
              "Second layer",
              "Corporate treasury",
              "Mining",
              "Financial wrapper"
            ]
          },
          "locator": {
            "type": "string",
            "minLength": 1
          },
          "title": {
            "type": "string"
          },
          "summary": {
            "type": "string"
          },
          "sources": {
            "type": "array",
            "minItems": 1,
            "items": {
              "$ref": "#/$defs/link"
            }
          },
          "related_pages": {
            "type": "array",
            "items": {
              "$ref": "#/$defs/link"
            }
          }
        },
        "additionalProperties": false
      }
    }
  },
  "$defs": {
    "link": {
      "type": "object",
      "required": [
        "label",
        "url"
      ],
      "properties": {
        "label": {
          "type": "string"
        },
        "url": {
          "type": "string",
          "format": "uri"
        }
      },
      "additionalProperties": false
    }
  },
  "additionalProperties": false
}
