In Venezuela, home to some of the worst hyperinflation since the Weimar Republic, a Big Mac costs about half a month’s wages. Or rather, it did, until a bread shortage forced the burger off the menu. The annual inflation rate is expected to hit 1,600 percent. Life resembles an old newsreel: long lines, empty shelves, cashiers weighing stacks of bills.

To survive, thousands of Venezuelans have taken to minería bitcoin—mining bitcoin, the cryptocurrency. Lend computer processing power to the blockchain (the bitcoin network’s immense, decentralized ledger) and you will be rewarded with bitcoin. To contribute more data-crunching power, and earn more bitcoin, people operate racks of specialized computers known as “miners.” Whether a mining operation is profitable hinges on two main factors: bitcoin’s market value—which has hit record highs this year—and the price of electricity, needed to run the powerful hardware.

Electricity, it so happens, is one thing most Venezuelans can afford: Under the socialist regime of President Nicolás Maduro, power is so heavily subsidized that it is practically free. A person running several bitcoin miners can clear $500 a month. That’s a small fortune in Venezuela today, enough to feed a family of four and purchase vital goods—baby diapers, say, or insulin—online. (Most web retailers don’t ship directly to Venezuela, but some Florida-based delivery services do.)

Under these circumstances, a miner starts to look a lot like an ATM. Professors and college students have mined bitcoin; so, rumor has it, have politicians and police officers. It has become a common currency even among non-miners: Peer-to-peer online exchanges (think Venmo, but with cryptocurrency) allow everyone from shopkeepers to a former Miss Venezuela to buy and sell with bitcoin.

But recently, Maduro has begun cracking down on mining operations, apparently finding in them a convenient political scapegoat—much as he calls those who seek to profit off inflation “capitalist parasites.” Yet trading bitcoin is still condoned. It’s as if Maduro realizes that cryptocurrency is one of the few things holding the country together.

Because Venezuela has no cryptocurrency laws, police have arrested mine operators on spurious charges. Their first target, Joel Padrón, who owns a courier service and started mining to supplement his income, was charged with energy theft and possession of contraband and detained for 14 weeks. Since then, other bitcoin rigs have been seized—and, in many cases, rebooted by corrupt police for personal profit. As a result, Padrón told me, many people have stopped mining. But Rodrigo Souza, the founder of BlinkTrade, which runs SurBitcoin, a Venezuelan bitcoin exchange based in Brooklyn, says that for others, the temptation is still too great to resist. “People haven’t stopped mining,” he told me. “They’ve just gone deeper underground.”

Venezuela’s most resourceful miners, in fact, are moving on to a new inflation-buster: the cryptocurrency ether (ETH). The profit margins are higher and, more important, the risk factor is much lower. “Mining ETH or bitcoin is pretty much the same principle: using free electricity to generate cash,” one Venezuelan miner told me. “But ETH mining is more affordable—all you need is free software and a PC with a video card. Any police officer is easily fooled into thinking your ETH miner is just a regular computer.”

And so, as the presses churn out worthless bolivares, the miners carry on, tapping into the power grid, turning electrons into dollars.