Bitcoin Mining: What Is It and How Does It Work?

In the traditional economic system, states and governments can print banknotes at will. This does not happen with Bitcoin for two reasons:

  1. There is a limit of 21 million coins, and that amount cannot be changed
  2. The number of coins released as a reward for the work performed is capped in the software and is cut in half every 210,000 blocks through a process called halving

Until the 21 million bitcoins have been fully issued (around the year 2140), new coins are put into circulation every 10 minutes. These coins are obtained by miners as compensation for the work performed. Miners, in turn, generate and validate the blocks that make up the great ledger that is the blockchain network.

If we think of gold mining, it consists of moving earth with heavy machinery to obtain enough gold to cover operating costs and make a profit. The same happens in bitcoin mining, except that the machinery consists of complex computer equipment that performs computational calculations and, in return, receives two incentives:

  • New bitcoins that are put into circulation
  • Transaction fees

The bitcoin mining process is always the same: miners receive a new mathematical problem every ten minutes, and the fastest to solve it takes the new coins being put into circulation. This mathematical problem is based on random calculations aimed at finding the solution and thus obtaining validation of the block. Whoever cracks it will take the reward, as long as the rest of the network’s members confirm that the answer is correct.“The network timestamps transactions by hashing them (applying a cryptographic transformation) into an ongoing chain of hash-based proof-of-work, forming a record that cannot be changed without redoing the proof-of-work. The longest chain not only serves as proof of the sequence of events witnessed, but proof that it came from the largest pool of CPU power. As long as a majority of CPU power is controlled by nodes that are not cooperating to attack the network, they’ll generate the longest chain and outpace attackers.”

Satoshi Nakamoto in the Bitcoin Whitepaper

The role of mining

Because cryptocurrencies are a decentralized system, we need a system that allows us to verify all the operations carried out. This is important to prevent anyone from spending the same bitcoins more than once or from introducing counterfeit coins into the market. The mission of mining is basically to certify that no one spends coins twice and that no one can introduce fake bitcoins into the market.

Thus, miners review transactions and gather the latest transactions created into a group called a block. The set of blocks could be compared to the set of pages of a general ledger (accounting book) that certifies all movements and users’ balances.

Mining cooperatives or pools

The more computing power you have, the easier it becomes to solve a block and, therefore, obtain a reward. This is why mining pools were created: to work together and thus obtain a fair reward shared among all members for the work performed.

Joining a pool gives us a better chance of solving a block and earning the reward. If we did it individually, we might never obtain a reward, whether due to pure probability or because we had less computing power than the competition.

Therefore, teaming up with other users who contribute mining machines gives us a better chance of obtaining a reward.

The miner’s reward

Bitcoin’s code establishes that when a block is validated, a set number of coins is obtained. Currently, 12.5 bitcoins are obtained for each new validated block, but this value will soon change and be cut in half. We must bear in mind that the fees for each transaction are added to this fixed amount of bitcoins.

Every 210,000 blocks, the number of bitcoins given as a reward is cut in half, something known as halving. This means the value of each bitcoin has to rise for mining to remain profitable.

The next halving will take place on May 23, 2020 at 06:29:48, changing the block reward from the current 12.5 BTC to 6.25 BTC.“By convention, the first transaction in a block is a special transaction that starts a new coin owned by the creator of the block. This adds an incentive for nodes to support the network, and provides a way to initially distribute coins into circulation, since there is no central authority to issue them. The steady addition of a constant amount of new coins is analogous to gold miners expending resources to add gold to circulation. In our case, it is CPU time and electricity that is expended.”

Satoshi Nakamoto in the Bitcoin Whitepaper

What do I need to mine bitcoins?

The first bitcoins were mined using computers’ processors because very few people were mining. As more people joined mining, the difficulty increased due to the growth in the network’s computing power, which made obtaining a reward much harder. This led to the jump to graphics cards, since GPUs (graphics processors) have more computing power than CPUs.

On December 16, 2009, version 0.2 of the Bitcoin software was released, incorporating an interesting new feature: it allowed the use of multiple processors in a single system. That day marked a turning point.

What Bitcoin v0.2 enabled was the development of specialized computing machines: ASICs. Basically, an ASIC is a computer with many processors. The computing power of each of these systems is much greater, and it made mining with graphics cards completely obsolete.

Difficulty and hash rate

We must understand that the more computers are added to the network, the more its computing capacity increases. At the same time, there is more competition to obtain a reward.

Difficulty is the calculation needed to ensure that blocks are produced every ten minutes. If new blocks were suddenly generated in less than 10 minutes on average over 2,016 blocks, Bitcoin would automatically readjust to increase the complexity of the problem. The opposite happens if the average over those 2,016 blocks suddenly rose above 10 minutes.

The hash rate, on the other hand, is the processing capacity contributed to the Bitcoin network by each machine that is added. The sum of the power of all the machines on the network gives us the network’s total hash rate.

Bitcoin mining profitability

Depending on the power of our ASIC and the pool we are in, we will have a greater or lesser chance of obtaining bitcoins. Profitability depends on the value of Bitcoin, the network difficulty and the decisive factor: electricity costs.

The price of electricity is what will truly determine whether mining Bitcoin is viable, and whether we will be compensated for the work performed. Large mining farms are usually set up in countries or areas with access to cheap electricity, especially from renewable sources, mainly hydropower. Unfortunately, in Spain, due to the high cost of electricity, mining Bitcoin is not viable.

We must consider not only the direct electricity needed to power the miner. We also need to cool all the heat they generate, which significantly increases electricity costs.

We must also take into account the cost of acquiring the equipment and the competition, that is, the number of machines operating on the network, which tends to increase. Together with electricity costs, this will determine whether or not our mining operation is profitable.

Finally, the development of new specialized systems must be considered. Bitcoin mining systems are still being developed, which may mean that at any moment our ASIC becomes obsolete or, put another way, its profitability decreases.