sha256 – How can I hash a block header utilizing bitcoin-cli and terminal instructions?

on

|

views

and

comments


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?

Share this
Tags

Must-read

Waymo raises $16bn to gas international robotaxi enlargement | Know-how

Self-driving automobile firm Waymo on Monday stated it raised $16bn in a funding spherical that valued the Alphabet subsidiary at $126bn.Waymo co-chief executives...

Self-driving taxis are coming to London – ought to we be anxious? | Jack Stilgoe

At the top of the nineteenth century, the world’s main cities had an issue. The streets had been flooded with manure, the unintended...

US regulators open inquiry into Waymo self-driving automobile that struck youngster in California | Expertise

The US’s federal transportation regulator stated Thursday it had opened an investigation after a Waymo self-driving car struck a toddler close to an...

Recent articles

More like this

LEAVE A REPLY

Please enter your comment!
Please enter your name here