惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

A
About on SuperTechFans
WordPress大学
WordPress大学
雷峰网
雷峰网
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
Latest news
Latest news
Spread Privacy
Spread Privacy
T
Threat Research - Cisco Blogs
T
Tor Project blog
博客园 - Franky
U
Unit 42
K
Kaspersky official blog
博客园_首页
G
GRAHAM CLULEY
美团技术团队
I
Intezer
T
The Exploit Database - CXSecurity.com
P
Proofpoint News Feed
Engineering at Meta
Engineering at Meta
The Hacker News
The Hacker News
B
Blog
云风的 BLOG
云风的 BLOG
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
S
Securelist
Last Week in AI
Last Week in AI
F
Fortinet All Blogs
N
Netflix TechBlog - Medium
M
MIT News - Artificial intelligence
Martin Fowler
Martin Fowler
Schneier on Security
Schneier on Security
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
S
SegmentFault 最新的问题
W
WeLiveSecurity
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
J
Java Code Geeks
Cyberwarzone
Cyberwarzone
爱范儿
爱范儿
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
The GitHub Blog
The GitHub Blog
S
Security @ Cisco Blogs
GbyAI
GbyAI
P
Proofpoint News Feed
D
Docker
D
DataBreaches.Net
aimingoo的专栏
aimingoo的专栏
博客园 - 司徒正美
T
Tenable Blog
V2EX - 技术
V2EX - 技术
The Register - Security
The Register - Security
V
Vulnerabilities – Threatpost
B
Blog RSS Feed

Hacker News: Best

