Overview:
Often we hear that miners have to solve a difficult mathematical puzzle to add a new block to existing blockchain. Now the question is - what is this mathematical puzzle and how difficult it is.
Let us understand this in context of Bitcoin mining.
The Mathematical Puzzle:
A Bitcoin block basically consists of block header, a number of recent verified transactions and other details. The block header contains following fields:
Field | Purpose | Size (Bytes) |
Version | Block version number | 4 |
hashPrevBlock | 256-bit hash of the previous block header | 32 |
hashMerkleRoot | 256-bit hash based on all of the transactions in the block | 32 |
Time | Current timestamp as seconds since 1970-01-01T00:00 UTC | 4 |
Bits | Current target in compact format | 4 |
Nonce | 32-bit number (starts at 0) | 4 |
Here the Bits field is a target or threshold value. All one has to do is to find a Nonce for which the hash of the block header is less than or equal to the threshold value.
What is Block Hash:
It is an output of hashcash algorithm which takes a service string,
How to solve:
The miner has to produce a Nonce for which the hash of the block which is basically the hash of the block header is is less than or equal to the target. This is basically a guessing game. There is no way one can deduce the nonce analytically. Every possibility of the nonce has be tried until you get the required hash. This is where you need computational power The more computational power you have the chances of finding a nonce before everyone else is more.
Comments
Post a Comment