Logo

Blockchain Ecosystem

Mining and Validating

Miners are essential players of the blockchain. Guarantors of the security of the network, they are responsible for validating crypto transactions before entering them into the blocks.

 6 min

Jump to


In the world of traditional banking, banks act as guarantors of transactions. Each expenditure passes through centralized bodies that take care of the management and validation of transactions. This centralized market has had disastrous consequences for the lives of many for the benefit of a very small group of individuals because banks have taken advantage of the trust of their users. Having abused their position many times in the past, the trust placed in them has been badly damaged leaving many to seek alternatives.

What Problem Does Mining Respond to?

In order to prevent individual entities from holding too much control over the management of banking transactions, the validation of crypto transactions was designed to reduce the amount of trust granted to any single validator (miners, delegates, etc.).

Miners are one of the essential components for a crypto to function properly. Guarantors of the security of the network, they are the ones responsible for validating the transactions before entering them in the blocks. Depending on the consensus (‘Proof of Work’, ‘Proof of Stake’, etc.), their task will differ, but before going into the details, it is important to discuss theory.

To explain the issue of establishing a common strategy (consensus) between several parties who do not trust each other (miners) yet need to validate the veracity of very important information (a transaction), the metaphor of the ‘Byzantine Generals’ Problem’ is often used.

A Consensus Issue: The Byzantine G
A Consensus Issue: The Byzantine Generals Problem

In the image above, three armies want to conquer the castle in the middle. A problem quickly emerges: if one of the three armies attacks alone, it will be severely weakened by the attack on the castle and one of the other armies may gain the upper hand later.

Two of the armies decide to make an alliance. But a new problem arises: When to attack? A castle spy can slip among the messengers tasked with passing information on to the other army and falsifying information that could disrupt the well-oiled plan.

There are two known solutions to this problem:

  • Transmit the information orally to a large number of messengers so that more than the majority of messengers are able to transmit the correct information.
  • Transmit the information in writing to several messengers provided that the writing is not falsifiable.

In the world of blockchain, these two solutions blend with other methods to ensure the best possible accuracy of the information, most often in a transparent and public manner. Even if the verification method may change depending on the consensus between the parties, the purpose remains the same: to have a majority of validators who report the same information to be entered on the blockchain.

What is Crypto Mining?

As we have seen previously, mining depends on the chosen consensus. Some forms are very energy-intensive but allow better decentralization while others will favor greater centralization to ensure greater speed of transactions but are more disadvantageous in terms of security.

Sending A Transaction

If I want to send 2 ETH to Jess, several steps will have to be taken:

  1. I will ‘declare’ my intention publicly by signing it with my private key.
  2. The nodes, which have the history of the blockchain, will check that I have the 2 ETH in my wallet so that the transaction can be sent.
  3. Miners will select my transaction if the fees are sufficient.
  4. They will validate that the transaction exists by solving complex mathematical equations.
  5. Once the majority of miners agree on the solving of the math equations, the transaction is entered in a new block.
  6. The information contained in this block is synchronized with all the nodes of the network.
  7. Jess receives the 2 ETH I sent her.

Miners, therefore, participate in three stages of the transaction sending process: Choosing a transaction, validating it, and entering it in a new block. Everything else is automated in code already written on the blockchain.

Finding A New Block

In this process, the transaction is written in a new block.  According to the blockchain, new blocks are issued over a defined amount of time (every 10 minutes for Bitcoin, every 13 seconds for Ethereum…) and contain a reward that awaits the miners who ‘found’ the block first!

In 2009, this reward was 50 BTC for each new block found. In 2021, the reward was 6.25 BTC. Bitcoin uses a method called ‘halving’ which halves the rewards for every 210,000 blocks mined. And once all blocks have been issued (scheduled for 2140), there will be no more block rewards for miners when a new block is discovered.

For Ethereum, its creators rightly believed it would not necessarily become scarce in the future thanks to its versatility. As a result, the reward per new block found has been adjusted several times over its history and will be further changed in coming updates to the blockchain (ETH2).

This reward attracts envy and the miners fiercely compete to determine who will succeed in being the first to solve the mathematical equation contained in the new blocks. Naturally, the miners will contribute more and more computing power to solve the equations, but the more computing power there is, the more the algorithm that generates the equations will take this increase into account and the more complex the equations will become.

