Mining in Blockchain

Richa Kaushik
7 min readJul 31, 2022

While listening about blockchain you would have come across the term miners or mining. Here we are going to discuss what is mining and who is a miner. What does it infer in blockchain? A miner is a person who extracts ore, coal, chalk, clay, or other minerals from the earth through mining but what does it mean in a blockchain system? What needs to be extracted, from where, and how? Let’s understand blockchain mining in simple words with simple examples.

Miners are nothing but just computers that process transactions in the blockchain.

Let us take an analogy.

Imagine that all of the Bitcoin Network’s miners are regular casino gamblers. Each of these players in this case has a 100-sided die. They rapidly roll the die, hoping to land on a number lower than 5. According to statistics, this can take a very long time, but as more players become involved, it gets easier to hit a number under 5. In other words, faster rounds are the result of more players.

Anyone at the table who correctly rolls a number less than 5 can peek down and check the result. The one who is fortunate enough to get the number less than 5, gets a prize and again new game begins.

In this example, More dice rolls per second correspond to more hashes per second (higher hash rate), which increases the chance of success.

A hash function simply takes an input string (numbers, alphabets, media files) of any length and transforms it into a fixed length, once a target output is met mining is done. We will study it in detail later.

This casino gambler’s game reflects the mining process. Let’s see how.

Actually what happens is that Bitcoin or any cryptocurrency is frequently sent between individuals hence nobody will be able to remember who paid whom unless someone keeps a record of all these transactions.

All we know is that this history of transactions is being recorded in form of a block of a blockchain at every system(decentralized system) of the network.

Now, this information about the transaction between two parties doesn’t directly pass throughout the network. There are privacy and other concerns like energy needed to create a block of that transaction and add it to the existing blockchain, hence to add a block of transaction requires the mining of that block.

Before mining and verification of a transaction, it resides in an area of mempool. A mempool is a waiting area for the transactions that haven’t been added to a block and are still unconfirmed.

Mining of the block, therefore, means, picking that transaction from mempool by one of the computer/ nodes of the network and adding its block to the blockchain and verification. That information once added to a ledger (ledger is a list of blocks) will be permanent throughout.

In a nutshell, can we say that Bitcoin mining is just another name for transaction processing in the blockchain system? Well yes!

Now the question raised is how the miners( nodes or computers in general) pick the transaction and add them in form of blocks in the blockchain ledger.

Miners take the data from the block and change it into something different by applying a mathematical formula to it. That something else is a hash(unique for a block- we will study hashing in detail later). As of now just take hash as an id of a block.

Miners do the mathematical calculations and apply some logic and try to reach up to the target. Target is a condition for the hash, which is set by the algorithm of the blockchain itself. Miners keep on changing the hashes of the block so as to reach up to the target.

Many miners simultaneously throughout the network work on it. Once a miner gets a hash that is falling in the target range, the condition is fulfilled and blocks get mined. Once mined, the information reaches other connected nodes and spread throughout the network. Other nodes verify the mined transaction (keep in mind that verification is not a manual process but your system automatically through an algorithm verifies the transaction). However, mining takes some time but verification is done in negligible time.

Once this is done, the transaction is added to the block of the blockchain permanently.

And miners will get a small fee and award ( bitcoin or eth-depending upon which blockchain mining is being performed). All this takes an average of 10 minutes of time and this is the scenario since 2009.

Isn’t it just like a casino gambler’s game?

Nowadays a lot of groups of nodes together perform mining processes in order to earn profit. This is called a mining pool.

The simple definition of a mining pool can be that a mining pool is a collective group of cryptocurrency miners who pool their computing power across a network to increase the probability that they will successfully mine the block. Mining on your own can be expensive as it requires pricey hardware, but with a mining pool, you can earn decent profits. For individual computers, getting a block mined is very rare as there is cut-throat competition, but if that computer/node becomes part of a mining pool, by paying a small fee, it is somewhere profitable.

Why? because once any node in that pool gets a block mined, the reward distributes throughout the pool. However the reward is not equally given to all, but it depends upon the hashing rate of different nodes. Just like the performance of individuals in the group, a reward is given based on individual efforts. This effort is the hash rate.

In the dice game, how fast an individual is throwing dice or how many times dice are being thrown by an individual in a unit of time determines the probability of getting the right number. Similarly, how many hashes are being generated by the system in a unit of time is the system’s ability, called hash rate.

Let us now consider some significant factors to keep in mind before we dive into mining and start mining full-fledged!

You must improve your hash rate at a lower cost than other bitcoin miners in order to mine profitably. The initial hardware expenditures for a bitcoin miner and continuing electricity costs are the two expenses.

You must also take your climate into account. Because bitcoin mining equipment becomes hot, you might need to use more electricity for cooling systems. On the other hand, if you reside in a cold climate, you may be able to save money by using the heat produced by the mining equipment to help heat your home.

Also, the difficulty factor of computation in mining should also be considered before we start with it. Not only the difficulty factor but also the rate with which this difficulty is being increased day in and day out. Moreover, bitcoin market price, block reward, pool fees, electricity bills for hardware maintenance, and hash rate updates should be examined before taking any decision.

Now let us see what are some points to keep in mind before becoming part of a mining pool.

To participate in a mining pool, you might need to invest in specialized, pricey equipment.

The hash rate of the entire mining pool matters more than its size, however, you can also evaluate the pool’s credibility based on its size.

It is crucial that mining pools assign tasks fairly and are open about how they operate. Schemes for payouts and fees are necessary because they can reduce your profits.

Due to their greater computational capability, larger pools have a better possibility of producing blocks, whereas smaller ones typically take longer. But the profit in large pools divides between a large number of nodes while in small pools, this is not the case. On the other hand, in some ways, a mining pool’s size might indicate how reliable it is. For instance, a pool with a large number of active miners may be a reliable one. So both have their own merits and demerits, take a calculative step.

So consider all these points before making a fair choice about joining a mining pool.

One more question which crept into my mind while I was researching the topic was, if however two miners simultaneously mined a block, then whose block will be located on the final ledger?

This problem can be solved by the longest chain rule which we will be discussing in upcoming blogs.

There are different ways to mine a bitcoin. Some of these are Mining rig rentals, hardware mining, and cloud mining. Let us see all three of them.

Before that let us see the hardware requirements of a system in order to engage in mining work. So a typical computer with a CPU, motherboard, RAM, and storage can be used to mine Bitcoins. The graphics processing unit (GPU), often known as the video card, is the only distinction and the most crucial necessity in this case. If someone wants to mine Bitcoin, a powerful GPU is a requirement. Also mining hardware (ASICs) are highly specialized computers used to mine bitcoins.

In the case of mining rig rentals, if your system doesn’t have any of these powerful resources, then you can rent rigs from miners all over the world on the website Mining Rig Rentals. You can access a variety of rigs that will enable you to start mining without the inconvenience of purchasing the equipment you typically need!

When you purchase your own bitcoin miner and set it up at home or in a warehouse, this is called hardware mining. You must take care of the hardware, and pay for electricity, internet, cooling systems, and other expenses.

With cloud mining, an experienced organization will take care of all of the hardware maintenance; all you have to do is pay by hash rate. Since many bitcoiners believe cloud mining to be a fraud, which it very well might be, there is a lot of controversy surrounding it.

With cloud mining, it is impossible to verify that you are receiving the hash rate you paid for.

If anything related to mining is not included in the scope of this blog or if there is any doubt, do comment, I will include that in upcoming ones!

--

--