Monero Mining Algorithms


In this guide to Monero mining algorithms, we explore the most popular options: CryptoNight and RandomX.

Monero CryptoNight Algorithms

Monero (XMR) is the most well-known cryptocurrency to incorporate CryptoNight, despite the algorithm being made for Bytecoin (BCN) originally. As with the Ethash algorithm, ASIC resistance is the primary aim of CryptoNight. However, it’s also designed to strengthen relevance on CPUs by being less efficient for running on GPUs.

CryptoNight’s performance has high sensitivity to memory latency, as it incorporates a loop in which memory write operations and related read operations take place repeatedly. This memory-intensive work affects the choice of hash function for delivering the relevant block solution output later.

Another main element of the algorithm’s design was to ensure the working data remains at the same size as the latest CPUs’ shared cache memory per core. Compared to normal system DRAM (or VRAM in the case of GPU), this memory is incredibly low latency. As a result, it leads to a major efficiency advantage when operating CryptoNight, as opposed to with a GPU.

For Monero, the developers behind the scenes have chosen to implement replacement variations of CryptoNight, with new blockchain protocol versions. This tweaks things a little, disrupting the work of ASIC specialists — as ASICs can’t be reprogrammed once the manufacturing is complete.

Monero RandomX Algorithms

A hard fork of Monero led to the introduction of a new mining algorithm to the network: RandomX. This was made to increase the prevalence of CPU mining, while still reducing GPU miners’ impact and removing ASICs from the Monero network.

RandomX is said to offer a longer-term solution for eliminating ASICs from the Monero network. This Proof-of-Work algorithm delivers ASIC resistance through random code execution and memory-hard techniques. The random code execution makes figuring device configuration out harder for ASIC producers.

As well as this, because ASICs usually struggle to implement RAM into their systems due to the high price, the memory-hard techniques make it harder.

It’s also crucial to consider that the new RandomX algorithm has been optimized for general purpose CPUs, which means it’s more optimized for the CPU inside your computer. If you look at the table below, you can see the level of improvement on CPU mining the optimized algorithm makes.

The CNv4 displays the hash rate taken from the previous CryptoNight version with the ‘fast mode’ (used for mining) and ‘light mode’ (used for verification) showing the hash rate for the latest RandomX.