{
 "openapi": "3.1.0",
 "info": {
  "title": "Post-Quantum Blockchains API",
  "version": "0.7.3",
  "summary": "Read-only JSON, CSV and SVG files on the post-quantum signature stage (0 to 5) of each blockchain.",
  "description": "Static files on GitHub Pages, rebuilt from the data on every update. No key and no sign-up; every response allows cross-origin requests (Access-Control-Allow-Origin: *), so a web page can call it from the browser. Only GET. Rate limits are GitHub Pages' own. Not investment advice and not a security rating; it does not predict when current cryptography might be broken.\n\nStart with /data/chains/index.json for the list of IDs, then /data/chains/{id}.json for one chain. Within schema version 1 fields are only added, never removed or renamed.\n\nVerify a download: every file under /data/ is listed with its SHA-256 in /data/SHA256SUMS (run sha256sum -c SHA256SUMS in a folder holding the files).\n\nStuck? Open an integration help issue: https://github.com/Balance0014/post-quantum-blockchains/issues/new?template=integration.yml (reply within 2 days).",
  "license": {
   "name": "CC BY 4.0",
   "url": "https://github.com/Balance0014/post-quantum-blockchains/blob/main/LICENSE"
  },
  "contact": {
   "name": "Integration help",
   "url": "https://github.com/Balance0014/post-quantum-blockchains/issues/new?template=integration.yml"
  }
 },
 "externalDocs": {
  "description": "Data page: fields, embeds and examples",
  "url": "https://balance0014.github.io/post-quantum-blockchains/data/"
 },
 "servers": [
  {
   "url": "https://balance0014.github.io/post-quantum-blockchains"
  }
 ],
 "paths": {
  "/data/chains/index.json": {
   "get": {
    "operationId": "listChains",
    "summary": "Every chain, with its stage and the address of its own file",
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Index"
        }
       }
      }
     }
    }
   }
  },
  "/data/chains/{id}.json": {
   "get": {
    "operationId": "getChain",
    "summary": "One chain: stage, category, algorithm, coverage, sources and embed addresses",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "description": "Chain ID, as listed in data/chains/index.json (for example bitcoin, ethereum, qrl).",
      "schema": {
       "type": "string",
       "pattern": "^[a-z0-9-]+$"
      },
      "example": "bitcoin"
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "schema/chain-v1.json"
        }
       }
      }
     },
     "404": {
      "description": "No chain with this ID (GitHub Pages serves its 404 page as HTML)."
     }
    }
   }
  },
  "/data/chains.json": {
   "get": {
    "operationId": "getDataset",
    "summary": "The full dataset: every chain with its evidence, milestones and sources",
    "description": "The source file the site is built from; richer than the per-chain files and less stable in shape.",
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     }
    }
   }
  },
  "/data/chains.csv": {
   "get": {
    "operationId": "getChainsCsv",
    "summary": "One row per chain, for spreadsheets",
    "description": "UTF-8, comma-separated, header row first; columns are described on the data page.",
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "text/csv": {
        "schema": {
         "type": "string"
        }
       }
      }
     }
    }
   }
  },
  "/data/network.json": {
   "get": {
    "operationId": "getNetwork",
    "summary": "The latest weekly network check: newest block and code activity per chain",
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     }
    }
   }
  },
  "/data/SHA256SUMS": {
   "get": {
    "operationId": "getChecksums",
    "summary": "SHA-256 of every file under /data/",
    "description": "One line per file, in the format sha256sum -c reads; paths are relative to /data/.",
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "text/plain": {
        "schema": {
         "type": "string"
        }
       }
      }
     }
    }
   }
  },
  "/badges/{id}.svg": {
   "get": {
    "operationId": "getBadge",
    "summary": "Badge showing the chain's stage (English; /badges/zh/{id}.svg for Chinese)",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "description": "Chain ID, as listed in data/chains/index.json (for example bitcoin, ethereum, qrl).",
      "schema": {
       "type": "string",
       "pattern": "^[a-z0-9-]+$"
      },
      "example": "bitcoin"
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "image/svg+xml": {
        "schema": {
         "type": "string"
        }
       }
      }
     },
     "404": {
      "description": "No chain with this ID (GitHub Pages serves its 404 page as HTML)."
     }
    }
   }
  },
  "/badges/short/{id}.svg": {
   "get": {
    "operationId": "getShortBadge",
    "summary": "Short badge reading \"PQ stage 2/5\" for the chain's stage (English; /badges/short/zh/{id}.svg for Chinese)",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "description": "Chain ID, as listed in data/chains/index.json (for example bitcoin, ethereum, qrl).",
      "schema": {
       "type": "string",
       "pattern": "^[a-z0-9-]+$"
      },
      "example": "bitcoin"
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "image/svg+xml": {
        "schema": {
         "type": "string"
        }
       }
      }
     },
     "404": {
      "description": "No chain with this ID (GitHub Pages serves its 404 page as HTML)."
     }
    }
   }
  },
  "/badges/card/{id}.svg": {
   "get": {
    "operationId": "getCard",
    "summary": "Card with the stage, algorithm and the date checked (English; /badges/card/zh/{id}.svg for Chinese)",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "description": "Chain ID, as listed in data/chains/index.json (for example bitcoin, ethereum, qrl).",
      "schema": {
       "type": "string",
       "pattern": "^[a-z0-9-]+$"
      },
      "example": "bitcoin"
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "image/svg+xml": {
        "schema": {
         "type": "string"
        }
       }
      }
     },
     "404": {
      "description": "No chain with this ID (GitHub Pages serves its 404 page as HTML)."
     }
    }
   }
  },
  "/llms.txt": {
   "get": {
    "operationId": "getLlmsTxt",
    "summary": "Plain-text summary for AI assistants: what the tracker is, every page and file, and one line per chain",
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "text/plain": {
        "schema": {
         "type": "string"
        }
       }
      }
     }
    }
   }
  }
 },
 "components": {
  "schemas": {
   "Index": {
    "type": "object",
    "required": [
     "schema",
     "version",
     "data_checked",
     "license",
     "attribution",
     "chains"
    ],
    "properties": {
     "schema": {
      "const": "post-quantum-blockchains/index@1"
     },
     "version": {
      "type": "string"
     },
     "data_checked": {
      "type": "string",
      "format": "date"
     },
     "license": {
      "type": "string"
     },
     "attribution": {
      "type": "string"
     },
     "author": {
      "type": "string",
      "format": "uri"
     },
     "chains": {
      "type": "array",
      "items": {
       "type": "object",
       "required": [
        "id",
        "name",
        "ticker",
        "stage",
        "category",
        "json",
        "page"
       ],
       "properties": {
        "id": {
         "type": "string"
        },
        "name": {
         "type": "string"
        },
        "zh_name": {
         "type": [
          "string",
          "null"
         ]
        },
        "ticker": {
         "type": "string"
        },
        "stage": {
         "type": "integer",
         "minimum": 0,
         "maximum": 5
        },
        "category": {
         "enum": [
          "needs_upgrade",
          "native",
          "pre_mainnet"
         ]
        },
        "group": {
         "type": "string",
         "deprecated": true
        },
        "market_cap_rank": {
         "type": [
          "integer",
          "null"
         ]
        },
        "last_reviewed": {
         "type": "string",
         "format": "date"
        },
        "json": {
         "type": "string",
         "format": "uri",
         "description": "Address of this chain's own file."
        },
        "page": {
         "type": "string",
         "format": "uri"
        }
       }
      }
     },
     "repo": {
      "type": "string",
      "format": "uri"
     }
    }
   }
  }
 }
}