madhadron - The seven programming ur-languages GitHub - smol-machines/smolvm: Tool to build & run portable, lightweight, self-contained virtual machines. I Measured Claude 4.7's New Tokenizer. Here's What It Costs You. Introducing Claude Design by Anthropic Labs It Is Time to Ban the Sale of Precise Geolocation The creative software industry has declared war on Adobe Isaac Asimov: The Last Question Newly unsealed records reveal Amazon’s price-fixing tactics, California attorney general claims Clojure - Documentary Android CLI and skills: Build Android apps 3x faster using any agent Qwen3.6-35B-A3B on my laptop drew me a better pelican than Claude Opus 4.7 Codex for almost everything Introducing Claude Opus 4.7 Qwen Studio The Future of Everything is Lies, I Guess: Where Do We Go From Here? Virginia Bans Sale of Geolocation Data YouTube now lets you turn off Shorts Burgers | マクドナルド公式 ChatGPT for Excel Ask HN: Who is using OpenClaw? Live Nation illegally monopolized ticketing market, jury finds Google Broke Its Promise to Me. Now ICE Has My Data. Open Source Isn't Dead. The Future of Everything is Lies, I Guess: New Jobs Unexpected €54k billing spike in 13 hours: Firebase browser key without API restrictions used for Gemini requests IPv6 – Google Your Backpack Got Worse On Purpose Good sleep, good learning, good life Fixing a 20-year-old bug in Enlightenment E16. Does Gas Town 'steal' usage from users' LLM credits & paid services to improve itself? Tell HN: Fiverr left customer files public and searchable Cybersecurity Looks Like Proof of Work Now Getting the Flock out Release OpenSSL 4.0.0 · openssl/openssl Internet será irrespirable los días de fútbol y otros deportes. Telefónica extiende los bloqueos a Champions, tenis y golf. Automate work with routines - Claude Code Docs The Future of Everything is Lies, I Guess: Work Thousands of rare concert recordings are landing on the Internet Archive — listen now What is jj and why should I care? Backblaze has quietly stopped backing up your data Cal.com Goes Closed Source: Why AI Security Is Forcing Our Decision | Cal.com - Scheduling Software for Online Bookings Codex Hacked a Samsung TV The Future of Everything is Lies, I Guess: Safety GitHub - sterlingcrispin/nothing-ever-happens: Polymarket bot that buys "No" on all non-sports markets. For entertainment only, mostly a meme. Make tmux Pretty and Usable - Ham Vocke Microsoft isn't removing Copilot from Windows 11, it's just renaming it Servo is now available on crates.io - Servo aims to empower developers with a lightweight, high-performance alternative for embedding web technologies in applications. We May Be Living Through the Most Consequential Hundred Days in Cyber History, and Almost Nobody Has Noticed All elementary functions from a single binary operator 奈拜提耶市 Seven countries now generate 100% of their electricity from renewable energy Pro Max 5x Quota Exhausted in 1.5 Hours Despite Moderate Usage Tell HN: docker pull fails in spain due to football cloudflare block Bring Back Idiomatic Design @adlrocha - How the "AI Loser" may end up winning Apple update turns Czech mate for locked-out iPhone user Cache TTL silently regressed from 1h to 5m around early March 2026, causing quota and cost inflation The peril of laziness lost AI Will Be Met With Violence, and Nothing Good Will Come of It Center for Responsible, Decentralized Intelligence at Berkeley The disturbing white paper Red Hat is trying to erase from the internet – OSnews The Future of Everything is Lies, I Guess: Annoyances 447 Terabytes per Square Centimetre at Zero Retention Energy: Non-Volatile Memory at the Atomic Scale on Fluorographane Show HN: Pardonned.com – A searchable database of US Pardons 20 Years on AWS and Never Not My Job Artemis II crew splashes down near San Diego after historic moon mission Molotov Cocktail Is Hurled at Home of Sam Altman, OpenAI’s CEO France to ditch Windows for Linux to reduce reliance on US tech On filing the corners off my MacBooks Installing every* Firefox extension Chimpanzees in Uganda locked in vicious 'civil war', say researchers linux/Documentation/process/coding-assistants.rst at master · torvalds/linux GitHub - callumlocke/json-formatter: Makes JSON easy to read. A compelling title that is cryptic enough to get you to take action on it GitHub - Keychron/Keychron-Keyboards-Hardware-Design: Industrial design files for Keychron keyboards and mice. 100+ models with CAD assets in STEP, DXF, DWG, and PDF. Source-available, with commercial use allowed for original compatible accessories within the license terms. [ANNOUNCE] WireGuardNT v0.11 and WireGuard for Windows v0.6 Released 1D-Chess Helium Is Hard to Replace FBI used iPhone notification data to retrieve deleted Signal messages Microsoft suspends dev accounts for high-profile open source projects Why you can’t trust Privacy & Security Serenity Forge (@serenityforge.com) A new trick brings stability to quantum operations OpenAI Backs Bill That Would Limit Liability for AI-Enabled Mass Deaths or Financial Disasters Netflix Prices Went Up Again – I Bought a DVD Player Instead DOJ Wants to Scrap Watergate-Era Rule That Makes Presidential Records Public EFF is Leaving X How NASA built Artemis II’s fault-tolerant computer Meta removes ads for social media addiction litigation How Pizza Tycoon simulated traffic on a 25 MHz CPU Claude mixes up who said what, and that's not OK Reallocating $100/Month Claude Code spend to Zed and OpenRouter Help Keep Thunderbird Alive! Why Are Flock Employees Watching Our Children? The Pentagon Threatened Pope Leo XIV’s Ambassador With the Avignon Papacy Fragments: April 2 Native Instant Space Switching on MacOS Bitcoin miners are losing $19,000 on every BTC produced as difficulty drops 7.8% God sleeps in the minerals Apple Silicon and Virtual Machines: Beating the 2 VM Limit
How Monero’s proof of work works
2026-05-04 · via Hacker News: Best

Monero’s proof of work is called RandomX.

Monero does not ask miners to run the same tiny hash function over and over. It asks them to run a small random program on a virtual machine, hit memory hard while doing it, and then hash the result.

Bitcoin’s proof of work is great for specialized chips because the work never changes. RandomX was built to do the opposite. It tries to make efficient mining look as much like a normal CPU workload as possible.

Short version

Here is the shortest useful summary:

  1. Monero takes the candidate block header plus a nonce.
  2. It also uses an older block hash as a medium-term key.
  3. That key builds a large shared memory dataset.
  4. The candidate block input is hashed to create a seed for a special virtual machine.
  5. The VM runs integer math, floating-point math, branches, and lots of memory accesses across 8 chained programs.
  6. The final machine state is hashed into a 256-bit output.
  7. If that output is below the network target, the block is valid.

The interesting part is not the yes-or-no rule at the end. Every proof-of-work system has that. The interesting part is how Monero makes each hash attempt expensive in the exact ways normal CPUs are good at and custom chips hate.

Why Monero does not use a simple hash

If your proof of work is just “run this fixed function on new inputs until you get a lucky output,” hardware designers have a clear job: build silicon that runs that exact function as cheaply and as fast as possible.

That is what happened to Bitcoin with SHA-256 ASICs.

Monero did not want that path. Long before RandomX, the project was explicit that specialized mining hardware creates centralization pressure. Fewer manufacturers matter more. Large farms matter more. Ordinary users matter less.

