Mining and RandomX
Proof-of-Work designed for ordinary CPUs
Monero uses Proof-of-Work like Bitcoin, but with the RandomX algorithm (since November 2019). RandomX generates and executes random programs on a virtual machine resembling an ordinary CPU, using ~2 GB of memory. An ordinary CPU ends up nearly as efficient as a specialised chip — which keeps mining decentralised.
Proof-of-Work in two sentences
A miner assembles a block of transactions and tries values of a nonce until the block hash is below a target. Finding such a hash is hard, checking it is easy. Difficulty is recalculated every block so a block appears on average every 2 minutes.
Why not SHA-256
SHA-256 has long had ASICs — chips that do only this and are thousands of times more efficient than a CPU. Bitcoin mining is concentrated among those who can buy ASICs and cheap electricity. Monero aimed from the start at mining on ordinary computers: first CryptoNight (changed several times by hard forks to break emerging ASICs), then RandomX.
How RandomX works
- Epoch key. Every 2048 blocks a key (the hash of an older block) is chosen. A 256 MB cache and a ~2 GB dataset are built from it.
- Random program. A program for the RandomX virtual machine is generated from the block header: integer arithmetic, floating point, conditional branches, dataset reads.
- JIT. The program is compiled to the CPU's machine code and executed. The result is the hash.
Building an ASIC for RandomX essentially means building a general-purpose processor with a big cache and fast memory — i.e. an ordinary CPU. The advantage of specialised hardware is small.
| Mode | Memory | For whom |
|---|---|---|
| Fast mode | ~2080 MB | miners |
| Light mode | 256 MB | nodes verifying blocks (slower, but enough) |
Pros and cons
+
- Anyone with an ordinary computer can mine — hashrate is spread more widely.
- P2Pool for Monero allows pooled mining without a central operator.
- Years of audits and practically no ASICs.
−
- Botnets: infected computers are "ordinary CPUs" too, and Monero mining is a popular malware target.
- Block verification is slower than with SHA-256.
- Large pools are still possible: in 2025 the Qubic pool briefly controlled a large share of hashrate and caused reorganisations — prompting discussion of extra defences.