What is the target hash?
For cryptocurrencies there are different forms of mining. For proof of work systems the miners are all trying to find the target hash for each block. It is a numeric value that the current block header needs to be less than or equal to. When a miner finds a target hash the successful miner will be rewarded with tokens – for bitcoin these tokens are bitcoins and is also commonly referred to as the block reward.
It’s also important to keep in mind that even though the target hash looks like an alphanumerical string it is actually a number in hexadecimal form.
What makes up the target hash?
The target hash is a result of the hash of the current block header. The block header usually includes these properties:
- The previous block hash – This is the resulting hash from the previous mined block and is therefore a link from the current block to its parent.
- Block version number – The version number is usually used for network softfork upgrades.
- Merkle Root hash – The hash of all the transaction hashes that are part of the block.
- Nonce – An arbitrary number that when hashed together with the rest of the content in the block header results in a hash that meets the requirements for the target hash.
- Timestamp – A unix timestamp. Accepted as valid if it is greater than the median timestamp of previous 11 blocks and less than the network-adjusted time + 2 hours.
- Target nBits – This property is an encoded version of the target hash that the current blocks hash needs to be less than or equal to.
Bitcoin uses a 256-bit number for its target hash. To find the target hash miners around the world will be competing each other in a race to find a correct nonce that together with the rest of the block header will result in a hash that meets the target hash requirements.
As more miners in the network compete the collective mining (guessing) power will increase. To ensure that the block time is kept at a predetermined interval the target hash will be adjusted periodically based on the collective mining power.