I am learning about Bitcoin mining but having trouble understanding what are the exact input values for the SHA256 function and looking for some help.
What I Think I Know
The Proof of Work is guessing a number (Nonce) that, when added to the end of the block header and hashed twice using SHA256, results in a number smaller than the Difficulty.
Once a block is mined, the Proof of Work is verified by other nodes by hashing the block header twice using SHA256 and checking the value is smaller than the Difficulty.
The block header (before being hashed), consists of the following:
Version + Previous Block Hash + Merkle Root + Timestamp + Difficulty + Nonce
What I’m Confused About
I would like to verify a mined block, but I don’t understand how to put together the block header.
Previous Hash: 0000000000000002a7bbd25a417c0374cc55261021e8a9ca74442b01284f0569
Merkle Root: c91c008c26e50763e9f548bb8b2fc323735f73577effbc55502c51eb4cc7cf2e
Timestamp: 2013-12-27 18:11
Block Hash: 0000000000000001b6b9a13b095e96db41c4a928b97ef2d944a9b31b2cc7bdc4
I don’t get what format all the parts of the block header need to be to create the block hash successfully. I’ve also heard that the previous hash and Merkle Root need to be reversed?
Can someone break down what the correct block header input to SHA256(SHA256()) for Block 277316 is?