Post
Topic
Board Beginners & Help
Re: ★☆ Get Help Here | The Ultimate Help Thread! | Free WoodWallet Giveaways! ★☆
by
DannyHamilton
on 10/06/2014, 16:49:08 UTC
Bump you up.
What does the the block header look like before and after hashing?

The block header is between 81 and 88 bytes of data.

Before every block header in the blockchain is a 4 byte network ID (in the case of bitcoin this will be 0xD9B4BEF9) and 4 bytes used to indicate the length of the block (in bytes).

The actual block header starts with a 4 byte version number.

Next is the 32 byte hash of the previous block (since each block has a reference to a previous block, they form a chain).

After that is the 32 byte merkle root calculated from the list of previously unconfirmed transactions that the block will include.

That is followed by a 4 byte timestamp, and 4 bytes indicating the current mining difficulty.

The next 4 bytes are the nonce that the miners increment while trying to solve the block.

Finally there is a variable sized integer (anywhere from 1 to 8 bytes) used to indicate the total number of transactions in the block.

For more information, see here:
https://en.bitcoin.it/wiki/Protocol_specification#Block_Headers

and here:
http://james.lab6.com/2012/01/12/bitcoin-285-bytes-that-changed-the-world/

When a node hashes the block to determine if it is "solved", the result of the hash is a 32 byte number.  That number is checked to see if it satisfies the proper difficulty for the block.