How The RandomX Upgrade is Different

Mohamed Fouda
Token Daily
Published in
4 min readDec 10, 2019

On November 30th, the Monero network executed its scheduled hard fork to the new mining algorithm: RandomX. The hard fork is part of Monero’s continuous efforts to expel specialized hardware from mining on Monero. The frequent forking strategy is not new and initially began as a response to Bitmain’s introduction of an ASIC miner for XMR early 2018. At that time, the Monero devs and community decided to change the mining algorithm to brick the ASIC miners. Since then, the strategy has been to fork the network regularly (aiming for about twice every year) in order to perform protocol improvements and render ASIC chips obsolete on the Monero network.

In this context, the RandomX fork may first appear to be a regularly scheduled fork. However, in reality, RandomX is different than the previous forks. While previous Monero hard forks mainly targeted the expulsion of ASICs, the RandomX hard fork also expels GPUs from mining in the network.

What is RandomX and Why It Would Affect GPU Mining?

RandomX is a mining algorithm that depends on the execution of random pieces of software code (up to 2⁵¹² unique combinations). These pieces of code mix integer operations, floating-point operations and conditional statements (branches). For this reason, there is no specific execution path and hence no significant benefit from using hardware that excels in executing largely parallel and identical operations like GPUs. This means RandomX mining is better performed using a general-purpose CPU. For example, the benchmark testing done by the RandomX developers shows a performance improvement of 8x-10x for general purposes CPUs between the previous CryptoNight Varient 4 (CN/R) algorithm and RandomX. At the same time, GPU performance either gets a tiny boost or degrades after the mining algorithm change.

Given that, it was normal for GPU miners to leave the Monero network. After the hard fork, the network hashrate jumped from 300 MH/s (using CN/R) to about 750 MH/s (Using RandomX). This 2X increase in hashrate doesn’t match the 8–10X improvement in CPU performance indicating most GPU miners (probably ~ 75% of the old network hash rate) has left the network and only a small fraction (probably around 25%), who were doing CPU mining, held their ground and benefitted from the performance boost pushing the total hashrate up by 2X.

What Goals Has RandomX achieved?

Potentially, RandomX has succeeded in giving more power to CPU miners. In the process, GPU miners have been pushed out. Whether this is a net good or net bad outcome is debatable. RandomX proponents argue that it achieves better decentralization and is more aligned with Satoshi’s original vision for Bitcoin (1 CPU = 1 vote). The flip side here is that CPU mining may not be economically scalable as it targets hobbyists and ideological supporters. Dedicated miners (GPU miners) who used to mine on the network for economic benefits have no incentive to keep securing the network, and hence the current network may be less secure if someone can somehow create dedicated mining hardware that beats CPU performance.

Another area that RandomX cannot improve on is mining pool centralization, which to be fair, isn’t the main goal of the upgrade. After the hard fork, the distribution of the hashrate was essentially the same as before, with the two leading mining pools representing more than 2/3 of the total network hash rate. CPU mining may actually worsen mining pool centralization as it removes any possibility for independent mining which was potentially possible via big GPU miners.

Distribution Of The Monero Network Hashrate on December 4. Source: MineXMR mining pool

Is RandomX Safe for the Long Term?

RandomX is a tough mining algorithm to use for GPUs because GPUs are rigid and designed for a specific type of computational load. However, anyone with a decent background in hardware design knows the same constraint doesn’t necessarily apply for FPGAs.

FPGAs are reconfigurable hardware chips that allow the design of FPGA miner equipment which, in almost all cases, outperform GPUs. As FPGAs are reconfigurable, it is fundamentally possible to create the basic computational blocks required by RandomX and activate the required blocks when needed by the random execution script.

The question then becomes whether a RandomX FPGA miner is economical enough to pursue. My guess is that it is possible. In any case, it won’t be long until we have a definitive answer to this question with the growing influence of FPGA mining companies like Monad, Bittware, and others.

This article appeared first as part of the Token Daily newsletter. You can subscribe to the newsletter using the link below.

--

--

Mohamed Fouda
Token Daily

Crypto researcher and Investor. Contributor @AllianceDao, Venture partner @Volt Capital, PhD @Northwestern