- A mathematical problem that miners compete to complete in POW.
- The complexity of the puzzle depends on
The size of the network
How many users are active
What is the blockchain size
- The cryptographic puzzle is known as a hash puzzle.
This puzzle involves finding a specific value called a NONCE which when combined with the data in the block and passed through a cryptographic hash function, produces a hash that meets certain criteria. - A hash function is a mathematical algorithm that converts an input into a fixed sized string of bites. The output is then known as a hash or digest e.g. SHA 256
- NONCE(number only used once)-is a unique arbitrary number that is added to the block data in blockchain systems using POW.
- The purpose of NONCE is to vary the input to the hash function in order to find a hash value that meets the networks DIFFICULTY TARGETS.
DIFFICULTY TARGETS
- A specific value that a hash of a blocks’ data must meet or be lower than for the block to be accepted by the network. This target ensures that the process of mining a new block remains challenging and controls the rate at which new blocks are added to the blockchain.
HOW DIFFICULTY TARGET WORKS
Setting the Target:
- The blockchain protocol sets a difficulty target, a specific value that the hash of a new block must be less than or equal to for the block to be valid. This target is expressed as a number or as a target hash.
Adjusting the Nonce:
- Miners repeatedly adjust the nonce and hash the block data until they find a hash that meets the difficulty target. This process involves a lot of trial and error and requires substantial computational power.
Finding a Valid Hash:
- When a miner finds a hash that meets the target (i.e., the hash is lower than or equal to the difficulty target), they successfully mine the block. This block is then added to the blockchain, and the miner is rewarded. If not, miner increments the nonce and tries again.
EXAMPLE EXPLAINED.
1.Consider the target 0000000000000000000ffff00000000000000000000000000000000000000000
2.The large number of leading zeros signifies a very low target number, and a low target number means difficulty to find a valid HASH
3.A block hash needs to be less than or equal to this target for the block to be accepted.
4.The presence of many leading zeros means the range of acceptable hash values is very small, increasing the difficulty.
- PRACTICAL EXAMPLE1.Hash Function:
- When a block is mined, the hash function produces a hash like 0000000000000000000abc123def4567890….
2.Comparison:
- The miner checks if this hash is less than the target 0000000000000000000ffff00000000000000000000000000000000000000000.
- If the hash meets this condition, the block is valid and can be added to the blockchain.
DIFFICULTY ADJUSTMENT
- PRACTICAL EXAMPLE1.Hash Function:
- In BTC, the Difficulty target is adjusted approximately after every two weeks that is after every 2016 blocks
- The adjustment is based on the time it took to mine the previous 2016 blocks
- If the blocks mined were mined too quickly, the Difficulty Target increases and if they were mined too slowly, the Difficulty Target decreases.
- High difficultyà Requires more leading zeros in the hash, meaning fewer valid hashes and more computational work to find one.
- Lower difficulty àRequires fewer leading zeros ,meaning more possible valid hashes and less computational work to find one
IN CONCLUSION
- When a miner finds a NONCE that when hashed with the block data, produces a HASH that meets the Difficulty target condition, the NONCE becomes part of the new block.
- This valid block is then broadcast to the network and is added to the block chain, with the miner receiving a reward for their effort.
ENG WANJIKU
Views: 7
What fabulous ideas you have concerning this subject! By the way, check out my website at Webemail24 for content about Website Design.