Crypto Currency Sustainability and Consensus Algorithms
Apr 27, 2021
I wrote my second Master’s thesis on the categorization of electronic cash and electronic coin systems, paying special attention to privacy and anonymity. At that time, in 2003, there were already some electronic coin systems, but the invention of Bitcoin was still several years away. Six years later (2009), I was busy with my professional CAD software development career, then I transitioned back to the privacy research space but from the biomedical informatics side—basically I missed the Bitcoin train. Nowadays I try to keep my finger on the pulse of the crypto currency scene and I constantly resist FOMO (Fear of Missing Out).
All crypto currencies have a consensus algorithm to sustain the validity of the currency’s network, to prove the validity of the transactions, and to weed out any potentially misbehaving participants. The pioneer of that is, of course, Bitcoin, which uses a PoW (Proof of Work) consensus algorithm. The so-called miners are tasked with solving mathematical "riddles". The "riddles" are designed in such a way that there’s no closed formula to get directly to the solutions, but the miners have to scavenge an unbelievably vast solution space to find a matching answer.
Whoever finds the solution to a "riddle" can append a new block to the blockchain and receive a reward for their work. The miners are "mining" to find the "gemstone", which is a solution to the "riddle". Instead of pickaxe chops, prospective miners execute a non-reversible hash algorithm many billions of times per second. In the early days, the hash algorithms ran on conventional processors. At that time, GPUs (graphics processing units) were already enhanced for gaming and were also used for scientific HPC (high-performance computing) purposes—this is also called GPGPU (General Purpose Graphical Processing Unit) technique: using a hardware primarily designed for graphical tasks for other computational workloads. Miners soon upgraded to GPUs because the mining tasks can take advantage of the several thousand executor engines residing in a GPU: the trillions of hash computations are parallelizable; this is also why mining pools are a reality.
The potential profit generated enormous hunger, and engineers designed specialized hardware for the sole purpose of crypto currency mining: these are called ASIC (Application-Specific Integrated Circuit) miners, and to give you an idea, an AntMiner S9 is capable of computing 14,000,000 MHash per second. That’s 14 million mega hashes per second, or 14 Peta hashes, or 14 * 10^12 (12 zeros). ASIC mining hardware exists not only because they blow even the fastest GPUs out of the water by magnitudes, but also because the original Bitcoin creator introduced an artificial difficulty concept into the currency to counteract the effect of Moore’s law (the computational performance doubles almost every two years). If the effort to solve the "riddles" were to become too easy due to technical advancements (hello quantum computing!), the security of the system could be in jeopardy.
The competition between miners quickly became so fierce that it is not profitable to enter the mining scene without an ASIC miner unless you have a lot of electricity for free. ASIC miners require thousands of dollars of upfront investment, and gigantic mining farms dominate the mining market. With just a few ASIC miners, someone would have to join a mining pool to enlarge a virtual mining farm that has some chance of scoring a "riddle" solution against the giants.
Mining has another unfortunate side effect of consuming massive amounts of power. Because of the planned difficulty increase, this will just get progressively worse as time passes. According to TechCrunch, bitcoin miners are estimated to expense 130 Terawatt-hours of energy (TWh), which is on par with the carbon dioxide emission of a developing nation like Sri Lanka or Jordan (population of 10 million). From a power consumption perspective, an ASIC miner looks like many hairdryers running 24/7 squeezed into a box, emitting a lot of noise and heat. Mining farm fires surprisingly could be triggered by power outages because without cooling fans running, the extremely hot internals of the miners have a chance to simply light themselves on fire. This is most definitely not sustainable.
Researchers have been trying to come up with more sustainable consensus algorithms for a long time now. I’ll list them, starting with the already mentioned Proof of Work.
- Proof of Work (PoW) system: the miners have to solve a computationally hard problem to find a solution in a large solution space for a cryptographic challenge. Most of the currencies use some form of hash algorithm due to how the cryptography mathematics pan out. Often a progressive staggered difficulty increase is designed into the system to counteract technological advances. The potential mining reward increases exponentially by the computational power. The resulting currencies tend to spawn power-hungry miner data centers around the globe which consume unfathomable amounts of energy. In the end, mining is dominated by gigantic miner data centers. Researchers try to design PoW functions that are "ASIC resistant". For example, in the case of memory-hard functions, problem solving requires a lot of memory, and that could hinder ASICs. That still wouldn’t change the exponential nature of the reward-power relation, but it could still slow the spawning of heat-guzzling miner centers.
- Proof of Stake (PoS) system: the validity of the transactions and the whole system are still mathematically protected and verified by multiple parties in a distributed fashion, but miners are not required to invest so much power to win a reward. Instead of power, miners prove how much they have financially invested in the system, and the chance of winning a reward (given the miner still solved the cryptographic puzzle) is proportional to that financial investment. This means a linear relationship to the reward chance versus the exponential relationship of PoW systems. Proof of Stake systems still require computing hashes and don’t eliminate the power hungriness completely, but the linear nature makes it less of an insane ride to a fierce hell. So much so that the second-largest and most popular crypto currency’s - Ethereum or ETH - next version 2.0 is based on a Proof of Stake system instead of Proof of Work. The criticism of Proof of Stake is that large actors with a lot of wealth can present a lot of stake and thus dominate the smaller individual miners, just like we see with Bitcoin-like systems. However, at least it doesn’t consume as much energy, so it is an improvement.
- Proof of Capacity (PoC) system: the miners pre-calculate values (also called as plotting) and store them onto a large disk space via a quite expensive PoW function. The PoW function is hard enough to solve—combined with the value retrieval conditions—that it is simply not feasible to compute it on the fly. It only makes sense to go through the pre-compute procedure and look up the plotted values to return them in a short time. By looking up the value, the miner basically proves that it allocated a certain large amount of space for pre-computation; the difficulty of the PoW function ensures that. Proof of Capacity systems only require high power consumption during the plotting phase. Once that’s done, the standby of the disk array system requires significantly less power than the energy-guzzling, heat-burning ASIC miners. I talk about my story more in a follow-up blog post, but for me PoC whitepapers actually suggested a nice reuse option for old hard drives and disk array systems—presenting a green solution in that sense as well. Let’s remember the three Rs: reduce, reuse, recycle—in that specific order. Reuse of hard drives has a higher priority from a sustainability perspective than recycling after disposal.
- Proof of Space (PoS - unfortunate overload with Proof of Stake): the miners have to allocate a large amount of memory or disk space to be able to solve challenges presented by the system. Proof-of-space is different from memory-hard functions in that the bottleneck is not in the number of memory access, but in the amount of memory required. Similar to Proof of Capacity, Proof of Space systems are seen as a fairer and greener alternative by blockchain enthusiasts due to the general-purpose nature of storage and the lower energy cost required by storage. Example currencies can be SpaceMint and Burstcoin.
- Proof of Storage (also known as proof of retrievability, proof of data possession) is related to the Proof of Space concept above, but instead of showing that space is available for solving a puzzle, the miners show that space is actually used to store a piece of data correctly at the time of proof. This makes particular sense for cryptocurrency systems that aim to store data as a service. Example crypto systems are Storj, Sia, Filecoin, and Chia.
- Proof of Space-Time (PoSt): the miner has to prove that it allocated space for a certain required amount of time. The creators of PoSt realized that often storage of data is not required indefinitely. Let’s think about services like box.com or any other popular file share: someone is monetarily incentivized to remove data if it’s not required anymore in order to save costs. If a cryptosystem monetizes storage like Proof of Storage, it’s a finer-grained and financially better model if a user can tune the service requests over time as well.
Although the last four systems are considered to be greener, recently they are still causing an upset. For more than a year, the CPU market was battling serious shortages, and scalpers also decimated the GPU market by snatching every available GPU and driving up the prices. When I came across Proof of Capacity a few years ago, I approached it from the perspective of reusing older storage racks and hard drives. Crypto IPOs, however, can cause a huge craze, and it seems that upcoming Proof of Space-Time currencies activated scalpers to target the SSD and HDD market. It’s sad to see that the last "untouched" market portion got scalped and now there’s shortage there as well.