Tired of ads? Enjoy an ad-free experience by signing up.
Paul Bischoff · · 6 min read

Pick up your pickaxes and headlamps: here’s how Bitcoin mining works

lego miner

There are generally two types of articles out there describing how bitcoins are mined: the dense and technical, or the simple and vague. This article will attempt to strike a balance between the two by starting with the foundations of Bitcoin and working up.

You probably know that mining creates new bitcoins, but its underlying purpose is actually to verify transactions, keep the record of those transactions up to date, and secure the bitcoin network from thieves and hackers.

The blockchain

Jake Smith (@BeijingBitcoins), author of the Bitcoin News Roundup newsletter, says, “Many people who denounce bitcoin as a scam or ‘internet funny money’ fail to recognize the fact that it is in fact a revolutionary new invention, perhaps as important as the invention of the internet or email protocols.” To understand Bitcoin mining, you first must understand the blockchain, which is one of the defining qualities that makes Bitcoin so unique.

The blockchain is a record of every single Bitcoin transaction that has ever taken place. Ever. It serves as a public ledger for everyone to see. When you download and install the original Bitcoin client on a computer, you also download the blockchain, which constantly expands as more transactions take place around the world. Note that the blockchain is getting quite big at this point, so most modern Bitcoin wallets don’t contain the entire thing.

“Casual users have absolutely no reason to ever download the blockchain. I’m as hardcore of a user as they come and I’ve never even downloaded it,” Smith says. “One should only intend to download the whole thing if they plan on running a node or mining.”

The blockchain may as well be written in stone, because it’s exactly the same on everyone’s computer who has the Bitcoin client installed. “It’s impossible to go back in time and reverse transactions or edit the information,” Smith explains. When you want to send bitcoins to another user, the miners all verify that the address you are sending the coins from actually contains enough bitcoins to complete the transaction. Smith says, “It’s possible to create a transaction input that makes it look like I’m, for example, sending you five coins when I have zero coins. But as soon as that goes through the miners, it will be rejected as I do not have the balance to cover it.”

Every 10 minutes or so, new transactions are added to the blockchain in blocks. Each new block contains two important things: a list of every single transaction that took place around the world in the last 10 minutes, plus a code – called a hash – that references the block that came before it, thus the “chain” part of the blockchain.

It’s the job of miners to take these two pieces of information and condense them into a new hash that fits a certain criteria (it must start with a certain number of zeros), which takes significant computational power. The difficulty of doing so increases (more zeros needed) for every 2016 blocks added, or about once every two weeks. Essentially, they are trying to solve, as Smith puts it, “an arbitrary problem in order to find this ‘magic number’ with an ever-increasing difficulty to ensure that as more computing power is thrown at the network, there is still only an average block time of around 10 minutes.”

These hashes are much easier to compare rather than trying to keep track of every individual transaction in the world. And because each one references the hash that came before it, it revalidates every single transaction repeatedly down to the original “genesis” block.

Risks and rewards

Bitcoin faces two plausible attacks: traders who try to spend or sell the same bitcoins twice, and malicious miners who try to inject fake blocks into the system so they can receive new bitcoins. Mining is a way to secure the network from both these attacks.

The “double spending” problem is minimized because only one of the two transactions will ultimately make it into the blockchain. Even if both are verified at first, miners continue to validate them as more blocks are added until one or the other wins out. This is why many exchanges wait until a block has been validated six times (takes about one hour) before accepting a trade.

Injecting fake blocks requires more trouble than it’s worth, so long as there are more miners than hackers verifying the real transactions.

In return for their service, miners who successfully “solve” a block are rewarded with 25 bitcoins plus some transaction fees. This number is cut in half every 210,000 blocks, or about once every four years.

How to start

Stay ahead in Asia’s tech landscape

You've reached your 2 free content limit for the month. Sign up for free to read the full story.

🏄 For casual readers / 👶 Free

Basic

US$0

Free forever

Get instant access to this article and more every month

0 premium content

Unlimited news briefs

5

5 articles

Ad-free reading experience

Just US$0 per day

⌛Sign up in 20s. No payment details needed.

📖 For learners / 👍 Starter

Lite

US$4.92/month

Billed annually at US$59/year

Get instant access to this article and more every month

4

4 premium content

Unlimited news briefs & articles

Ad-free reading experience

Just US$0.17 per day

Cancel anytime

Our subscriber community includes professionals from these companies:

Stay updated on the go with our mobile app.

Get latest insights with smoother, more personalized experience through TIA mobile app.

Community Writer

Paul Bischoff

Paul Bischoff is an American multimedia journalist based in Beijing. He co-founded and authored the now-retired Beijing Tech Report, and has also worked at the Xinhua News Agency and a local ABC TV station in the US. He’s generally against writing about himself in the third person, but occasionally makes exceptions. You can follow him on Twitter @pabischoff.