Bitcoin Mining – How does it work?

TL;DR

It is the process of confirming bitcoin transactions and updating the bitcoin ledger. Those who confirm the transactions get bitcoin as a reward for their effort and time.


What is mining?

(If you wish to understand what bitcoin is before reading this article please click here)

Bitcoin is a decentralised digital currency. 

And mining is a process essential for decentralisation.

In a bank transfer, the bank validates the transaction. They update their records (ledgers) with transaction details.

But in bitcoin transactions there is no need of a central intermediary to update the ledger.

Instead of having the ledger with a central entity like a bank, multiple copies of the ledger are made available to participants in the Bitcoin network. The participants can get access to a copy of the entire ledger and update it by following a series of steps.

This process of confirming the transaction and updating the shared public ledger is known as Mining.

Those who update the ledger are known as Miners.


How does it work?

 
1. Selecting transactions for validation

The public Bitcoin ledger is a blockchain. It is a chain of blocks which has the details of the confirmed transactions. 

When a transaction is initiated in the bitcoin network, it waits along with other unconfirmed transactions in a waiting area known as mempool.

When a transaction is initiated in the bitcoin network, it waits along with other unconfirmed transactions in a waiting area known as mempool.

Miners then pick a few of the unconfirmed transactions and assemble them in a block to confirm them. 

Miners use a local copy of the public bitcoin blockchain in which they can add this block.


2. Adding the block of transactions into the blockchain

To add the block of transactions, miners have to solve a complex puzzle generated by the system.

This mechanism is known as Proof of Work (PoW).

The puzzles are mathematical equations which are hard to solve but easy to verify. For example a Rubik’s cube is hard to solve. But once it is solved you can easily verify if the solution is correct or not. 

Miners use sophisticated computers to guess the solution. 

3. Validating the updated blockchain is not tampered with

After adding the new block, The miner broadcasts a copy of the updated blockchain in the network so that other miners can verify it.

This verification by other miners makes bitcoin immutable. Manipulating the ledger is difficult as the copy is available to everyone participating in the network. Other miners in the network also update their copy of the record by solving the puzzle. If any record is tampered, there will be a mismatch in the records of other miners in the network.

The verified local blockchain of the miner now becomes the public bitcoin blockchain.

Other miners use a copy of this updated public blockchain for confirming the next set of transactions.


Tamper proofing the mining process

To ensure powerful computers do not tamper with mining, the difficulty of the process is adjusted real-time.

The complexity of the math equation is proportional to the mining power of the network. 

If more miners join the network the difficulty of the equation increases.

Earlier it was possible to update the ledger using personal computers. But nowadays as more and more people are using bitcoin, powerful computers are needed to update the ledger.


What is in it for the miners?

The first miner who solves the puzzle gets bitcoin reward per block added to the blockchain as a compensation for their time and effort.

The current reward per block is 6.25 bitcoin. 

Miners also get any transaction fee associated with that particular transaction. Miners mostly pick transactions with higher transactions fee for verifying them.

Wow free bitcoin! So why don’t everyone become miners?

There is a significant cost involved in mining as powerful computers are needed. Cost of both setting up the computer and the energy bill due to running it is high. 

So before becoming a miner, you need to calculate if the rewards will be higher than the costs involved.

Other Reads


If you liked this article, please subscribe to get similar free articles making crypto understandable right in your inbox.