How bitcoin mining works
Share Now on:
How bitcoin mining works
Share Now on:
Although bitcoin mining doesn’t involve hard hats, soot or nonmetaphorical canaries, the noise inside the retrofitted shipping container Edward Weniger owns in Omaha, Nebraska, does kind of sound like heavy machinery boring through the center of the earth.
That noise is partly coming from the dozens of “rigs” — hot-rodded computers, basically — mining bitcoin inside.
The highest decibels are produced by what’s keeping the rigs from melting: “Just a bunch of industrial fans that kick on and kick off and are loud,” said Weniger, who rents out the space to fellow miners and does some of his own mining.
Even in Nebraska, where electricity is relatively cheap compared to other parts of the country, Weniger runs up a pretty hefty utility bill, “in the neighborhood of about $8,000 a month.”
So what exactly are those rigs doing? And why do they use so much energy that Congress is now concerned about the impact crypto is having on energy grids and carbon emissions?
To understand that, let’s walk through a simplified version of how a bitcoin transaction works.
Step 1: Don’t trust. Verify.
Robert Farrokhnia, a professor at Columbia’s Business and Engineering Schools, agreed to give me a tutoring session for the price of one hypothetical bitcoin, worth about $40,000 right now.
If I wrote Farrokhnia an old-fashioned paper check, some financial institution somewhere would have to make sure I actually had $40,000 in my account before the transaction could be processed. But bitcoin doesn’t do banks; the whole point is to avoid a centralized financial authority.
“That poses a question, and that is: If there is no central authority that we could trust to ensure the integrity of transactions, how do we go about ensuring the integrity of this decentralized system?” Farrokhnia said.
To make sure I’m not writing a bad bitcoin check, miners and other computers in the bitcoin network (these are called “nodes”) verify that a pending transaction is legitimate. Like a bank, they do this by checking a financial ledger.
But unlike Wells Fargo’s records, the bitcoin ledger is public — anyone can see it, and it can live on your computer or mine or anyone’s. This is the bitcoin blockchain. Picture about 700,000 stone tablets — the blocks — all lined up together, with every transaction in the history of bitcoin chiseled into them.
“In a way, they look at all your prior transactions since the first day you joined the bitcoin network to ensure you indeed have at least one bitcoin you can use to pay for my services,” Farrokhnia said.
Miners page through the blockchain ledger (or, in some instances, a subsection of the ledger) and if they say, “Yeah, he has the bitcoin he says he has,” the transaction enters something called the “mempool.”
Step 2: Enter the mempool
Even after that verification, Farrokhnia can’t spend the bitcoin that was sent to him just yet — there’s more work to be done.
Our transaction enters the mempool, which is basically a holding area. Picture this as the bitcoin DMV. Thousands of pending transactions, three to five per second, from all over the world, waiting for a number to be called.
All the bitcoin transactions in bitcoin purgatory are waiting for a miner to call their number. It’s at least a 10-minute wait. Bitcoin payers will sometimes include “transaction fees,” which you can think of as tips to miners to avoid longer waits.
Let’s say, hypothetically, Edward Weniger in Nebraska selects our transaction with about 2,000 or so others. He starts chiseling the details of our transaction into his own block to be added to the blockchain. But he’s not the only one.
“It’s very much possible that multiple miners are going to select your transaction, amongst others, and put it in a block,” Farrokhnia said.
Miners all over the world, from Kazakhstan to Florida, want to add their block to the blockchain. But there can only be one.
Step 3: The bitcoin math puzzle lottery
So which miner wins?
“In bitcoin protocol, the miners are required to solve a mathematical puzzle that, in essence, is a search for a [random] number,” said Farrokhnia.
The puzzle is really more like a lottery. Maybe the easiest way to understand it is to head to a casino. “Imagine a slot machine,” Farrokhnia said. “But as opposed to having three bars it actually has 64 bars, so you can already imagine how low the probability of success is.”
For any single guess — one pull of the slot machine arm — a miner has an infinitesimally small chance of actually hitting the jackpot. Odds are literally better that you’ll be struck by lightning.
The jackpot, and the incentive miners have for doing all this, is right now 6.25 bitcoins, currently about $250,000. The jackpots get awarded every 10 minutes or so, and this is the way miners get most of their money.
The winning miner’s tablet gets added to the blockchain, and professor Farrokhnia can finally spend his hypothetical bitcoin (although, to be extra safe, he should wait until a few more blocks are added).
Proof of work and energy use
Why in the world is this process so elaborate? “Proof of work,” Farrokhnia explained. “I need to ensure that you have done the work, the verification correctly, by imposing on you a task difficult enough to require electricity and resources and time and so on.”
The theory underlying all of bitcoin mining is that Edward Weniger in Nebraska wouldn’t go through all this hassle if he was trying to game the system somehow. The correct answer to the math puzzle is easily verified by other miners, and a block with bad transactions in it should eventually be caught when new blocks are added.
But the original idea was that miners would really just be nerds with a personal computer and some spare time, one slot machine per miner.
“But it turned out people realized that ‘Hey, you have two, I have another five at home — if we combine resources we have a higher chance of winning,” said Farrokhnia.
As the price of bitcoin has soared in recent years, the value of the mining jackpot has soared along with it. Multinational mining companies started developing more powerful rigs and pooling thousands of them together.
This concerns Erik Franklin, a professor who researches climate change at the University of Hawaii.
“If you’ve got a high-end rig, you can basically have the same level of energy demand in a single day that I would have to run my three-bedroom house in Hawaii,” Franklin said.
Bitcoin evangelists argue that you can easily run the rigs off of renewable or orphaned energy sources. Plus, it’s not like mainstream banking is carbon-neutral.
But even now, Franklin said, cryptocurrencies are using more energy than some whole countries.
“Don’t look at where it is today, but look at the trend. Ten years ago that impact was zero, and now all of sudden we’ve added another country on the scale of Poland,” said Franklin.
Ethereum and other platforms are experimenting with mining methods that are less energy-intensive. But so far, the bitcoin model is the dominant one.
There’s a lot happening in the world. Through it all, Marketplace is here for you.
You rely on Marketplace to break down the world’s events and tell you how it affects you in a fact-based, approachable way. We rely on your financial support to keep making that possible.
Your donation today powers the independent journalism that you rely on. For just $5/month, you can help sustain Marketplace so we can keep reporting on the things that matter to you.