Websites like blockchain.info and btc.com give Relayed By information to find who found the block. I can see coinbase text in the website https://coin.dance/blocks. Is it possible to get that information using bitcoin-cli ?
1 Answer
Certainly. Use bitcoin-cli getblock <hash> 2
to get the full details of a block (you may want to pipe the output to less
as there will be a lot of output). The first transaction in the block (the first transaction in the array tx
) is the coinbase transaction. In there, there is a field labeled coinbase
. That contains the hex of the bytes of whatever data miners are putting there in the transaction. Drop the hex into whatever Hex to Ascii converter you want and you will get text. Note that some miners may not include readable text in their coinbases.