Monero’s earlier answer was the CryptoNight family. Later, in late 2019, Monero switched to RandomX, which its own release notes described as a new proof of work “based on random instructions, adapted to CPUs.”

So the design target changed from make memory matter to make a whole CPU matter.

The core idea behind RandomX

RandomX starts from one observation: CPUs are not just arithmetic boxes. They are flexible machines built to run changing code and juggle a lot of hardware features at once.

A modern CPU has:

  • multiple cache levels
  • integer units
  • floating-point units
  • branch handling
  • out-of-order execution
  • speculative execution
  • memory controllers

Normal cryptographic hashes do not use much of that variety. They mostly push data through a fixed pipeline.

RandomX tries to bind proof of work to those broader CPU strengths. Its design document says the work must be dynamic. That means the miner is not just feeding in new data. The miner is also getting new code to run.

That is why RandomX is based on random code execution.

What a miner is actually computing

At the Monero level, RandomX takes two important inputs:

  • a key K
  • a hashing input H

For Monero, K comes from an older block hash, called the key block. The RandomX reference README recommends changing this key every 2048 blocks with a 64-block delay, and that is how Monero wires it in.

That detail matters because miners do not rebuild the heavy shared memory structures for every nonce. They rebuild them only when the key changes, roughly every 2.8 days.

H is the candidate block hashing blob with a chosen nonce. That is the part miners keep changing over and over.

So you can think of Monero mining like this:

  • the network gives you a medium-term environment through K
  • your candidate block gives you a per-attempt input through H

The environment changes slowly. The attempt changes constantly.

Step 1: build the cache from the key

RandomX first takes the key K and runs Argon2d on it.

Argon2d is better known as a password-hashing and key-derivation function. It is useful here for the same reason it is useful there: it is memory-hard. It forces the machine to touch a lot of memory in a way that is annoying to cheat.

In the default RandomX parameters, this produces a 256 MiB cache.

That cache is the smaller of the two big memory structures in RandomX. It is not the structure miners want to use directly for maximum speed. It is the structure used to build the bigger one.

Step 2: expand the cache into the dataset

From that 256 MiB cache, RandomX builds the dataset.

The default dataset size is:

  • 2,147,483,648 bytes base size
  • 33,554,368 bytes extra size

Together that is about 2080 MiB, a little over 2 GiB.

This odd-looking size is deliberate. It is big enough to spill out of on-chip memory and into DRAM, and the extra non-power-of-two tail makes life more annoying for hardware designers.

The dataset is read-only during hashing. RandomX uses it to force regular DRAM traffic. The design doc says each program iteration reads one 64-byte dataset item, and across a whole hash result that becomes 16,384 dataset reads.

That gives RandomX one of its main bottlenecks: memory access, not just arithmetic.

Step 3: initialize the scratchpad from the block input

Now RandomX turns to the per-hash input H.

It computes Hash512(H) using Blake2b. That 64-byte result seeds an AES-based generator, which fills the scratchpad.

The scratchpad is the VM’s working memory. Unlike the large dataset, it is meant to live in CPU cache, not DRAM.

Its default size is 2 MiB, split to mimic CPU cache levels:

  • 16 KiB L1
  • 256 KiB L2
  • 2 MiB L3

This is one of the smartest parts of RandomX. It uses two very different memory structures at once:

  • a big dataset to hit DRAM
  • a smaller scratchpad to behave like cache-heavy code

That lets it pressure both the memory subsystem and the CPU core.

Step 4: generate a random program

After the scratchpad is ready, RandomX generates a program for its virtual machine.

This is not a C program or a JavaScript program. It is a compact VM program with its own instruction set.

Two details matter a lot:

  1. Every instruction is 8 bytes long.
  2. Any 8-byte word is a valid instruction.

That second choice is a big deal. It means RandomX can generate programs by just filling a buffer with random bytes. There is no slow parser and no complicated syntax checking.

Each program contains 256 instructions.

Those instructions are chosen to look like work real CPUs are built for:

  • integer math
  • 64-bit multiplies
  • floating-point operations
  • 128-bit vector operations
  • memory loads and stores
  • occasional branches

The floating-point side is not cosmetic. RandomX uses IEEE 754 double precision operations, including division and square root, and it uses all four standard rounding modes. That makes the VM harder to collapse into a tiny “mostly integer” custom design.

Step 5: run the program loop

The VM executes the 256-instruction program in a loop for 2048 iterations.

During each iteration it:

  • reads and writes scratchpad memory
  • prefetches and loads dataset items
  • mixes integer and floating-point register state
  • takes a low-probability branch when the condition says so

