{
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "$id": "https://qdayindex.com/data/schema.json",
 "title": "QDay Index scores.json",
 "description": "Schema for https://qdayindex.com/data/scores.json. Each file under https://qdayindex.com/data/chains/ holds one object of the form given for the items of chains. Field notes: https://qdayindex.com/data/dictionary/",
 "type": "object",
 "additionalProperties": false,
 "required": [
  "name",
  "updated",
  "methodology_version",
  "license",
  "weights",
  "chains"
 ],
 "properties": {
  "name": {
   "type": "string",
   "description": "Name of the publisher."
  },
  "updated": {
   "type": "string",
   "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}$",
   "description": "Date the data last changed (latest score history or change log entry), YYYY-MM-DD. It does not move when the file is only rebuilt."
  },
  "built": {
   "type": "string",
   "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}$",
   "description": "Date the file was built, YYYY-MM-DD."
  },
  "methodology_version": {
   "type": "string",
   "description": "Version of the methodology."
  },
  "license": {
   "type": "string",
   "description": "Licence and credit line for reuse."
  },
  "weights": {
   "type": "object",
   "additionalProperties": false,
   "required": [
    "F1_sig",
    "F2_exposure",
    "F3_upgrade",
    "F4_consensus",
    "F5_governance",
    "F6_wallets"
   ],
   "description": "Weight of each factor in the score.",
   "properties": {
    "F1_sig": {
     "type": "integer",
     "const": 25,
     "description": "Weight of the Signature scheme factor."
    },
    "F2_exposure": {
     "type": "integer",
     "const": 20,
     "description": "Weight of the Exposed coins factor."
    },
    "F3_upgrade": {
     "type": "integer",
     "const": 20,
     "description": "Weight of the Upgrade path factor."
    },
    "F4_consensus": {
     "type": "integer",
     "const": 10,
     "description": "Weight of the Validator / consensus factor."
    },
    "F5_governance": {
     "type": "integer",
     "const": 15,
     "description": "Weight of the Governance speed factor."
    },
    "F6_wallets": {
     "type": "integer",
     "const": 10,
     "description": "Weight of the Wallet support factor."
    }
   }
  },
  "chains": {
   "type": "array",
   "minItems": 1,
   "description": "One object per rated chain, ordered by score from highest to lowest, then by name.",
   "items": {
    "type": "object",
    "additionalProperties": false,
    "required": [
     "rank",
     "chain",
     "name",
     "score",
     "band",
     "stage",
     "stage_label",
     "evidence",
     "factors",
     "signature_scheme",
     "url",
     "sources"
    ],
    "properties": {
     "rank": {
      "type": "integer",
      "minimum": 1,
      "description": "Position by score. Chains with the same score share a rank."
     },
     "chain": {
      "type": "string",
      "minLength": 1,
      "description": "Ticker symbol, the identifier of the chain."
     },
     "name": {
      "type": "string",
      "minLength": 1,
      "description": "Display name of the chain."
     },
     "score": {
      "type": "integer",
      "minimum": 0,
      "maximum": 100,
      "description": "Quantum readiness score: the sum over the six factors of weight x rating / 5, rounded to a whole number."
     },
     "band": {
      "type": "string",
      "enum": [
       "Ready",
       "Advanced",
       "Preparing",
       "Early",
       "Exposed"
      ],
      "description": "Band the score falls in: Ready 80 to 100, Advanced 60 to 79, Preparing 40 to 59, Early 20 to 39, Exposed 0 to 19."
     },
     "stage": {
      "type": "integer",
      "enum": [
       0,
       1,
       2,
       3,
       4
      ],
      "description": "What has shipped for wallet signatures, derived from F1_sig and F3_upgrade."
     },
     "stage_label": {
      "type": "string",
      "enum": [
       "No official plan",
       "Planning",
       "Dated plan or testnet",
       "Opt-in live or approved",
       "Quantum-safe by default"
      ],
      "description": "Name of the stage."
     },
     "evidence": {
      "type": "string",
      "enum": [
       "measured",
       "primary-sourced",
       "news-sourced",
       "self-reported",
       "absence",
       "unclassified"
      ],
      "description": "How well the main claim behind the rating is supported. It does not change the score."
     },
     "factors": {
      "type": "object",
      "additionalProperties": false,
      "required": [
       "F1_sig",
       "F2_exposure",
       "F3_upgrade",
       "F4_consensus",
       "F5_governance",
       "F6_wallets"
      ],
      "properties": {
       "F1_sig": {
        "type": "integer",
        "minimum": 0,
        "maximum": 5,
        "description": "Signature scheme. Does the main wallet signing path use quantum-safe cryptography? Weight 25."
       },
       "F2_exposure": {
        "type": "integer",
        "minimum": 0,
        "maximum": 5,
        "description": "Exposed coins. How much value sits behind public keys already visible on-chain. Weight 20."
       },
       "F3_upgrade": {
        "type": "integer",
        "minimum": 0,
        "maximum": 5,
        "description": "Upgrade path. Formal proposals, funded roadmap, dated milestones, live testnets. Weight 20."
       },
       "F4_consensus": {
        "type": "integer",
        "minimum": 0,
        "maximum": 5,
        "description": "Validator / consensus. Are validator or mining signatures quantum-safe? Weight 10."
       },
       "F5_governance": {
        "type": "integer",
        "minimum": 0,
        "maximum": 5,
        "description": "Governance speed. Can the network actually ship a hard fork? Weight 15."
       },
       "F6_wallets": {
        "type": "integer",
        "minimum": 0,
        "maximum": 5,
        "description": "Wallet support. Do major and hardware wallets support quantum-safe keys? Weight 10."
       }
      }
     },
     "signature_scheme": {
      "type": "string",
      "description": "The signature scheme or schemes the chain uses, as free text."
     },
     "url": {
      "type": "string",
      "pattern": "^https://qdayindex\\.com/[^/]+/$",
      "description": "Address of the chain's page."
     },
     "sources": {
      "type": "array",
      "items": {
       "type": "string"
      },
      "description": "The public sources behind the rating."
     },
     "notices": {
      "type": "array",
      "minItems": 1,
      "description": "Optional: present only when the chain has at least one current notice, newest first. A notice labels the chain (for example a project status or a verification problem) and never changes its score, rank, band, stage or evidence level.",
      "items": {
       "type": "object",
       "additionalProperties": false,
       "required": [
        "kind",
        "text",
        "source_url",
        "date"
       ],
       "properties": {
        "kind": {
         "type": "string",
         "enum": [
          "status",
          "verification",
          "pending-change",
          "correction"
         ],
         "description": "Kind of notice: status, the project has announced a change to the chain itself, such as a shutdown or a migration; verification, a claim behind the rating could not be independently verified; pending-change, a pending decision, such as a governance vote, may change the chain; correction, a correction to information on the chain page."
        },
        "text": {
         "type": "string",
         "minLength": 1,
         "description": "The notice as shown on the chain page, plain text."
        },
        "source_url": {
         "type": "string",
         "pattern": "^https?://",
         "description": "Source for the notice."
        },
        "date": {
         "type": "string",
         "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}$",
         "description": "Date of the notice, YYYY-MM-DD."
        },
        "expires": {
         "type": "string",
         "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}$",
         "description": "Optional: last day the notice is shown, YYYY-MM-DD. Expired notices are left out of every file."
        }
       }
      }
     }
    }
   }
  }
 }
}
