RandomX in Javascript (web mining?)
https://github.com/l1mey112/randomx.js/
Bitcoin with RandomX (agentic cash?)
It is hilarious.
https://da-data.blogspot.com/2014/08/minting-money-with-mone...
The history of people trying to design GPU or ASIC-resistant proof-of-work functions is long and mostly unsuccessful. I haven't looked into RandomX; it's possible they've succeeded here (or possible that with the alt-coin market mining profitability tanking after Ethereum moved to proof-of-stake, it just wasn't worth it).
Are cryptocurrencies supposed to be a potential replacement for real life cash? This was my understanding of the motivation behind Bitcoin, at least.
If so, why does it make sense that people can "generate" cash by proving some amount of work done? This of course cannot be done with normal cash.
Is the main functionality of these cryptocurrencies supposed to be "people can send currency to each other", or "people generate currency -- a number -- and sell this currency for real life money"?
For a state or central bank the answer is obvious: The state or bank itself prints it.
For a private actor the technical means is perhaps less obvious, but the actor behind the currency obviously gets to decide.
For a decentralized open source project, it is less clear. You could do it so every node in the system gets a piece of every newly printed unit of currency, but if it is free to run a node everyone could just run a billion nodes and take all the currency for themselves.
Bitcoin solved the problem with Proof of Work, which is elegant because both the double spend problem and the minting problem is solved together. Every node has to prove it has run a unit of useless computation and inflation is spread evenly across worker nodes. This led to a split between nodes and miners with the use of specialized hardware, but the basic premise still holds.
Crypocurrencies in general are very different. Ethereum, the second most popular, was created by a private actor and the that actor decided to print 72 M for themselves and promptly sold 80+% before the release of the software which gave rise to the term ICO which was very trendy for several years. After the initial release inflation continued according to the miner model.
They are supposed to be a medium of exchange. “Real life cash” is one of many forms of money; even for any particularly currency, like dollars, a very small fraction of use is “real life cash”. But, yes, in the most extreme visions, cryptocurrencies replace other currencies for all uses. More moderate visions, however, exist. So, as always when you use “supposed”, the answer is undefined without qualifying it as to by whom it is supposed.
> If so, why does it make sense that people can "generate" cash by proving some amount of work done?
Because there needs to be some mechanism to provide the currency supply, and also some incentive for people to provide the infrastructure on which the currency system relies. For fiat money systems the first is typical policy making in a central bank, and the second is government action to control competition in the banking space and to support banks, reinforcing the profitability of banks. Mining serves both of those functions in a cryptocurrency system (both reinforcing the profitability of transaction network participants and providing the mechanism by which currency supply is managed.)
> Is the main functionality of these cryptocurrencies supposed to be "people can send currency to each other", or "people generate currency -- a number -- and sell this currency for real life money"?
Participants in a currency system selling it for other currencies (FOREX) is a feature of every currency system in a world with more than one currency. Again, the degree to which each of those is “supposed” to be the main function depends on exactly whose supposition you are looking at it.
Cryptocurrencies allow market participants to communicate value to each other without having to trust other market participants or an institution. Mining verifies transactions and commits them to the public record, earning the miner a fee for their work.
But solving the problem of how to transfer value trustlessly and anonymously, instantly anywhere in the world is one of the biggest breakthroughs since the Internet.
Amazing how in a few short years kids started growing up with Bitcoin and don't understand how it work or why it exists :(
I'll add that there was such a large influx of miners at the outset, that (statistically) it seems any crippling of the original algorithm was fairly futile - the edge was both short-lived and minimally impactful. We're over a decade later, and nobody mining in the first month (even with that unfair advantage) was able to gain any meaningful percentage of Monero's emission.
I'll add that RandomX has proven that it is indeed possible to create a GPU and ASIC-resistant PoW algorithm. I'd encourage you to dig in further - the closest to an "ASIC" is a multi-CPU miner (Bitmain X9) with a bunch of RISC-V CPUs in it.
----
To anybody else that is syncing a fresh monero blockchain copy (i.e. installing the official client), I recommend using the custom node flag ` --db-sync-mode safe ` — which is slower but corruption-avoiding — before node's initial bootup. Without safemode, any halt of the client will [most likely] corrupt the local blockchain (losing days of DL/verification).
Also, if you use an SSD for storing any blockchain (as recommended by monero team... but not by me), know that its lifespan will be greatly reduced from the constant IO/access. Personally, I recommend safemode (see above) on a 7200RPM spinner (HDDs effectively don't wear during IO/access).
----
What are your thoughts on running xmrig vs. the default getmonero.org client? Would you in general agree that monero remains ASIC-resistant?
Thank you for sharing!
The brilliant part of Bitcoin is that it uses very widely known crypto primitives - verification is the same as getting the right seed (you just happen to be told what the right seed is, rather than having to pay for it to be discovered).
The big flaw of Bitcoin, to my mind, is that it is an inherently deflationary currency. Deflation is one of those things that seems great on the surface: prices go down, not up, but when that happens it ends up creating an economic incentive to avoid spending since why buy something today if it will be cheaper tomorrow, and this ends up causing economic activity to slow down or stop entirely. A small amount of inflation, on the other hand creates an incentive to either spend money or invest it in something that will provide a better than inflation return, whether that’s putting it in a high-yield savings vehicle or making capital or financial investments. With deflation, you can just leave your funds in cash (where they will not provoke any economic growth) and get a return.
This is how money works. If you use a medium of exchange and unit of account for goods and services then that medium must increase at the same rate as the increase in goods and services otherwise you get second and third order effects such as inflation, contraction, rising unemployment, etc., directly impacting its ability to act as a unit of account.
In Bitcoin you don't generate cash, you earn block rewards for acting as a consensus broker which otherwise would require a central banking settlement layer. This activity, tied directly to the transaction layer, acts to maintain the equilibrium between increases in goods and services and expansion of the money supply.
Wall Street got ahold of it and now Bitcoin is primarily acting as a Store of Value for the purpose of speculative investments. Driven primarily by the fear of missing out and market manipulation since Bitcoin is heavily centralized.
Because it was written by Bram Cohen, I'd be interested in reading two or three sentences about how it collapsed.
Because it's a blockchain-based cryptocurrency, feel free to stop writing after three or four sentences.
(To be clear: We were just optimizing mining; in the process of looking for ways to mine it faster, I found some security bugs and fixed them. We weren't exploiting the bugs, that crosses a line for me.)
Most cryptocurrencies, if we go only by their number, are designed to make their creators rich and moderately succeed at that. This is your ERC20s, pump dot fun, et cetera.
If we only consider ones that have any serious chance of being usable as actual currencies, these days they're usually designed to run arbitrary money-like programs known as "smart contracts", of which traditional money is just one.
Money can't be sent until it's generated, that's the same whether you're talking bitcoin or dollars. There's always a rule for who gets the new money when it's created, and somehow the rule always ends up being "rich people get the new money". Dollars go to politicians and big bankers, bitcoins go to big compute farms, ethers go to big bankers, monero goes to big compute farms. The aforementioned get-rich-quick currencies go to their creators, if course.
https://old.reddit.com/r/Monero/comments/1h6e4nk/randomx_5_y...
Most miners use AMD Ryzens. Couldn't tell you the actual breakdown of CPU types in use. Apple's M series CPUs are quite efficient at it too. Bitmain now sells a "Monero RandomX Mining ASIC" which is just a bunch of RISC-V cores, seemingly based on Sophon SG2042 SOCs. There's nothing special or more cost-effective about their product.
You can mine on old smartphones quite easily. I use a bunch of old Android TVboxes myself. Their hashrates are nothing to crow about, but their hashes/watt are still competitive with faster CPUs.
There is a RandomX V2 that will be deployed soon. Its main improvement is even cheaper verification cost.
But it's still mostly about the speculation, it seems.
But be careful about "proven" in that last sentence - the absence of a solution isn't exactly proof, it's more of a proof that _either_ it is possible to create an ASIC-resistant algo _or_ it has not been worthwhile to ASIC-ify it given the economics of mining XMR and the research & NRE required to do so. I haven't the foggiest which of those two it is, mind you, just that there are a few remaining valid explanations.
Would be curious if the marginal savings from a heat pump would allow you to buy more monero than you mine with this energy.
Think of it this way: If you pay with physical cash, there are people somewhere who do the work of digging ore out of the ground, smelting it, shaping it into coins, cutting and printing paper and so on. All these people do that, because they get paid in the same currency that they themselves have minted.
It turns out that nobody has yet found a way to create a digital decentralized currency that that works without incorporating a similar concept of incentivizing the creation of currency.
It might lead to scenarios where a miner may optimise block generation itself, I guess?
I was more curious about the possibility of generating optimised branchless variants and then running them in parallel on multiple ASICs to ensure you cover every branch and submit all the results and hope you’re fast? Would that be more inefficient than relying on branch prediction and CPUs?
Just as an example, aave lost 295 million last month due to a hack in another protocol, and nothing was posted here.
1. Illegality 2. Speculation (i.e., gambling)
So yes, +1. :-(
I was interested in Monero because it actually was what people thought Bitcoin was.
In this case the claim was ASIC-resistant PoW is possible, and the proof has been the historical behavior of miners after years of RandomX. Nobody said it would be eternally or entirely resistant to optimizations...
Fractional reserve banking. Basically, bankers start getting very anxious when they see the masses of people depositing mountains of cash into them. They look at the cash hoard they have suddenly amassed and think, we can't just leave this pile of cash here doing nothing, we have to efficiently allocate all of this capital. So they lend it out to people who need cash, charge interest and pay account holders their yields.
Deposit $100. Bank loans out $90, and $10 sits in its reserves. Your account still says $100, even though the bank is now leveraged against loans to third parties. Guy who took the $90 loan pays some bills, and that $90 ends up deposited right back into the same bank. So it keeps $9 and loans out $81. There is now $100 + $90 + $81 in circulation, but only that $100 is real money, the rest are all made up. They only become real when loans are repaid. So, the $81 gets spent, deposited back into the bank, and so on, and so forth, expanding the money supply like a fractal until the amounts become too infinitesimal to track. Thus $1,000 easily becomes $100,000.
Banks are the financial call stacks of society. Better hope there aren't any exceptions (defaults), or the whole thing unwinds and comes crashing down.
It's like a society wide financial version of ISP overprovisioning. The assumption is nobody is going to stress test the system by saturating the link 24/7. Everything breaks the second the invariants are violated. Banks similarly assume that not everybody will need all of their dollars immediately, which lets them "efficiently allocate" all of those dollars. Entire government systems exist just to bail out the banks where this assumption fails to be load bearing.
And this also makes it hard to generate favorable programs.
Point is, it's a currency you can use right now independently from the increasingly unstable-looking US dollar.
You could also use euros, yuan, rupees, or Australian dollars but it's really hard to get an account in those currencies if you don't live in those countries. Crypto is much easier to get access to.
Free speech is for all the stuff you personally detest and personally choose to avoid. In a free country you hold your nose and allow others to engage in it.
If money is speech, then having a kind of money that doesn't pass through policy gates is an essential component of a free society.
I can use my compute and energy how I like, whether that’s for AI or crypto or a Minecraft server. You don’t have a right to call one “wasteful” and one not
A good example was the truck manifestation in Canada a few years ago, they went after all the donors for what was a legitimate protest. Anyone using bank transfers or any crypto that wasn't Monero was persecuted.
Those who used Monero had their privacy assured and zero issues.
[†] It's an older model, without reversing valve (circa early-2000s).
[ƒ] ...and refrigerator (thanks /u/twic)
----
>if the marginal savings from a heat pump would allow you to buy more monero than you mine with this energy.
In a colder climate, DEFINITELY (to a point: see /u/nerdsniper's great point, below).
----
I replaced a 300W "toe heater" with this rig; by directing heat to only wear its needed (i.e. muh'toes), I can heat the entire house less (whether resistive or heatpump).
Particularly on its initial sync, Monero's daemon is flakeyAF.
If you (e.g.) don't allow `sync in background` (why is this not the default behavior?!), the official Monero client is notorious for locking up on wakeup. Once you kill the process, your local blockchain is [most likely] unusable.
Another reason to use safe-sync is (e.g.) if your system (Linux or whatnot) decides to update/restart during the several days it takes to sync-initially.
----
Just out of curiosity, why do you abuse an SSD so (safe-mode, or not)?
For SSD-diehards, I'd recomment getting a very large size because this'll last longer, presuming the drive self-levels.
Block rewards have no connection to transaction volume or economic activity, the protocol is designed such that bitcoin supply increases at a predictable (and diminishing) rate. Bitcoin is deflationary by design, which is one of the major issues that stopped it from becoming anything other than a speculative store of value.
Insomuch as beanie babies are a store of value. Speculative assets only have value as long as there are more greater fools to buy in. When you've exhausted the supply of greater fools, there is no more reason to buy the speculative asset because its price won't go up, so it will fall to its intrinsic value, which is the worth of a normal stuffie for a beanie baby (roughly $5) or the worth of a number stored on other people's disks for a Bitcoin (roughly $0), which is the value ultimately stored. Wall Street is only involved in Bitcoin to facilitate trade between fools because we have collectively done a poor job of regulating this madness, allowing so many fools to eventually lose their money to a distributed Ponzi scheme and sanctioned countries.
The assumption behind the “deflation is bad” argument is that spending itself is the goal. But spending is not automatically good. Productive spending and productive investment are good. Wasteful consumption, speculation, and forced risk-taking are not.
If money holds its value, people become more selective. They still buy food, housing, tools, entertainment, experiences, and things they genuinely want. Humans have needs, preferences, status impulses, advertising pressure, and finite lives. Demand does not disappear just because money is sound. What disappears is some of the artificial urgency to spend before your cash loses value.
The more important point is investment. In an inflationary system, holding money is punished, so everyone is pushed out onto the risk curve. You are not only investing because an opportunity is great; you are investing because the currency is being diluted and you need to escape it. That distorts the real cost of capital and makes mediocre investments look better than they are in nominal terms.
With harder money, investment has to beat the return of simply holding the money. That is a healthy hurdle rate. Capital should have to prove that it creates real value. If an investment only makes sense because the denominator is being debased, or because everyone is forced into assets to avoid inflation, then maybe that investment was not as productive as it looked.
This also matters for inequality. Inflation does not hit everyone equally. People with capital can protect themselves by owning stocks, real estate, ETFs, businesses, and other assets. They can diversify, borrow against assets, and ride asset inflation. Poorer people are more likely to hold wages and cash, so they are the ones whose purchasing power gets diluted first. Then they are told to “just invest,” but they are competing against people who already have capital, better access, better tax treatment, and more room to take risk.
So inflationary money quietly forces the poor to compete with the rich on the rich person’s playing field: asset ownership. A broad ETF may look like a safe wealth-preservation tool for someone with money, but for someone living paycheck to paycheck, the need to buy risk assets just to avoid being diluted is itself a problem.
A deflationary or hard-money system would probably reduce some marginal consumption and speculative investing. But that is not obviously bad. It may mean fewer bad investments, less artificial asset inflation, and more pressure for capital to flow only into things that genuinely outperform money itself. It would also be much more sustainable, not just economically but materially: if money no longer pressures everyone to consume and invest constantly just to outrun debasement, there is less incentive to waste real-world resources on unnecessary production, overconsumption, and short-lived goods.
The fear is that nobody would spend. But people do not stop buying things just because they expect their money to hold value. They stop buying things that are not worth giving up good money for. That sounds like discipline, not economic failure.
And who's gonna admit that bitcoin is a ponzi scheme when all of their savings are in it? you can't, it would devalue your own money, so you're trapped, you can only further invest in it.
Can't say I like crypto, but I think better arguments can be made against it.
Personally, I'm going to look into RetoSwap, but I appreciate Kraken sticking it out keeping it listed. I might not have gotten any Monero if not for Kraken.
We are 15y in and there is still no trace of a meaningful use case outside of the ones I mentioned. I don’t think it’s a failure of bitcoin itself (it’s a neat proof of concept), I see it more as a complete delusion of people pushing cryptocurrencies
Wrong, in a 'deflationary' system the more a rich person holds money in proportion to the total money the less interest they are likely to extract/get. If they hold all the money interest they will be effectively get/extract will be zero.
Also wall street never considered it seriously until a few years ago.
I can have a computer on an endless loop without any idling, consuming as much CPU time as it can, I do not know any other classification of this action than wastefulness. crypto mining is useful of course, the end goal of mining is to get crypto, of course, there is no further goal beyond that.
Well, for now. Obviously it can't reduce forever, and it will eventually slam back up to infinity (bitcoin will collapse) when no normal person feels like it's worth getting any because so much of it is already owned by wealthy people. Until that happens we're surfing the Ponzi wave. Inflationary designs are way more stable.
Bitcoin might be approaching it.
Spending shouldn't be the goal, but exchange of goods and services should be. Representation of real value should be a goal. If you can receive real goods and services as a consequence of holding numbers on a spreadsheet, instead of a consequence of providing real goods and services yourself, the economy has a problem. Maybe a system with zero inflation or very slight deflation can be stable, but the extreme deflation seen in Bitcoin is destabilising.
Actually, I suspect heating-by-monero-mining is more likely to economically beat heat pumps only in the very coldest climates. Heat pump efficiency goes down when the temperature delta between inside and outside is very large. Below 0F or so, it's quite difficult to find heat pumps that will work sufficiently well, and generally they transition to resistive heating.
Caveat: I'm only talking about marginal advantage, ignoring the capital costs of the Xeon servers or the heat pump itself.
Totally false. LMDB is perfectly crash-proof in that scenario and killing the process never damages the DB. The only thing that's not guaranteed is turning off syncs, in the face of an OS crash/power outage.
If you don't sync, you're not abusing the SSD. If you run on Windows, the OS is too unstable to use without safe sync mode though.
Courts deemed as unlawful this government persecution to whoever donated to the protest using transparent cryptocurrency: https://usethebitcoin.com/news/canadian-court-rules-against-...
The point is that only those who used monero were safe from unlawful government persecution.
As far as placement of the machine: underneath your computer desk is ideal, as this directed heating allows you to keep the house's thermostat a few degrees cooler.
----
If anybody were to ask me "what would you BUY to mine monero@home," I would definitely tell them to [instead] buy a heatpump-heater, -watertank, -&c (presuming they don't have each, already).
This is a well-documented failstate. Usually results in "unable to connect to 127.0.0.1:18081" errorlog, which is most-commonly due to a corrupt database/blockchain (from hardstop/kill).
In order of crashout likelihood: Windows >> MacOS > Linux
>If you don't sync, you're not abusing the SSD.
If you don't sync then you're not (cannot be) a fullnode / network verifyer / ringsigner.
----
>LMDB is perfectly crash-proof
It is my understanding that once your initial-sync has completed, the default monero node behavior is to then automatically enter the --safe flag (I described above).
This may be old behavior... I go way back (years beyond a decade). My only modern use in xmrworld is as a personal foot-heating ATM.
The second part is that despite these disclaimers, I don't think gold has, in modern history, or will in our lifetimes, reach a price reflecting just the use/intrinsic value. The reasons being twofold: the storage of value IS a use itself; and importantly, which applies to Bitcoin and others, there are always people that will be willing to buy the dip, which is how the requested new generation of "fools" comes from.
The artificial scarcity and lack of actual use of bitcoin really isn’t the same.
“Holding money and earning interest from holding it” is a category error. Holding Bitcoin pays zero yield. No coupon, no dividend, no debtor, no tax stream, and no mechanism by which poor people pay holders a percentage. If someone earns interest, they are not merely holding money; they are lending it, which means they are taking risk and providing capital.
The “numbers on a spreadsheet” objection is also just an objection to money itself. Money exists so someone can produce value today, save the claim, and exchange it later for real goods and services. That is not a bug. That is saving.
A non-inflationary currency is actually a better representation of real value, because the unit is not constantly being diluted. Inflationary money lets nominal wealth rise even when no real value was created. Hard money makes the test harsher: did you actually create value, or did the measuring stick just get worse?
And no, people would not “just sit on Bitcoin.” People still eat, rent, travel, build, compete, seek status, start companies, buy homes, and take risks to outperform others. The only thing that changes is the hurdle rate: an investment has to be better than simply holding money. That is not economic failure. That is discipline.
The fair criticism of Bitcoin is volatility and unequal distribution, not this imaginary mechanism where holders magically receive interest from the poor by owning spreadsheet entries. That mechanism does not exist.
EDIT: The rich/poor angle is almost backwards. In an inflationary system, holding money is a guaranteed loss, so ordinary people are forced to become amateur investors just to avoid being debased. Rich people are already positioned for that: they own assets, businesses, real estate, equities, and can borrow cheaply against them.
In a non-inflationary or hard-money system, simply holding money is not a guaranteed losing strategy. You keep your share unless you voluntarily take risk to increase it. That is a very different game. The rich can still get richer, but they have to outperform by allocating capital well, not merely by being closest to the asset-inflation machine.
Same with wages. Under inflation, your employer can cut your real salary without saying anything: they just give you a raise below inflation, or no raise at all. You have to fight constantly just to stay even.
Under hard money, that hidden pay cut is much harder. If prices are falling or money is appreciating, keeping the same nominal salary can mean your real wage rises. To reduce your real compensation, the employer has to make the cut explicit or offset it with benefits. That is a completely different power dynamic.
So no, inflation is not obviously pro-poor. Very often it is a quiet tax on people least able to escape cash and wages.
I'd accept "leaky currency" as a substitute for inflation. The important thing about inflation is that you have to keep running just to stay in one place - not that the numbers keep going up. Stable prices are nice, I agree on that.
Bitcoin's volatility is caused by its deflationary nature. Monero is inflationary, and much less volatile.
In an inflationary system, normal people are forced to keep earning money. "Becoming amateur investors" is your way to say "keep generating real value". If you want to surpass Elon Musk you have to invest, but that's nothing to do with the inflationary currency. That's because Elon Musk uses deflationary currencies like land and Ponzi currencies like Tesla stock. He just sits on them, and he will get out of the Ponzi ones before the top because he controls them. As they say, bad money drives out good. But you cannot build a stable economy on hyper-volatile gambling.
Happy to continue discussing if you'd like to reply to what I wrote.
Lettuce rotting is not an argument for money rotting. Perishable goods decay, machines depreciate, buildings need maintenance, and inventories have storage costs. Prices can reflect all of that. The measuring unit does not also need to decay.
Money is not supposed to preserve lettuce. It is supposed to preserve a claim on value across time. If I produce value today and save the proceeds, I should not be forced to lose purchasing power just because the unit of account was designed to leak.
Also, “forced to keep earning money” and “forced to become an investor” are not the same thing. In every system, people have to keep producing if they want to keep consuming. The difference is that under inflation, even after producing and saving, your savings are diluted unless you buy risk assets. That does not necessarily mean “generating real value.” Often it just means bidding up existing assets.
Bitcoin’s volatility is not simply “caused by deflation.” It is caused by uncertain demand, adoption cycles, liquidity, leverage, regulation, speculation, and the fact that it is still monetizing. A fixed supply makes price more sensitive to demand shocks, sure, but that is not the same as saying deflation mechanically causes volatility. Monero’s tail emission is also tiny, under 1% and declining over time, so it is hardly a normal inflationary currency.
And the Elon Musk example basically proves the opposite point. Rich people already escape inflation by holding scarce assets: land, equity, businesses, real estate. Poor people are the ones stuck holding wages and cash. A harder money system does not eliminate inequality, but it at least stops making cash itself a guaranteed melting ice cube.
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.
Here is the shortest useful summary:
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.
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.
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:
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.
At the Monero level, RandomX takes two important inputs:
KHFor 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:
KHThe environment changes slowly. The attempt changes constantly.
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.
From that 256 MiB cache, RandomX builds the dataset.
The default dataset size is:
2,147,483,648 bytes base size33,554,368 bytes extra sizeTogether 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.
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 L1256 KiB L22 MiB L3This is one of the smartest parts of RandomX. It uses two very different memory structures at once:
That lets it pressure both the memory subsystem and the CPU core.
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:
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:
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.
The VM executes the 256-instruction program in a loop for 2048 iterations.
During each iteration it:
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.
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.
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.
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:
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.
RandomX has two modes:
2080 MiB dataset256 MiB cache and computes dataset items on the flyBoth 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.
“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:
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.
RandomX is not mainly about raw speed. It is about hardware economics.
Monero wants proof of work that:
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.
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:
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.