Network Mechanics

Bitcoin Mining Explained

What miners actually do, how they compete, and why it's called a "race" to find the next block.

What Miners Actually Do

Bitcoin miners have one job: find a number that makes a hash meet certain criteria. That's it. They take a block of transactions, add a random number (the "nonce"), hash everything, and check if the result starts with enough zeros.

If not, they increment the nonce and try again. And again. Billions of times per second, across millions of machines worldwide, until someone gets lucky.

Mining is guessing. Very fast, very expensive guessing. The first miner to guess correctly wins the block reward.

The Mining Race

Every ~10 minutes, miners worldwide race to find the next valid block. More hashrate = more guesses = better odds. Watch how hashrate translates to winning probability:

Mining Race Simulator

Watch miners compete to find the next block. Hashrate determines odds, but luck determines the winner.

Foundry USA
195 EH/s
AntPool
170 EH/s
F2Pool
95 EH/s
ViaBTC
85 EH/s
Solo Miner (you)
335 TH/s
0
Blocks Found
0
Your Blocks
0:00
Time Elapsed

Notice how the solo miner's bar barely moves? With 335 TH/s against 700+ EH/s network hashrate, your odds of winning any given block are about 1 in 2 billion. But someone wins every block.

Building a Block

Before mining, miners construct a block template—a candidate block containing transactions they want to include. The template has:

version 0x20000000
prev_block_hash 000000000000000000029d...
merkle_root 8a4b2c1d3e5f6a7b8c9d...
timestamp 1706644800
bits (target) 0x17034219
nonce 0

The miner hashes this header repeatedly, incrementing the nonce each time, until the hash meets the difficulty target. The nonce is the only part that changes rapidly—billions of times per second.

The Block Reward

The winning miner gets to claim the block reward: newly created bitcoin plus all transaction fees from the block.

3.125 BTC
Block Subsidy (new coins)
~0.2 BTC
Transaction Fees (varies)

The subsidy halves every 210,000 blocks (~4 years). It started at 50 BTC in 2009, is now 3.125 BTC, and will eventually reach zero. At that point, miners will be rewarded only through transaction fees.

Era Block Subsidy Approximate Years
150 BTC2009-2012
225 BTC2012-2016
312.5 BTC2016-2020
46.25 BTC2020-2024
53.125 BTC2024-2028
61.5625 BTC2028-2032

Why Mining Matters

Mining isn't just about creating new coins. It serves critical functions:

Function How Mining Provides It
Transaction Processing Miners include transactions in blocks, confirming them
Security The energy spent makes attacks prohibitively expensive
Coin Distribution New bitcoin goes to those who secure the network
Timestamping Blocks create an immutable record of when transactions occurred
Decentralization Anyone can mine; no permission needed
Mining is how Bitcoin converts electricity into security. The more energy spent mining, the more expensive it is to attack the network.

Next: Difficulty Adjustment →

How does Bitcoin keep blocks at ~10 minutes when hashrate changes?

📌 TL;DR
Miners compete to find a valid hash by guessing billions of times per second. The first to find a valid hash wins the block reward. Mining is a lottery where your chances are proportional to your hashrate.

Frequently Asked Questions

Who decides which miner finds the block?

Pure probability. With 100 EH/s (exahashes per second) network hashrate, any given miner has a chance proportional to their share. It's like a lottery with better odds for more tickets.

What happens to stale blocks?

They're discarded. When two miners find blocks at nearly the same time, only one gets built upon. The other becomes a "stale block" and earns nothing—centralizing pressure is why pools prefer lower latency.

Can I mine Bitcoin at home?

Technically yes, but profitably no. ASIC miners cost thousands and consume serious electricity. At current difficulty, solo mining is essentially a lottery—the expected return is less than the electricity cost.

← Previous: Proof of Work Next: Difficulty →