I want to hash a block header utilizing terminal instructions and have a look at all the beautiful main 0s, however I am unable to work out how to do that accurately utilizing block header information from bitcoin-cli.
Here’s what I attempted:
# get the block header of a current block and write it to # get the block header of a current block and write it to blockheader.txt
$ bitcoin-cli getblockheader 0000000000000000000493a92e28a9f9402cef0ff3f953aeca17b506700dfaf9 false > blockheader.txt
# hash it twice
$ sha256sum blockheader.txt > hash1.txt
$ sha256sum hash1.txt
abcaf9cb4c4ea594cdaf330f143f8d5e31fd0539540906149ab0e3d706b7d053 hash1.txt
As you may see, the output doesn’t match the blockhash enter within the first command. What am I doing mistaken?
