HeadlinesBriefing favicon HeadlinesBriefing.com

Inside Monero’s CPU‑Centric RandomX Mining Algorithm

Hacker News •
×

Monero relies on RandomX, a proof‑of‑work algorithm that swaps Bitcoin’s static hash for a CPU‑friendly workload. Miners feed a candidate block header, a nonce and an older block hash (the key) into RandomX, which builds a large shared memory dataset. A virtual machine then runs a random 256‑instruction program, mixes integer and floating‑point math, and finally hashes the machine state.

RandomX forces miners to touch about 2 GiB of read‑only dataset and a 2 MiB scratchpad that mimics CPU cache levels. The dataset, derived from a 256 MiB cache generated with Argon2d, forces regular DRAM traffic, while the scratchpad is filled via a Blake2b‑seeded AES generator. Together they create memory‑hard, branch‑laden code that resists ASIC optimization, making generic processors the most efficient miners.

By rotating the key block every 2 048 blocks—roughly every 2.8 days—RandomX rebuilds its heavy memory structures only periodically, keeping per‑nonce work lightweight. This approach preserves Monero’s resistance to mining centralization and allows hobbyist users to compete with large farms. RandomX therefore exemplifies a deliberate shift toward CPU‑centric security in cryptocurrency consensus. Thus everyday processors can mine without needing exotic equipment today.