The first command returns the hash for block #0 (genesis bock):
$ bitcoin-cli getblockhash 0
000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f

The second command should end with the number 2 for max verbosity (not 22) and returns the the block corresponding to that hash:
$ bitcoin-cli getblock 000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f 2
{ "hash": "000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f", "confirmations": 704426, "height": 0, [...] "tx": [ { "txid": "4a5e1e4baab89f3a32518a88c31bc87f618f76673e2cc77ab2127b7afdeda33b", "hash": "4a5e1e4baab89f3a32518a88c31bc87f618f76673e2cc77ab2127b7afdeda33b", [...] "vin": [ { "coinbase": "04ffff001d0104455468652054696d65732030332f4a616e2f32303039204368616e63656c6c6f72206f6e206272696e6b206f66207365636f6e64206261696c6f757420666f722062616e6b73", "sequence": 4294967295 } ], "vout": [ { "value": 50.00000000, "n": 0, [...] } ], [...] } ] }

The third command converts the coinbase for that block from hex to ascii
$ echo 04ffff001d0104455468652054696d65732030332f4a616e2f32303039204368616e63656c6c6f72206f6e206272696e6b206f66207365636f6e64206261696c6f757420666f722062616e6b73 | xxd -r -p
EThe Times 03/Jan/2009 Chancellor on brink of second bailout for banks

Provided you have jq installed you can do it all at once, for any block for example:
$ bitcoin-cli getblock "$(bitcoin-cli getblockhash 704429)" 2 | jq -r '.tx[].vin[].coinbase' | xxd -r -p
,mm429`=UC+3Rݭvh?🐟F2Pool/
reply
Thanks for the breakdown. The OPs post would have been better had he done that and he may very well have spotted the '22' typo. Not that I think that it made any difference to the output, but it is (as your post points out) none the less an error that should not be there.
reply
Why not both? :) I just streamed some sats to the OP too... maybe we should get them here...
reply