Understanding Blockchain Mining & Miners

Understanding Blockchain Mining & Miners

With respect to the Ethereum Blockchain

Before getting an idea of how mining occurs, first, let's see what mining really is

Mining is an important process, in the creation of new blocks in the Ethereum blockchain, it mainly serves 2 purposes:

  • Adding transactions to the blockchain

  • Maintaining network security

Earlier, Ethereum relied on a Proof-of-Work (PoW) consensus mechanism, which depended on mining. But, after the Ethereum Merge in September 2022, the network transitioned to a Proof-of-Stake (PoS) consensus mechanism.

We'll discuss POW & POS in the next blog.

Importance of Miners' existence

Mining is not simply adding new coins or writing down new transactions, as most people think. One of the main works of miners is- maintaining consensus.

Consensus means an opinion that is agreed upon by a group of people.

In decentralized systems like Ethereum, we need to ensure that everyone in the world agrees on the ordering of transactions.

Maintaining consensus on transaction orders is crucial to prevent double-spending and guarantee the validity of transactions.

Let us take an example

If Alice sent 1 ETH to Bob and Bob sent 1 ETH to Charlie. The order of transactions should be:

Alice => Bob 1 ETH

Bob => Charlie 1 ETH

Simple.

Any other transaction order will not work, and everyone must agree to this.

Miners, therefore, validate cryptocurrency transactions, add them to the blockchain ledger, and produce certificates of legitimacy for their proposed blocks.

Why one would like to become a miner?

Just like in physical currency, when someone executes a transaction, the state of the blockchain should be updated according to the transaction that happened.

With this, miners are responsible to validate all transactions and produce a certificate of legitimacy, which implies that the transactions are valid. Producing these certificates is computationally very hard. This is what Proof Of Work is all about.

Now, like every work has some benefits, monetary mostly. Miners too enjoy these benefits. With their hard work in producing certificates and executing transactions, they are rewarded with new coins.

In the case of Ethereum, miners receive 2 ETH for successfully mining a block. The mining reward acts as an incentive for miners to participate in the transaction validation process.

Since decentralized systems lack a central authority, the mining process is extremely crucial to the safety and validity of the network. Therefore, the mining reward acts as an incentive to participate in the transaction validation process.

How can you become a miner? Valid question.

Technically, anyone can become a miner on Ethereum by running the Ethereum node software. But, profitable mining will require special hardware.

Average computers are unlikely to generate sufficient rewards to cover the associated costs.

Cost Of Mining:

  • Costs of hardware necessary to build and maintain the hardware

  • Electrical costs of powering the mining rig

  • The potential cost of equipment to support the mining rig (coolers, ventilators, energy monitors, electrical wiring, solar farms, etc.)

It is not always highly profitable to be a miner, and profitability can fluctuate over time.

If you are curious to explore mining profitability, use this calculator

Ethereum Mining Step-by-Step

Here we will see the steps involved in the mining process.

  • When a user signs a transaction request, the transaction request is broadcasted to the Ethereum network through a node.

  • When nodes get to know that a new transaction just happened, each node in the network adds the transaction to their local mempool (memory pool).

The mempool is a list of transactions that nodes have heard about but have not yet been included as part of a block

  • The miners then group these transactions into a block (this is not the final block yet), in a way to maximize the transaction fees they earn while staying under the block gas limits.

  • Then few actions happen:

    • Miner verifies each transaction's validity, checking that no one is trying to transfer either they don't own, or that the signature is valid.

    • Miner then executes it in their own local copy of EVM (Ethereum Virtual Machine). It awards the transaction fees for each such request to its own account.

    • The MIner then creates the Proof-Of-Work certificate for the entire block.

  • So, miners finish producing the certificate of legitimacy for the block, which includes the user's transaction.

  • The miner then broadcasts the block to the world, including the certificate and new state information for the blockchain.

  • This information reaches other nodes, they verify the certificate, execute all the transactions in the block on their local copies of EVM and verify that their EVM state matches the one proposed by the miner.

  • After this verification, the block is added to the blockchain node and this EVM state becomes the current state of the blockchain.

  • Nodes then remove the transactions included within the block from their local mempool.

The above keeps on repeating...

Conclusion

This knowledge is enough for you to start exploring yourself.

Here are some of the resources:

What is Ethereum mining?

Ethereum mining Calculator

Don't forget to search more about the topic and get into the deep of mining process.

Thanks for reading!
Keep Learning 🫡

Did you find this article valuable?

Support Agrim Sharma by becoming a sponsor. Any amount is appreciated!