Notice to all crypto-enthusiasts inexperienced in mining, this article will guide you step by step to become a crypto miner or, at the very least, a better-informed crypto-enthusiast 😛
We will first look at how mining works, how it worked in the early days of Bitcoin, how it has evolved as Cryptocurrencies have become more popular, and how it works today. We will see in parallel the appearance of different mining types: hardware (CPU, GPU, FPGA, ASIC), Cloud-Mining, Staking, and Masternode.
Cryptocurrency Mining, how does it work?
In order to be able to go deeper into the subject of mining, we must first understand what it is used for in practice. Satoshi Nakamoto (the inventor of Bitcoin) explains in detail how the blockchain, and therefore mining, works in the Bitcoin White Paper. Don’t worry, we won’t need that level of understanding. The etymology of the name given to the process of securing the network will suffice. This process organizes transactions into a sequence of links: the blocks; and this sequence of links forms a chain: the Blockchain.
These links are in fact packs of information including all the modifications that will have to appear on the current block (compared to the previous block) and the characteristics that the next block will have to have.
Among this information there is :
- the creation of new addresses ;
- the creation of new units (new bitcoins, for example, paid to the miner of the block for the work he has done);
- the mining difficulty for the next block (we will see the importance of this later);
- and, above all, the transactions carried out (signed by the private keys of their former owner).
Cryptography ensures the security of the network. Miners have a more or less complex mathematical equation to solve. Their goal is to produce hashs (cryptographic numbers) that can potentially be the solution to the equation. When they succeed, the block that is selected to be added to the string is that of the miner who has solved the equation. He is rewarded for the work he has done and especially for finding the solution (Proof of Work system).
All the other blocks submitted by the miners become obsolete, the miners must then start trying to solve the equation of the new block to create it, and so on … For your information, the average number of hashes per second at the time of writing this article is 100 million trillion hashes on Bitcoin (1.0 x 10²⁶ hashs/s).
Each block created is supposed to be immutable and unique. It should only be possible for a single block to exist at a given instant T on the chain. In practice, it is possible for two different blocks to co-exist at a given instant T. This may happen voluntarily (most often) or accidentally. When this is the case, both blocks continue to exist and child blocks are generated from the parent block. We then have a bifurcation of the chain, more commonly called fork.
If this phenomenon is provoked voluntarily, it will aim at creating a new cryptocurrency. The two branches of the chain will continue their path independently and the minors will separate. So there will be no switch of the miners on the longer branch and the branch whose properties have been modified will be the one of the new cryptocurrency.
This is what happened with the Ethereum blockchain in October 2016. A part of the miners agreed to change the parameters of the Blockchain after a hack (in order to return to their owner the sum of 3.6 million ETH units). This decision was the result of a referendum organized by Vitalik Buterin, which was overwhelmingly approved by the community. This part of the chain then kept the name Ethereum. The other miners, who decided to act according to the rules of the Blockchain, not altering the previous blocks, continued to mine on the same chain without changing anything. This chain then took the name of : Ethereum Classic.
If this bifurcation happens accidentally or maliciously, a brilliant mechanism is put in place on the blockchain. It is the longest chain of blocks that is retained, and the miners pass over this chain. As we explained earlier, the creation of blocks depends on the resolution of cryptographic equations and computing power. For a chain to be longer than another, it must be retained by 50% + 1 unit of the “total computing power of the network”. The network is, therefore, democratically secured. The most “popular” chain of blocks remains while the other disappears.
This implies two things:
- It is impossible to spend twice a unit (this is the key notion of double-spending). If two different miners submit a transaction simultaneously with a valid key, the miner’s transaction in the longest chain will be executed.
- To maliciously modify the chain of blocks, one must have a 50%+1 hash of the total network hash rate.
A 51% attack is when malicious people try to modify the chain of blocks by having 50%+1 hash of the total hash rate. Some cases have caused a lot of damage but never on a popular blockchain. This is especially a problem for small cryptocurrencies that do not attract many minors. Organizing a 51% attack on Bitcoin today would cost far more than the attack’s potential gains. No one would be interested. This is the very basis of the infallibility of any security system: to make the break-in so complicated that the necessary means would make it unattractive to carry it out.
Mining from its beginnings to the present day
We are finished with the exclusively technical part and we can start to see the different types of mining. At the beginning of the blockchain, just after the creation of the Bitcoin Genesis Block, there was only one computer component used for mining: the CPU.
The CPU has one feature that makes it a first-rate choice: it is easy to use. Indeed, hash coding for CPUs is much simpler (even today) than the hash coding used for other mining components.
The hash rate produced by the CPUs at that time was sufficient to guarantee the security of the blockchain (given its low popularity). Today, CPU mining is limited to browser/smartphone mining and is no longer cost-effective.
It was then that a certain Laszlo Hanyecz intervened, widely known for his purchase of two pizzas 🍕 for 10,000 bitcoins (today this represents about $50 million per pizza). The crypto-enthusiasts celebrate Bitcoin Pizza Day every year on May 22nd, as a tribute to the first Bitcoin transaction made for an IRL purchase by this dear Laszlo.
He became a meme because he wouldn’t have put aside a single Bitcoin despite the enormous contribution he made to this cryptocurrency and the fact that he is one of the pioneers in the industry. In fact, he should be honored for his enormous contribution to the blockchain. He is the first GPU miner in the history of crypto and this discovery will accelerate everything for Bitcoin.
This advance is such that when he shared it with Satoshi Nakamoto, the latter replied that: “GPUs will prematurely limit mining to high-end GPU owners. It is inevitable that GPU processors will amass all the units generated, and I don’t want to hasten the arrival of this day”.
Satoshi Nakamoto was concerned that centralized mining would make Bitcoin vulnerable to attacks 51. 51 Laszlo felt guilty for ruining Satoshi’s project and stopped praising his discovery. Adapting the hash generation algorithm to the GPU was a challenge that was met almost “too easily”. Laszlo was unable to explain the large increase in the hash rate for GPU mining.
However, Laszlo did not ruin Bitcoin. Although he no longer sold the merits of his new discovery, GPU mining and thus network hash rate continued to grow. This had a direct effect on morals:
The Blockchain works!
A high hash rate meant better security, low-cost transactions, good popularity, and increased confidence in the project. Laszlo Hanyecz brought two major advances to Bitcoin:
- the first symbolic “IRL” transaction made in BTC;
- the GPU mining (with a much higher hash rate that empirically demonstrated the blockchain’s good functioning).
The Achilles’ heel of CPUs was the fact that they are not efficient at performing several tasks simultaneously (the total opposite of GPUs), which is the main component of hash production: multi-tasking.
Conversely, the problem with GPUs (even today) is their energy efficiency. The average energy cost per hash is higher for GPUs than for any other modern mining component. Taking these parameters into account, the precursors of today’s ASICs were born: FPGAs.
Mining by FPGA
FPGAs are “integrated circuits composed of an array of programmable cells” as defined by Google. It is, therefore, possible to modify at will the structure of the processor. They are adaptable to cover the needs of a process (for mining, these are the hash functions). They are the types of components that provide the best energy efficiency. Still, their cost and the complexity of their implementation (the chip must be programmed differently for each hash algorithm) have limited their propagation. There are few if any, of them in operation on the Bitcoin network. The biggest breakthrough that FPGAs have brought to the blockchain is that they have initiated ASIC-based mining.
Mining by ASIC
ASICs are “integrated circuits that combine on a single chip all the functions required for a specific application” according to Google’s definition. That is to say that they are very good at executing a specific task but cannot (unlike FPGAs) adapt or evolve when the task to be executed changes (even slightly).
ASICs are in short FPGAs that cannot evolve. They are as energy efficient as FPGAs, but without the cost of FPGAs. Setting up an ASIC miner is as simple as setting up an FPGA miner.
For all these reasons, as you may have guessed, a majority of today’s cryptos miners are ASICs.
The above information is valid for Cryptocurrencies using the Proof of Work system (which is by far the most widespread system). There are many other security processes such as Proof-of-Stake, but they are less used and developed.
Other ways to mine
We will close this introduction by presenting some new mining solutions other than mining by Hardware.
Cloud-Mining is technically identical to the types of mining by Hardware but it is different from the miner’s point of view. It is not a question of having to worry about all the technical problems caused by the machine. A company does the installation, maintenance and optimization of the mining equipment on its premises. Electricity costs are also, in most cases, the responsibility of the professional. The private individual will simply rent a certain chopping power and mine with it.
The problem of Cloud-Mining lies in the trust that can be placed in the companies proposing the offers but also and especially in its profitability. It very often costs more than the crypto that it will generate. It can become interesting only for SOLO mining under certain conditions and we will see the reasons for this in a future article.
Mining also exists in the Proof of Stake process, the confidence factor does not lie in the computing power delivered by the miners, but in the confidence given by some owners of the Cryptocurrency.
Some people acquire a certain amount of cryptos (the developers determine the minimum required in the code). Then they store them in an online wallet and receive new units as they check the operations of the Blockchain. This is called staking. Their capital is a guarantor for the verified operations. In this way, instead of giving the new units to the winning miners, they are given back to the owners of the nodes.
The best analogy of this model with the real world is that of democracy. Whereas in direct democracy everyone expresses themselves and follows whoever has the support of the majority (PoW). With Staking (PoS), we name nodes that express our ideas for us and vote for us (representative democracy).
One of the problems with the PoS system is the “not really” part of this analogy. Nodes are not chosen by users but assigned according to the number of units they own. It is less democratic than PoW and has a disturbing similarity to the banking system: if you have money, you have power, and the more money you have, the more trust you create.
There is one last way to undermine Cryptocurrencies: the creation of Masternodes. These have a similar principle of operation to staking but with a subtle difference. It lies mainly in the reason why the miner receives his reward and the way the system of gains is organized. We will not try to explain this difference as the similarities between the two are so great. Especially from the point of view of the miner, and this is the point of view we have taken in this article.
The appearance of new ways of mining has thus been made with the evolution of needs. We will see in our next article the different ways of mining that exist today and what they imply.