Bitcoin Mining is the process of creating and writing new blocks for the blockchain. These blocks have to comply with the base Bitcoin rules, maintained by the network.
In order to mine, you would need specialized mining software and hardware, which you can learn about on the previous page of this guide. Here we will focus on the process of Bitcoin Mining to explain what is happening, and why it works.
For miners, it all starts with the most recent block registered on the blockchain. To begin the mining process, they need to copy its hash. Beyond this hash, they also acquire a block of validated transactions created by full nodes across the network and begin their work on the proof of work. Proof of work is a correct SHA256 hash.
In order to find a correct hash, miners take a look at the network difficulty for the current batch of 2016 blocks. This difficulty is the deciding factor in the hashing process, which determines how difficult the hash must be in order for it to be accepted by the network. As an end product the hash requirements set by the network only accept hashes starting with a specific number of zeroes “0” before other characters in the 64 character hash.
The hashing process takes a while, but as soon as one correct hash has been discovered, the block is bundled and broadcast to the network. The network reevaluates and all miners rehash the block with the specific nonce they’ve received from the initial finder of the hash. They all reach the same conclusion, that the hash is correct and the mining process for this block is concluded.
The mining reward, together with the fees for transactions are given to the miner from which the correct hash originated.
As this happens, the new block is accepted by the network and the transactions will forever be etched in the blockchain. After this validation, miners carry on to repeat the process.
Miners retrieve the latest block (the one that we just finished) copy over the hash and transaction data from the full nodes and they start mining for a new hash for this next block.
Creating this proof of work (POW) is an energy intensive process that takes up a lot of computing power and time, as well as electricity. All of the miners are working on the same block at any given moment, and they are compiling the same information. Except for the “nonce”, as this is an arbitrary number that is changed in order to eventually discover a viable hash.
This process deeply secures transactions in the network and essentially disables any party the possibility to change transactional history. Although this is theoretically possible, such would be attackers would have to overpower the entirety of the legitimate miner network and bring incredible amounts of hashing power to the table.
In summary, the process goes like this:
- Check latest block header hash
- Receive latest transaction block
- Evaluate network difficulty
- Hashing for correct POW
- Finding the correct POW
- Broadcast “nonce” to the network
- Network validates the hash
- Mining reward and fees are released
- Process starts over