{
  "schema_version": "sg_data_download_metadata.v1",
  "id": "sg-difficulty-ledger",
  "name": "Difficulty by retarget period",
  "description": "Every retarget period since genesis, its difficulty exact from the block header.",
  "page": "https://satoshigazette.org/data/mining",
  "dictionary": "https://satoshigazette.org/data/dictionary#sg-difficulty-ledger",
  "version": "1.0.0",
  "latest": {
    "date": "2026-10-01T08:55:37Z",
    "block_height": 969431
  },
  "snapshot": "through block 969,431 · read 1 Oct 2026",
  "licence": {
    "name": "CC BY 4.0",
    "title": "Creative Commons Attribution 4.0 International",
    "url": "https://creativecommons.org/licenses/by/4.0/",
    "covers": "Satoshi Gazette’s compilation, selection and annotations in the files offered for download.",
    "upstream": "Upstream records keep their own terms, stated per dataset. The Gazette’s articles stay under copyright."
  },
  "cite": "Satoshi Gazette Data Desk, Difficulty by retarget period (sg-difficulty-ledger), version 1.0.0, data through 1 Oct 2026. https://satoshigazette.org/data/downloads/sg-difficulty-ledger.json",
  "sources": [
    {
      "label": "Block headers, mempool.space",
      "url": "https://mempool.space/docs/api/rest"
    },
    {
      "label": "Second operator, Blockstream Esplora",
      "url": "https://github.com/Blockstream/esplora/blob/master/API.md"
    },
    {
      "label": "Retarget rule, Bitcoin Core",
      "url": "https://github.com/bitcoin/bitcoin/blob/master/src/pow.cpp"
    }
  ],
  "source_terms": "mempool.space’s terms of service grant no data licence and forbid no reuse; accuracy is disclaimed. Blockstream’s public Esplora API, the second operator, states no data terms the desk could find; its software is MIT-licensed.",
  "files": {
    "json": {
      "url": "https://satoshigazette.org/data/downloads/sg-difficulty-ledger.json",
      "media_type": "application/json",
      "bytes": 334155,
      "sha256": "343876495bc2e52bf6e8098a6eb98e92aa4d29a0c270fa758124509b3231e2f2"
    },
    "csv": {
      "url": "https://satoshigazette.org/data/downloads/sg-difficulty-ledger.csv",
      "media_type": "text/csv",
      "bytes": 153089,
      "sha256": "980e5ccc0667080151d9154c2e69a9a9695f842016a87b9529460d1952b7e718",
      "row_is": "One row per 2,016-block retarget period since the genesis block; the latest period is still open.",
      "columns": [
        {
          "name": "epoch",
          "note": "The retarget period, counted from 0."
        },
        {
          "name": "start_height",
          "note": "Height of the period’s first block, the retarget block."
        },
        {
          "name": "end_height",
          "note": "Height of the last block read in the period."
        },
        {
          "name": "blocks",
          "note": "Blocks in the period so far; 2,016 when complete."
        },
        {
          "name": "complete",
          "note": "true when the period holds all 2,016 blocks."
        },
        {
          "name": "first_block_time",
          "note": "Header time of the first block, UTC."
        },
        {
          "name": "last_block_time",
          "note": "Header time of the last block read, UTC."
        },
        {
          "name": "retarget_hash",
          "note": "Hash of the first block."
        },
        {
          "name": "last_block_hash",
          "note": "Hash of the last block read."
        },
        {
          "name": "bits",
          "note": "nBits of the first block’s header, eight hex digits."
        },
        {
          "name": "difficulty_fraction",
          "note": "Exact difficulty as a reduced fraction: 0xffff × 2^208 over the target."
        },
        {
          "name": "difficulty_decimal",
          "note": "The fraction cut, never rounded, to 8 decimals."
        },
        {
          "name": "difficulty_core_float",
          "note": "Bitcoin Core’s double-precision difficulty, written out exactly."
        },
        {
          "name": "ratio_to_previous",
          "note": "The previous period’s target over this one, cut to 10 decimals; empty at genesis."
        },
        {
          "name": "subsidy_sats",
          "note": "Subsidy of the period’s blocks, from the halving schedule, in sats."
        },
        {
          "name": "second_operator_hash",
          "note": "true when the first block’s hash was matched on Blockstream’s Esplora."
        },
        {
          "name": "retarget_rule",
          "note": "true when the nBits equals what the consensus rule requires from the period before; empty at genesis."
        }
      ]
    }
  },
  "csv_absent": null,
  "notes": [
    "This file carries the difficulty dataset, sg-difficulty-ledger, only. The reward ledger, sg-block-ledger, is offered as its own file once it reaches the chain tip, so here ledger_through_height, ledger_tip_hash and every period’s ledger are null and coinbase_proved is empty: left out of this file, not zero and not unread. header_check states the retarget-window check the difficulty pass gives every period. For a period the reward ledger has read, every header was checked as well; this file states the weaker check, never a stronger one.",
    "In a spreadsheet, import every column of the CSV as text. Opened by double-click, a spreadsheet reads an nBits value such as 17042e95 as a number, reads the fraction 1/1 as a date and keeps only 15 digits of a longer figure. The JSON is unaffected."
  ]
}
