{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/sochain-com/json-schema/sochain-com-block-schema.json",
  "title": "Block",
  "x-generated": "2026-10-31",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/sochain-com-openapi.json#/components/schemas/Block",
  "type": "object",
  "required": [
    "height",
    "time",
    "confirmations",
    "num_txs",
    "version",
    "nonce",
    "size",
    "weight",
    "hash",
    "previous_block_hash",
    "next_block_hash",
    "is_orphan",
    "difficulty",
    "merkleroot",
    "reward",
    "fees",
    "value_out",
    "bits",
    "txs",
    "price"
  ],
  "properties": {
    "height": {
      "type": "integer"
    },
    "time": {
      "type": "integer"
    },
    "confirmations": {
      "type": "integer"
    },
    "num_txs": {
      "type": "integer"
    },
    "version": {
      "type": "integer"
    },
    "nonce": {
      "type": [
        "integer",
        "string"
      ],
      "description": "The header's nonce. On Zcash (ZEC, ZECTEST), a string: its 32-byte Equihash nonce in hex."
    },
    "size": {
      "type": "integer"
    },
    "weight": {
      "type": "integer"
    },
    "hash": {
      "type": "string"
    },
    "previous_block_hash": {
      "type": [
        "string",
        "null"
      ],
      "description": "Null for the genesis block."
    },
    "next_block_hash": {
      "type": [
        "string",
        "null"
      ],
      "description": "Null for the newest block."
    },
    "is_orphan": {
      "type": "boolean"
    },
    "difficulty": {
      "type": "string"
    },
    "merkleroot": {
      "type": "string"
    },
    "reward": {
      "$ref": "#/$defs/Amount",
      "description": "The block subsidy (fees not included)."
    },
    "fees": {
      "$ref": "#/$defs/Amount"
    },
    "min_fee_rate": {
      "type": [
        "integer",
        "null"
      ],
      "description": "The lowest fee rate its transactions paid, rounded up to a whole unit: sat/vB on BTC, lit/vB on LTC, koinu/vB on DOGE, zat/action on ZEC. The coinbase isn't counted; on Litecoin, MWEB's HogEx transaction, peg-ins and transactions spending MWEB coins aren't either. Null for a block with only its coinbase."
    },
    "median_fee_rate": {
      "type": [
        "integer",
        "null"
      ],
      "description": "The median fee rate (with an even count, the lower of the two middle rates), in the same units and with the same exclusions as min_fee_rate."
    },
    "max_fee_rate": {
      "type": [
        "integer",
        "null"
      ],
      "description": "The highest fee rate, in the same units and with the same exclusions as min_fee_rate."
    },
    "min_fee_rate_precise": {
      "type": [
        "string",
        "null"
      ],
      "description": "min_fee_rate to two decimal places, not rounded up (\"0.31\"). Null where not available yet, which includes most blocks mined before 5 October 2026."
    },
    "median_fee_rate_precise": {
      "type": [
        "string",
        "null"
      ],
      "description": "median_fee_rate to two decimal places; null as for min_fee_rate_precise."
    },
    "max_fee_rate_precise": {
      "type": [
        "string",
        "null"
      ],
      "description": "max_fee_rate to two decimal places; null as for min_fee_rate_precise."
    },
    "reward_split": {
      "type": "object",
      "description": "Zcash (ZEC) only: where the reward went. Amounts are decimal strings.",
      "properties": {
        "subsidy": {
          "type": "string"
        },
        "fees": {
          "type": "string"
        },
        "miner_address": {
          "type": "string"
        },
        "miner_transparent": {
          "type": "string"
        },
        "miner_shielded": {
          "type": "string"
        },
        "funding_streams": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "recipient": {
                "type": "string"
              },
              "kind": {
                "type": "string"
              },
              "address": {
                "type": "string"
              },
              "value": {
                "type": "string"
              }
            }
          }
        },
        "lockbox": {
          "type": "string"
        },
        "lockbox_disbursement": {
          "type": "string"
        },
        "unclaimed": {
          "type": "string"
        },
        "nsm_fee_contribution": {
          "type": "string",
          "description": "From the NU7 upgrade (ZEC from block 3,543,405, ZECTEST from 4,465,026): the 60% of fees burned into the NSM reserve; 0 before it."
        }
      }
    },
    "value_out": {
      "$ref": "#/$defs/Amount"
    },
    "bits": {
      "type": "string",
      "description": "Compact target, hex."
    },
    "txs": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Every transaction ID, in block order."
    },
    "price": {
      "anyOf": [
        {
          "$ref": "#/$defs/Price"
        },
        {
          "type": "null"
        }
      ],
      "description": "The price at the time, as Price; null where there's no price: before the network's price history (Bitcoin's starts 13 Jul 2010), or a block stamped ahead of the clock. Testnets: always 0."
    },
    "kinds": {
      "$ref": "#/$defs/BlockKinds"
    },
    "median_time": {
      "type": [
        "integer",
        "null"
      ],
      "description": "The median time of this block and the 10 before it (Unix time); null for an orphaned Zcash block."
    },
    "chainwork": {
      "type": [
        "string",
        "null"
      ],
      "description": "The chain's total expected work up to this block, 64 hex characters; null on ZEC and ZECTEST."
    },
    "stripped_size": {
      "type": [
        "integer",
        "null"
      ],
      "description": "Size without witness data, in bytes; null on DOGE, DOGETEST, ZEC and ZECTEST."
    },
    "mweb": {
      "type": "object",
      "description": "Litecoin only, from MWEB's activation. value_out includes the pool carried over from block to block; subtract pool for the value the block moved.",
      "properties": {
        "pool": {
          "$ref": "#/$defs/Amount"
        },
        "pool_change": {
          "anyOf": [
            {
              "$ref": "#/$defs/Amount"
            },
            {
              "type": "null"
            }
          ]
        },
        "pegin": {
          "$ref": "#/$defs/Amount"
        },
        "pegin_count": {
          "type": "integer"
        },
        "pegout": {
          "$ref": "#/$defs/Amount"
        },
        "pegout_count": {
          "type": "integer"
        },
        "fees": {
          "$ref": "#/$defs/Amount"
        },
        "kernels": {
          "type": [
            "integer",
            "null"
          ]
        }
      }
    },
    "auxpow": {
      "type": [
        "object",
        "null"
      ],
      "description": "Dogecoin (DOGE, DOGETEST), a merge-mined block: the Litecoin block attempt whose proof of work it reuses. null on every other block.",
      "properties": {
        "parent_hash": {
          "type": "string",
          "description": "The parent header's hash: the Litecoin block hash it has, or would have had."
        },
        "parent_prev_hash": {
          "type": "string",
          "description": "The parent header's previous block."
        },
        "parent_chain": {
          "type": [
            "string",
            "null"
          ],
          "description": "LTC (LTCTEST on DOGETEST) when the parent builds on a Litecoin block; null otherwise."
        },
        "parent_in_chain": {
          "type": [
            "boolean",
            "null"
          ],
          "description": "Whether the attempt became a Litecoin block; null until that's known."
        },
        "parent_height": {
          "type": [
            "integer",
            "null"
          ],
          "description": "Its Litecoin height, when parent_in_chain is true."
        }
      }
    }
  },
  "$defs": {
    "Amount": {
      "type": "string",
      "pattern": "^-?[0-9]+\\.[0-9]{8}$",
      "description": "An exact decimal amount of coins with 8 decimals. Signed amounts may start with '-'. Parse as an integer of the smallest unit, not a float."
    },
    "BlockKinds": {
      "type": [
        "object",
        "null"
      ],
      "description": "A block's transactions by kind, each by name. Every transaction counts, under one kind, except the coinbase (and Litecoin's HogEx); a kind with none is left out. null or absent for a block whose kinds aren't known yet. coinjoin, a cooperative lightning_close and a fee_bumped child paying its parent's fee are told by their shape alone: likely, not certain.",
      "properties": {
        "payment": {
          "$ref": "#/$defs/KindTotals",
          "description": "An ordinary payment, and anything that isn't another kind. BTC, LTC, DOGE."
        },
        "batch_payout": {
          "$ref": "#/$defs/KindTotals",
          "description": "One sender paying many at once: exchanges, payroll. BTC, LTC, DOGE."
        },
        "consolidation": {
          "$ref": "#/$defs/KindTotals",
          "description": "Many coins merged into one or two, often while fees are low. BTC, LTC, DOGE."
        },
        "coinjoin": {
          "$ref": "#/$defs/KindTotals",
          "description": "Many people mixing equal amounts. BTC, LTC."
        },
        "inscription": {
          "$ref": "#/$defs/KindTotals",
          "description": "Content, such as an image or text, inscribed on chain: ordinals and Atomicals, and Doginals on Dogecoin. BTC, LTC, DOGE."
        },
        "data": {
          "$ref": "#/$defs/KindTotals",
          "description": "Records in OP_RETURN outputs: timestamps, proofs. BTC, LTC, DOGE."
        },
        "lightning_close": {
          "$ref": "#/$defs/KindTotals",
          "description": "A Lightning channel closing. BTC, LTC."
        },
        "fee_bumped": {
          "$ref": "#/$defs/KindTotals",
          "description": "A replacement paying more to get in sooner, or a child paying its parent's fee. BTC, LTC, DOGE."
        },
        "mweb_peg_in": {
          "$ref": "#/$defs/KindTotals",
          "description": "Coins moving into Litecoin's MWEB extension block. LTC."
        },
        "large_script": {
          "$ref": "#/$defs/KindTotals",
          "description": "A big input script that isn't a multisig spend, usually carrying data. DOGE."
        },
        "transparent": {
          "$ref": "#/$defs/KindTotals",
          "description": "Visible senders, receivers and amounts: no shielded parts. ZEC."
        },
        "shielding": {
          "$ref": "#/$defs/KindTotals",
          "description": "Coins moving from transparent inputs into a shielded pool. ZEC."
        },
        "deshielding": {
          "$ref": "#/$defs/KindTotals",
          "description": "Coins leaving a shielded pool for transparent outputs. ZEC."
        },
        "shielded": {
          "$ref": "#/$defs/KindTotals",
          "description": "Fully private: no transparent inputs or outputs. ZEC."
        },
        "rune": {
          "$ref": "#/$defs/KindTotals",
          "description": "Runes tokens etched, minted or moved: a runestone, or Alkanes; Dunes on Dogecoin. BTC, LTC, DOGE."
        },
        "bridge": {
          "$ref": "#/$defs/KindTotals",
          "description": "Coins crossing to or from another chain: a bridge, or a cross-chain swap. BTC, LTC, DOGE, ZEC."
        },
        "token": {
          "$ref": "#/$defs/KindTotals",
          "description": "Tokens on an older protocol issued or moved: Counterparty, Stamps (SRC-20), Omni; OmniLite on Litecoin. BTC, LTC."
        },
        "staking": {
          "$ref": "#/$defs/KindTotals",
          "description": "Bitcoin staked, unstaked or slashed: Babylon, Core DAO, Stacks stacking. BTC."
        },
        "anchoring": {
          "$ref": "#/$defs/KindTotals",
          "description": "Another chain's checkpoint written into Bitcoin: Stacks block commits, Hemi, Babylon. BTC."
        },
        "other": {
          "$ref": "#/$defs/KindTotals",
          "description": "A kind added later, until it's named here."
        }
      },
      "additionalProperties": {
        "$ref": "#/$defs/KindTotals"
      }
    },
    "KindTotals": {
      "type": "object",
      "required": [
        "num_txs",
        "vsize",
        "fees"
      ],
      "properties": {
        "num_txs": {
          "type": "integer",
          "description": "How many transactions."
        },
        "vsize": {
          "type": "integer",
          "description": "Their virtual size in vbytes (bytes on DOGE and ZEC)."
        },
        "fees": {
          "oneOf": [
            {
              "$ref": "#/$defs/Amount"
            },
            {
              "type": "null"
            }
          ],
          "description": "The fees they paid, in coins; null where they can't be known (as for mweb_peg_in)."
        }
      }
    },
    "Price": {
      "type": "object",
      "required": [
        "value",
        "currency"
      ],
      "description": "Price per coin, 8 decimals: in US dollars, or in the currency asked for. Always 0.00000000 on testnets.",
      "properties": {
        "value": {
          "$ref": "#/$defs/Amount"
        },
        "currency": {
          "type": "string",
          "description": "USD, or the currency asked for."
        }
      }
    }
  }
}