Published : 2/20/2020

On November 30th, 2019, Monero had its semiannual hard fork, with the most anticipated change being a switch from the old PoW algorithm, cryptonight, to the completely new, internally developed one, RandomX. The Monero community believes RandomX is a big step toward egalitarian mining, but let’s dig deeper to see if that’s the case.

Purpose

In order to judge whether RandomX is an improvement, we must first understand what the purpose of mining is. Mining secures a blockchain from double spends via Nakamoto Consensus. The exact intricacies of how it does this are beyond the scope of this article, but they can be learned from many different sources around the internet. What matters is that the security comes from hashes generated by computers (miners), in competition with one another to find the mathematical solution necessary to create another block. As they do this, they add new transactions to the blockchain. In return for their work (hashes) they are compensated with newly minted coins.



There are a number of issues that can occur with this setup, and they require proper incentives to work correctly, but we’re going to focus in on one particular problem that might arise. If mining is supposed to be a competition, what happens when one miner gains an advantage?

Background

For context, let’s talk a bit about mining hardware. Miners use computers to do the work, but we all know that not every computer is made equally. Some computers are powerful enough to run AI networks or intense games, while others struggle with even simple tasks. These differences in computing power also affect the rate hash rate, or the rate at which they look for block solutions.



But even these differences between computers pale in comparison to the hash rates of specialized hardware, otherwise known as Application Specific Integrated Circuits (ASICs), which outclass regular computers by several order of magnitude.



Let’s take some time to explore what makes ASICs so powerful. Imagine all computers as falling somewhere on a spectrum, which ranges from being able to do many things, but nothing well, to doing only one thing, but doing it very well. CPUs and ASICs are on opposite ends of this spectrum.



CPUs that are in all standard computers are on the first end. They can do many things, like browse the web, play games, or render video, but not do any of them particularly well. But this flexibility comes at the cost of efficiency.



ASICs are on the other end, where they can just one thing, but do it at an incredible rate. They can only perform one mathematical function, but because they can ignore everything else, the performance gains are astronomical. This efficiency however, does come at the cost of flexibility, so if the function changes even slightly – an example is x + y = z changes to 2x + y = z – then the ASIC will cease to function altogether.



Not everyone owns an ASIC, but everyone does own computers. This can lead to an unfair advantage.

A fun analogy

If this still is confusing, perhaps the following analogy will help. Imagine a lottery where one thousand dollars is awarded every hour, and this lottery allows you to print your own tickets! You start printing as many tickets as you can on your home printer, which can print one ticket per second. After subtracting electricity and ink costs, you see that you can still make a profit, even if you only win the lottery once every few weeks.



Over time, you expand your operation until you have an entire room dedicated to printers. 20 in all. Everything is fine...until one fateful day.



There’s big news. Someone has invented a new kind of printer. It can only print lottery tickets. It can’t print pictures, or office documents, or do double sided printing. Only lottery tickets. But it can print them at a rate of 1000 tickets per second. You look in your little printer room. 20 printers. You need 980 more printers just to keep up with ONE of these monster printers, and if someone has two…?



You sadly exit the lottery game as you can no longer justify the electricity and ink costs.



But wait! A couple of weeks later there’s more news! The design of the ticket has changed. Now the numbers, which used to be on the top, are now on the bottom. The new monster printers are so inflexible they can’t do it. They could only make the previous design. It’s not long before you’re once again happily printing away. At least until someone makes a new monster printer for the new design.

RandomX