0118-999-88199-9119-725-...3 cryptonight.tech@protonmail.com

Guest Post – XMRanon – What is RandomX?

Today we have our first guest post by XMRanon. He will enlighten us about a potential new Monero Algorithm called RandomX.

Developed by a trio (Tevador, hyc, and SChernykh) over the course of the last year with the goal of pushing ASICS off the network, RandomX is the name of a submission to be Monero’s next Proof of Work algorithm. In the following, I’ll attempt to describe RandomX in an easily understandable way, why RandomX was developed and some of the concerns voiced regarding RandomX like botnets and CPU farms. We will also look at what the future holds for GPU miners.

First, let’s cover how RandomX works. The RandomX Proof of Work exists within a virtual machine called the ‘RandomX VM’. This virtual machine is built in such a way that it can simulate a CPU [see figure 1]. When the virtual machine initializes, it takes 4GB of DRAM to store its initial dataset. This initial dataset is comprised of a 256 bit hash of the most recent block, though ‘most recent’ does have some qualifiers: the block must be divisible by 1024 and have at least 64 confirmations. This process is repeated each 1024 blocks, which is roughly every 34 hours.

Figure 1 – RandomX Design


The dataset is broken up into 67 million ‘blocks’ of data in 64 byte increments. The PoW hash is generated from the 2MB scratchpad. This scratchpad lives in CPU cache, and is a random ‘block’ of data from the Dataset. This block of data is then sent through 8 ‘RandomX loops’. Each RandomX loop consists of 2048 randomization loops. Once sufficiently randomized, Blake2b is then used to generate the final PoW hash. Blake2b is used as it’s roughly 2x faster than SHA3 in software (remember – this is being done within the RandomX VM).

So I hear you now: “Why the ?#@*! don’t we just embrace the ASICs? They never hurt Bitcoin!”. Monero is based on CryptoNote, whose whitepaper states clearly that “Bitcoin creates favourable conditions for a large gap between the voting power of participants as it violates the “one-CPU-one-vote” principle since GPU and ASIC owners posses a much larger voting power when compared with CPU owners.”. So that argument can be considered moot. Monero is against the centralizing force of ASICS and the unequal coin distribution that they represent. Monero has seen nearly a 3x increase in overall nethash as a result of ASIC introduction in mid-January. [see figure 2] These miners, who currently control the only supply of Monero capable ASICS, are taking (roughly) 576 blocks a day, or around 1800 XMR. Every. Single. Day. Let that sink in. This gives this entity power over the market, as well as power over the network. Even if they ‘play by the rules’, it’s still a massively centralizing force in both respects.

Figure 2 – Monero’s Nethash Increase


There are of course other concerns to moving to a CPU favored algorithm like RandomX. For example, what will happen to all of the current GPU miners? To say that GPU miners have a sizeable investment in the security of the Monero network is an understatement. With that in mind, there is nothing to say that GPUs will be incapable of hashing on RandomX, they will just be disadvantaged relative to CPU mining. This path inevitably also leads to the question of botnets. If it’s a CPU favored algo, wouldn’t botnets take the place of ASICs? This concern is understandable, though not rooted in reality. Looking to the Dataset that’s required, and the 4GB of DRAM it occupies, a RandomX enabled botnet miner would not be as easily hidden as a current generation one. In my opinion, the argument could be made to the inverse: it’s equally likely botnets could see a decrease in their overall nethash percentage.

In summary, RandomX is a proposed Proof of Work change that would allow Monero to remain ASIC resistant, continue pushing for a very high level of decentralization, while maintaining a more egalitarian coin distribution. We’ll see what happens leading up to the October, 2019 fork and where consensus lands. In the meantime, feel free to join the conversation on reddit , follow the projects main repo or read through the documentation.