Why is mining required to create a blockchain?

Whenever we hear about the word “blockchain”, the word “mining” also sticks with it. Although some of us might have understood the concept of mining in blockchain in general, we might have failed to understand the primary focus of mining.

Mining term in cryptocurrency has been misleading by the comparison with general “mining”, which means extracting precious metals. So, our attention goes to the reward part of the mining in cryptocurrency, where the miner is rewarded with the currency as an incentive. Although miners have been attracted by the notion of getting rewarded, this is not the sole purpose of mining in the blockchain.

Mining is the mechanism which underpins the decentralization concept of the blockchain. It is the invention which made the Bitcoin’s P2P concept a practically implementable. Let’s come to the point of clarifying “what is the main motive behind this concept in the original implementation of Bitcoin ?” — It is the validation of the transactions and block creation in which it plays a major role and thus, contributing to the immutability of the blockchain. Yes, immutability in blockchain is also achieved by miners by means of economic mechanism. In the case of bitcoin, Proof-of-Work (PoW) is used as the mechanism to achieve both decentralized consensus and immutability of the blockchain.

Although several different mechanisms have been implemented by other cryptocurrencies and blockchain applications, Bitcoin’s original PoW consensus algorithm is still widely used due to its contribution to the immutability of the blockchain. So, let us focus on the PoW consensus and how it helps in achieving the immutability.

Now we know that mining nodes play a major role in validating the transaction and creating a new block by providing a Proof Of Work. But, we are really interested in the PoW done by the mining node. Because this consensus algorithm overcomes most of the vulnerabilities exposed by the traditional cryptocurrencies. PoW is a proof given by the miner that he has done some work by solving a difficult high computation problem. This way, he competes with other mining nodes to extend the blockchain. Bitcoin uses SHA256 hashing algorithm for PoW. Mining node has to compute the hash of block header by changing a nonce value repeatedly. Whenever miner finds a hash value which matches the target value, he will create the block with that nonce value.

The difficulty of solving the hashing puzzle is adjusted so that uniform block creation time is maintained (10 mins in Bitcoin). This ensures that the blockchain is really immutable since an average of 10 mins is required to build a block and an attacker trying to change any of the previous blocks would mean all the successive blocks should be mined all over again. It is theoretically impossible for attacker mine all the blocks again and prove the world that his chain is the legitimate chain.

To conclude, mining is not about just earning the reward, but it has much more to contribute to the blockchain protocol. It contributes to the highest degree by achieving immutability of the blockchain by using an economic mechanism such as PoW consensus algorithm.