Crypto Currency Sustainability and Consensus Algorithms
Apr 27, 2021
I wrote my second Masters degree about 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 fingers on the pulse of the crypto currency scene and I constantly resist FOMO (Fear or 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 potential 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 to solve mathematical "riddles". The "riddles" are designed in a way that there’s no closed formula to get to the solutions straight, but the miners have to scavenge an unbelievably vast amount of solution space to find a matching answer.
Whoever finds the solution to a "riddle" can tend 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 pick axe chops the 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 the GPUs (graphical processor 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 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" would become too easy due to technical advancements (hello quantum computing!) the security of the system could be in jeopardy.
The competition between the miners quickly becomes 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 soemone would have to join a mining pool to enlarge a virtual mining farm which has some chance to score a "riddle" solution against the giants.
Mining has another unfortunate side effect of consuming gazillion amounts of power. Because of the planned difficulty increase that 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 the power consumption perspective an ASIC miner looks like many hair dryers running 24/7 squeezed into a box emitting much noise and heat. Mining farm fires surprisingly could be triggered by power shortages because without the cooling fans running the extreme hot internals of the miners have a chance to simply light themselves on fire. This is most definitely not sustainable.
Researchers are 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 the mining is dominated by gigantic miner data centers. Researchers try to design such PoW functions which "are ASIC resistant". For example in case of memory-hard functions the problem solving requires a lot of memory and that could hinder ASICs. That still wouldn’t change the exponential nature of 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 the miners prove how much they financially invested into 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 linear relation to reward chance versus the exponential relation of the 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 an 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 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 stand-by of the disk array system would require significantly less power than the energy guzzler heat burner 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 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. Similarly to Proof of Capacity the 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 could particularly make sense for crypto currency systems which 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 a 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 any more 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 with 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 with serious shortages, 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.