The mining algorithm consists of the following steps.
The previous block’s header is retrieved from the bitcoin network.
Step-by-Step From Transaction to Block Reward
Assemble a set of transactions broadcasted on the network into a block to be proposed.
Compute the double hash of the previous block’s header combined with a nonce and the newly proposed block using the SHA-256 algorithm.
Check if the resultant hash is lower than the current difficulty level (target) then PoW is solved.
As a result of successful PoW the discovered block is broadcasted to the network and miners fetch the reward.
If the resultant hash is not less than the current difficulty level (target), then repeat the process after incrementing the nonce.
As the hash rate of the bitcoin network increased, the total amount of 32-bit nonce was exhausted too quickly.
Why This Matters for Blockchain Technology
In order to address this issue, the extra nonce solution was implemented, whereby the coinbase transaction is used as a source of extra nonce to provide a larger range of nonce to be searched by the miners.
This process can be visualized by using the following flowchart: Mining process Mining difficulty increased over time and bitcoins that could be mined by single CPU laptop computers now require dedicated mining centers to solve the hash puzzle.
The current difficulty level can be queried using the Bitcoin command-line interface using the following command: $ bitcoin-cli getdifficulty This number represents the difficulty level of the Bitcoin network.
Recall from previous sections that miners compete to find a solution to a problem.
Key Points to Remember
- The mining algorithm The mining algorithm consists of the following steps.
- The previous block’s header is retrieved from the bitcoin network.
- Assemble a set of transactions broadcasted on the network into a block to be proposed.
- Compute the double hash of the previous block’s header combined with a nonce and the newly proposed block using the SHA-256 algorithm.
Going Deeper: Advanced Concepts
This number, in fact shows, that how difficult it is to find a hash which is lower than the network difficulty target.
All successfully mined blocks must contain a hash that is less than this target number.
This number is updated every 2 weeks or 2016 blocks to ensure that on average 10-minute block generation time is maintained.
Bitcoin network difficulty has increased exponentially, the following graph shows this difficulty level over a period of one year:
Conclusion
The mining algorithm represents one of the many innovative layers that make blockchain technology so powerful and transformative. As distributed systems continue to evolve, a solid understanding of these core concepts becomes increasingly valuable — not just for developers, but for anyone building, investing in, or working alongside blockchain-powered systems.
Whether you are just starting your blockchain journey or deepening existing expertise, mastering these fundamentals gives you the tools to think clearly about decentralized systems and make smarter decisions in this rapidly evolving space.