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.
0bitcoin rpc help getblock
1
2getblock "blockhash" ( verbosity )
3
4If verbosity is 0, returns a string that is serialized, hex-encoded data for block 'hash'.
5If verbosity is 1, returns an Object with information about block <hash>.
6If verbosity is 2, returns an Object with information about block <hash> and information about each transaction.
7...
8Result (for verbosity = 1):
9{ (json object)
10 "hash" : "hex", (string) the block hash (same as provided)
11 "confirmations" : n, (numeric) The number of confirmations, or -1 if the block is not on the main chain
12 "size" : n, (numeric) The block size
13 "strippedsize" : n, (numeric) The block size excluding witness data
14 "weight" : n, (numeric) The block weight as defined in BIP 141
15 "coinbase_tx" : { (json object) Coinbase transaction metadata
16 "version" : n, (numeric) The coinbase transaction version
17 "locktime" : n, (numeric) The coinbase transaction's locktime (nLockTime)
18 "sequence" : n, (numeric) The coinbase input's sequence number (nSequence)
19 "coinbase" : "hex", (string) The coinbase input's script
20 "witness" : "hex" (string, optional) The coinbase input's first (and only) witness stack element, if present
21 },
22 "height" : n, (numeric) The block height or index
23 "version" : n, (numeric) The block version
24...
0bitcoin rpc getblock 000000000000000000013c986f9aebe800a78454c835ccd07ecae2650bfad3f6 1
0{
1 "hash": "000000000000000000013c986f9aebe800a78454c835ccd07ecae2650bfad3f6",
2 "confirmations": 2,
3 "height": 935113,
4 "version": 561807360,
5 "...": "...",
6 "weight": 3993624,
7 "coinbase_tx": {
8 "version": 2,
9 "locktime": 0,
10 "sequence": 4294967295,
11 "coinbase": "03c9440e04307c84692f466f756e6472792055534120506f6f6c202364726f70676f6c642ffabe6d6d9a8624235259d3680c972b0dd42fa3fe1c45c5e5ae5a96fe10c182bda17080e70100000000000000184b17d3f138020000000000",
12 "witness": "0000000000000000000000000000000000000000000000000000000000000000"
13 },
14 "tx": [
15 "70eb053340c7978c5aa1b34d75e1ba9f9d1879c09896317f306f30c243536b62",
16 "5bcf8ed2900cb70721e808b8977898e47f2c9001fcee83c3ccd29e51c7775dcd",
17 "3f1991771aef846d7bb379d2931cccc04e8421a630ec9f52d22449d028d2e7f4",
18 "..."
19 ]
20}