Files
bitcoin/doc
merge-script 37e449dcc7 Merge bitcoin/bitcoin#34512: rpc: add coinbase_tx field to getblock
e0463b4e8c rpc: add coinbase_tx field to getblock (Sjors Provoost)

Pull request description:

  This adds a `coinbase_tx` field to the `getblock` RPC result, starting at verbosity level 1. It contains only fields guaranteed to be small, i.e. not the outputs.

  Initial motivation for this was to more efficiently scan for BIP54 compliance. Without this change, it requires verbosity level 2 to get the coinbase, which makes such scan very slow. See https://github.com/bitcoin-inquisition/bitcoin/pull/99#issuecomment-3852370506.

  Adding these fields should be useful in general though and hardly makes the verbosity 1 result longer.

  ```
  bitcoin rpc help getblock

  getblock "blockhash" ( verbosity )

  If verbosity is 0, returns a string that is serialized, hex-encoded data for block 'hash'.
  If verbosity is 1, returns an Object with information about block <hash>.
  If verbosity is 2, returns an Object with information about block <hash> and information about each transaction.
  ...
  Result (for verbosity = 1):
  {                                 (json object)
    "hash" : "hex",                 (string) the block hash (same as provided)
    "confirmations" : n,            (numeric) The number of confirmations, or -1 if the block is not on the main chain
    "size" : n,                     (numeric) The block size
    "strippedsize" : n,             (numeric) The block size excluding witness data
    "weight" : n,                   (numeric) The block weight as defined in BIP 141
    "coinbase_tx" : {               (json object) Coinbase transaction metadata
      "version" : n,                (numeric) The coinbase transaction version
      "locktime" : n,               (numeric) The coinbase transaction's locktime (nLockTime)
      "sequence" : n,               (numeric) The coinbase input's sequence number (nSequence)
      "coinbase" : "hex",         (string) The coinbase input's script
      "witness" : "hex"             (string, optional) The coinbase input's first (and only) witness stack element, if present
    },
    "height" : n,                   (numeric) The block height or index
    "version" : n,                  (numeric) The block version
  ...
  ```

  ```
  bitcoin rpc getblock 000000000000000000013c986f9aebe800a78454c835ccd07ecae2650bfad3f6 1
  ```

  ```json
  {
    "hash": "000000000000000000013c986f9aebe800a78454c835ccd07ecae2650bfad3f6",
    "confirmations": 2,
    "height": 935113,
    "version": 561807360,
    "...": "...",
    "weight": 3993624,
    "coinbase_tx": {
      "version": 2,
      "locktime": 0,
      "sequence": 4294967295,
      "coinbase": "03c9440e04307c84692f466f756e6472792055534120506f6f6c202364726f70676f6c642ffabe6d6d9a8624235259d3680c972b0dd42fa3fe1c45c5e5ae5a96fe10c182bda17080e70100000000000000184b17d3f138020000000000",
      "witness": "0000000000000000000000000000000000000000000000000000000000000000"
    },
    "tx": [
      "70eb053340c7978c5aa1b34d75e1ba9f9d1879c09896317f306f30c243536b62",
      "5bcf8ed2900cb70721e808b8977898e47f2c9001fcee83c3ccd29e51c7775dcd",
      "3f1991771aef846d7bb379d2931cccc04e8421a630ec9f52d22449d028d2e7f4",
      "..."
    ]
  }
  ```

ACKs for top commit:
  sedited:
    Re-ACK e0463b4e8c
  darosior:
    re-utACK e0463b4e8c

Tree-SHA512: 1b3e7111e6a0edffde8619c49b3e9bca833c8e90e416defc66811bd56dd00d45b69a84c8fd9715508f4e6515f77ac4fb5c59868ab997ae111017c78c05b74ba3
2026-02-19 20:31:33 +01:00
..
2025-12-27 22:33:23 +01:00
2025-11-15 13:11:49 +00:00
2026-02-13 10:52:28 +01:00

Bitcoin Core

Setup

Bitcoin Core is the original Bitcoin client and it builds the backbone of the network. It downloads and, by default, stores the entire history of Bitcoin transactions, which requires several hundred gigabytes or more of disk space. Depending on the speed of your computer and network connection, the synchronization process can take anywhere from a few hours to several days or more.

To download Bitcoin Core, visit bitcoincore.org.

Running

The following are some helpful notes on how to run Bitcoin Core on your native platform.

Unix

Unpack the files into a directory and run:

  • bin/bitcoin-qt (GUI) or
  • bin/bitcoind (headless)
  • bin/bitcoin (wrapper command)

The bitcoin command supports subcommands like bitcoin gui, bitcoin node, and bitcoin rpc exposing different functionality. Subcommands can be listed with bitcoin help.

Windows

Unpack the files into a directory, and then run bitcoin-qt.exe.

macOS

Drag Bitcoin Core to your applications folder, and then run Bitcoin Core.

Need Help?

Building

The following are developer notes on how to build Bitcoin Core on your native platform. They are not complete guides, but include notes on the necessary libraries, compile flags, etc.

Development

The Bitcoin repo's root README contains relevant information on the development process and automated testing.

Resources

Miscellaneous

License

Distributed under the MIT software license.