This balance between the computing power required to find new blocks and the generation of the complexity of the equations to be solved is called ‘mining difficulty’.

Mining Difficulty

At the start of any blockchain using ‘Proof of Work’, the initial mining difficulty is relatively low because little computing power is allocated to find new blocks or validate transactions. If a blockchain is successful, then it will attract an increasing number of miners who want to participate in securing the network. This will expand the computing power and in turn the mining difficulty.

Although theoretical, it is possible for a human to solve this equation by hand; using a computer is just far faster and more efficient. In the beginning, a simple microprocessor was enough to mine Bitcoin, but as the difficulty increased, miners made a transition to systems with more powerful graphics card processors. Since 2012, miners have started using chips designed specifically to solve the equations generated by the encryption algorithm: Application-Specific Integrated Circuit (ASIC).

To further increase the probability of receiving a reward, miners began to pool their computing power in order to form ‘mining pools’ which then distribute the block rewards and transaction fees between parties. The rewards are proportional to the computing power a party contributed to the pool.

Some blockchains like Monero have implemented a hard fork preventing ASICs from mining the blocks. This ensures that the mining is always done by microprocessors and prevents large companies holding ASIC farms from pocketing the majority of the rewards.

Double-Spending Through A “51% Attack”

We have seen previously that in order to achieve consensus, it is essential that a supermajority of nodes provide the same information. What happens if this majority reports corrupted information? This is the Achilles’ heel of ‘Proof of Workmining and it’s called a ‘51% attack’.

Having a majority of the computing power makes it possible to rewrite part (or even all) of a blockchain. This can have several consequences, one of the most common of which is called double-spending. Using the example transaction that I sent to Jess previously, the majority miner group would then be able to erase the transaction in the next block. As a direct consequence, my debit will be canceled without canceling the credit in Jess’s wallet.

When a 51% attack is underway, the majority group of miners will mine a longer blockchain on their own. By design, nodes will synchronize with the longer chain. If the legitimate nodes want to refuse the transactions, they will have to gain the majority of the hash rate for the malicious attackers. The negative effect of this method becomes immediately apparent when it causes the price of the relevant crypto to drop almost instantly. Since the blockchain is not exclusively for crypto-currencies, this falsification of data could also result in fraudulent monitoring of food, industrial, or energy supply chains.

The 51% Attack
The 51% Attack, Source: ethresear.ch

Proof of Stake: The Alternative to Proof of Work

Proof of Stakeminers’ tasks have been divided into several roles, yet the end goal remains the same: ensuring that the information is transmitted correctly while respecting a peer-to-peer consensus. This consensus will be achieved utilizing a completely different method from proof of work. Instead of solving complex mathematical equations with dedicated machines, proof of stake requires the user to hold a certain amount of crypto. By design, the network will recognize those who keep enough assets to be trustable in order to validate the transactions. This way, users no longer have to spend transaction fees and block rewards are distributed to different validators across the network. The quantity of crypto necessary for a user to become a validator is generally a significant amount (32 ETH for ETH2 for example), but this stake in the network is necessary to prove the reliability of the candidates for validation.

There are several variants of ‘Proof of Stake’ (PoS). The most popular of which is the ‘Delegated Proof of Stake’ (DPoS) used by both EOS and WAX. There are some key differences between the variants, but the core concept remains the same. DPoS allows a user to stake their tokens in a trusted validator. Based on the percentage that this stake represents on the entirety of what the node manages, the user will receive a proportional reward of the block reward. The validator’s proof of stake is thus participatory and does not receive the full block reward.

Without being exhaustive, here are the advantages of ‘Proof of Stake’ (PoS) and Delegated ‘Proof of Stake’ (DPoS):

And the disadvantages:

  • Encourages nepotism
  • Centralization of validation by whales

The balance of these consensus methods is found at the level of the number of crypto (or tokens) necessary to be a validator, but also of those who are ‘contributors’, namely those who have decision-making power on the changes to be made at the consensus level. A validator will be in charge to validate the transaction, whereas the contributors will be in charge to propose soft or hard fork or any major upgrade proposition of the blockchain.

This work is licensed under a Creative Commons Attribution 4.0 International License.

Keep in touch

© 2018 - 2024 NonFungible Corporation

All rights reserved.