BITCOIN MINING: WHAT IS AND HOW DOES IT WORK?
In the traditional economic system states and governments can print tickets at will. This does not happen in Bitcoin due to two reasons:
1. There is a limit of 21 million coins and that point can not be modified
2. The amount of coins released as a reward for the work done is limited in the software and halves every 210,000 blocks by a process called halving
Until the 21 million bitcoins are fully issued (about the year 2140) new coins are put into circulation every 10 minutes. These coins are obtained by the miners in compensation for the work done. The miners in turn generate and validate the blocks that make up the large accounting book that the blockchain network represents and where all the transactions of the network are recorded.
If we think about gold mining, it consists of removing earth with heavy machines to obtain gold in sufficient quantity to pay the exploitation costs and obtain profit. The same happens in bitcoin mining, with the caveat that the machinery is complex computer equipment that performs computational calculations and as compensation get two incentives:
- New bitcoins that are put into circulation
- The commissions of the transactions
The miners receive a new mathematical problem every ten minutes and the quickest to solve it takes the new coins that are put into circulation. This mathematical problem is based on random calculations that aim to find the solution and thus obtain block validation. Whoever deciphers this will get the reward, as long as the rest of the members of the network say that the answer is correct.
“The network marks the time of the transactions at the same time as it hashes them (making a cryptographic transformation), which goes into a continuous chain of work proof based on hashes, forming a record that can not be modified without redoing the work test. . The longer string not only serves as a test of the sequence of events that occurred, but as proof that it comes from the largest set of CPU power. As long as the highest CPU power is controlled by nodes that are not cooperating to attack the network, they will generate the longest chain and overtake the attackers. “
Satoshi Nakamoto in the Bitcoin Whitepaper
Because cryptocurrencies are a decentralized system, we need a system that allows us to check all transactions made and prevent someone from using the same amount of bitcoins more than once or being able to introduce fake coins into the market. The mission of mining is basically to certify that nobody uses the coins twice and that no one can introduce false bitcoins on the market.
Thus, the miners review the transactions and collect the last transactions created in a group (called a block). The set of blocks would be something like a ledger (accounting book) that certifies all movements and the balance of users.
Cooperating mining or pools.
The greater the power of computing, the easier it becomes to solve a block and therefore obtain a reward. It is for this reason that the mining pool was created, to carry out joint work and thus obtain a reward among all the members and obtain fair compensation for the work done.
Joining under a pool guarantees us more possibilities to solve a block and therefore obtain the reward. If we did it individually by user it is possible that we will never get a reward either out of pure probability or because we have less computing power than the competition.
Thus, associating with other users that provide mining machines guarantees that we will obtain a reward with greater probability.
The reward for the miner.
Within the Bitcoin code, it is established that when a block is validated, a certain amount of coins is obtained. Currently, 12.5 bitcoins are obtained for each new validated block, but this value will be modified shortly and will be reduced by half. We must bear in mind that to this amount of fixed bitcoins the commissions of each one of the transactions are added
Each 210,000 blocks is reduced by half the amount of bitcoins that are given as a reward, something that is known as halving. This implies that the value of each bitcoin has to increase so that mining continues to be profitable.
The next halving will be on May 23, 2020 at 06:29:48, which will modify the reward per block going from 12.5 BTC currently to 6.25 BTC.
“By convention, the first transaction in the block is a special transaction that generates a new currency whose owner is the creator of the block. This adds an incentive for the nodes to support the network, and provides an initial way to distribute and circulate currencies, since there is no authority to create them. This stable addition of a constant amount of new coins is analogous to gold miners who spend resources to put it into circulation. In our case, the resources are CPU time and electricity that are spent. “
Satoshi Nakamoto in the Bitcoin Whitepaper
What do I need to mine bitcoins?
The first bitcoins were mined by the processor of the computer equipment because very few people were mining. As people joined bitcoin mining, the difficulty increased due to the increase in computing power of the network making it very difficult to obtain a reward. This was the jump to graphics cards because the GPU (graphics processor) have more computing power than the processor.
On December 16, 2009 Bitcoin software version 0.2 was launched, which incorporated an interesting novelty, which is that it allowed the use of several processors in the same system. That day was a before and after.
What Bitcoin v0.2 allowed was the development of specialized machines for computing: ASICs. Basically an ASIC is a computer but has many processors greatly increasing the computing power of each of these systems and that left the mining using graphics cards completely obsolete.
The difficulty and the hashrate
We must understand that as more computer equipment is added to the network, the computing capacity of the network increases, but at the same time we have more competition to obtain a reward.
The difficulty is the calculation necessary to ensure that blocks are obtained every ten minutes. If the new blocks will suddenly be generated in less than 10 minutes on average during 2016 blocks, Bitcoin will automatically reset to increase the complexity of the problem. The opposite happens if suddenly the average in those 2016 blocks rose 10 minutes.
The hashrate on the other hand is the processing capacity of the Bitcoin network for each of the equipment that is added. The sum of the power of all the computers in the network gives us as a result the total hashrate in the network.
Profitability of Bitcoin mining
According to the power of the ASIC that we have and the pool in which we are, we will have more or less possibilities of obtaining bitcoins. The profitability depends on the value of Bitcoin, the difficulty of the network and the determining factor: the electric cost.
The price of electricity will be the one that really determines if it is viable or not to mine Bitcoin and if we will obtain compensation for the work done. Large mining farms are usually installed in countries or areas where there is access to cheap electricity, mainly based on renewable energies, mainly hydroelectric. Unfortunately in Spain because of the high cost of electricity it is not feasible to mine Bitcoin.
Not only do we have to take into account the direct electricity needed to feed the miner, we also need to cool all the heat they generate, so the electric cost increases significantly.
We must also take into account the cost of acquisition of equipment and competition or what is the same, the number of machines that are operating in the network and that tend to increase. This will make our mining operation together with the electric cost may or may not be profitable.
Finally, it must be taken into account that the development of new specialized systems for the mining of Bitcoin are still under development and that may mean that at any time our ASIC becomes obsolete or, in other words, reduces profitability.