So, I'm using Bitcoin Core RPC client version v22.0.0
and Bitcoin Core version v22.0.0
.
To get the block with height 1
, I call the API like this:
bitcoin-cli -datadir=/Users/dennis/Bitcoin getblock \
00000000839a8e6886ab5951d76f411475428afc90947ee320161bbf18eb6048 2
You see this block only contains the coinbase
transaction. If you check the vout
section you won't see any address.
"vin": [
{
"coinbase": "04ffff001d0104",
"sequence": 4294967295
}
],
"vout": [
{
"value": 50.00000000,
"n": 0,
"scriptPubKey": {
"asm": "0496b538e853519c726a2c91e61ec11600ae1390813a627c66fb8be7947be63c52da7589379515d4e0a604f8141781e62294721166bf621e73a82cbf2342c858ee OP_CHECKSIG",
"hex": "410496b538e853519c726a2c91e61ec11600ae1390813a627c66fb8be7947be63c52da7589379515d4e0a604f8141781e62294721166bf621e73a82cbf2342c858eeac",
"type": "pubkey"
}
}
]
However, If you make the same call but for a newer block, for example with height 700,000
:
bitcoin-cli -datadir=/Users/dennis/Bitcoin getblock \
0000000000000000000590fc0f3eba193a278534220b2b37e9849e1a770ca959 2
You will see the address of the coinbase
transaction:
"vin": [
{
"coinbase": "0360ae0a2cfabe6d6d078b52bc69cf0982356d3eb439efe5489aee2c74da629dcc1a8b50a309cc0800100000000212030400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000005008a1c0000",
"txinwitness": [
"0000000000000000000000000000000000000000000000000000000000000000"
],
"sequence": 0
}
],
"vout": [
{
"value": 6.40388640,
"n": 0,
"scriptPubKey": {
"asm": "0 f3b2d6544de521b5c617fc83ca6d13854f29a8a5",
"hex": "0014f3b2d6544de521b5c617fc83ca6d13854f29a8a5",
"address": "bc1q7wedv4zdu5smt3shljpu5mgns48jn299mukymc",
"type": "witness_v0_keyhash"
}
},
Questions:
- It is something related to
bitcoin-cli
version? - If so, It's posible to get the
coinbase
address for older blocks building a parser and directly parsingblk000.dat
files? - If it's not possible, how blockchain.com shows the
coinbase
address for all blocks?