The design doc says an average iteration reads about 504 bytes from memory and writes about 256 bytes.

That number is a clue to what RandomX is really doing. It is not “a hash with extra steps.” It is trying to behave like messy, mixed, real software.

Why the branches are there

Branches are easy to overlook, but they matter.

If the code were fully straight-line, specialized hardware could optimize away more of it. Branches make static simplification harder.

RandomX uses branches sparingly. A branch is taken with probability about 1/256, and the design intentionally makes these branches usually predict as “not taken.” That means they are cheap on CPUs most of the time, while still getting in the way of over-optimized hardware shortcuts.

The important point is not that RandomX found some magic branch predictor trick. It did not. The point is that even a little real control flow makes the workload look more like actual code and less like a clean hardware pipeline.

Why there are 8 chained programs per hash

One random program is not enough.

If miners only had to run a single random program, a dishonest miner could try to inspect the program first and skip “bad” ones. Or a custom chip designer could support only the subset of programs that are easy for their hardware.

RandomX blocks that by chaining 8 programs together.

The output state of one program becomes the seed for the next. So once you start, you cannot know the whole chain in advance. You either finish the chain or throw away work you already paid for.

This is one of the cleanest ideas in RandomX. It turns “maybe I will only do the easy jobs” into a bad strategy.

Step 6: collapse the final state into a hash

After the last of the 8 programs finishes, RandomX still has to turn all that machine state into one final digest.

It does two things:

  1. It fingerprints the whole scratchpad with an AES-based hash.
  2. It combines that with the VM register file and runs a final Blake2b-based 256-bit hash.

That final 256-bit result is the RandomX output.

At the Monero level, the miner checks whether that result is below the current difficulty target. If yes, the block wins. If no, the miner changes the nonce and tries again.

Fast mode and light mode

RandomX has two modes:

  • fast mode, which uses the full 2080 MiB dataset
  • light mode, which uses only the 256 MiB cache and computes dataset items on the fly

Both modes give the same answer.

Verification has to agree with mining, but the two modes do not cost the same amount of work.

Fast mode is for mining. Light mode is for verification. The reference README says exactly that, and this split is one of RandomX’s best design choices.

If every verifier needed more than 2 GiB just to check one proof of work, that would be ugly. If light mode were cheap enough to mine competitively, that would also be ugly. RandomX tries to stay in the middle: verification should be practical, but not attractive as a mining shortcut.

The design document explicitly aims for light mode to lose on the memory-time tradeoff. In plain English, if you save memory, you should pay back that advantage in extra work.

Why this is CPU-friendly

“CPU-friendly” can sound like marketing, so it is worth being specific.

RandomX favors CPUs because it leans on the things good CPUs already have:

  • large caches
  • decent DRAM bandwidth
  • hardware AES
  • fast 64-bit math
  • floating-point hardware
  • out-of-order execution
  • dynamic code generation

The reference implementation even includes JIT compilers for x86-64, ARM64, and RISCV64, so the VM programs can be translated into native machine code on the fly instead of being interpreted instruction by instruction.

That does not make ASICs impossible forever. Nothing honest should claim that. What it does is make the custom-chip job much uglier. A good RandomX ASIC starts looking less like a neat fixed-function hash engine and more like “build a weird expensive CPU with a lot of memory attached.” That shrinks the advantage.

What RandomX is trying to buy Monero

RandomX is not mainly about raw speed. It is about hardware economics.

Monero wants proof of work that:

  • keeps mining more open to ordinary hardware
  • reduces the edge from fixed-function ASICs
  • avoids tying consensus to a few hardware vendors
  • stays reasonably cheap to verify

That is why RandomX looks so strange if you expect a normal mining hash.

It is not trying to be elegant in the Bitcoin sense. It is trying to be awkward for specialization.

The simplest way to think about it

If Bitcoin mining is “run this one small machine forever,” Monero mining is “keep generating little CPU-flavored workloads and survive the memory traffic.”

That is the shortest mental model I know that is still true.

Under the hood, RandomX is a stack of careful choices:

  • Argon2d to build a cache
  • a 2 GiB-plus dataset to force DRAM access
  • a cache-sized scratchpad to exercise local memory
  • a VM with random programs
  • integer, floating-point, vector, and branch instructions
  • 8 chained programs to stop easy-program filtering
  • a fast mode for miners and a light mode for verifiers

Put those together and you get Monero’s proof of work today.

It is not simple. But the point is simple: make mining look like general-purpose computing, so specialized hardware gets less room to run away with the network.