Course outline · 10 lessons
Bitcoin Mining & Economics

Bitcoin Mining Explained: How Proof of Work and ASIC Miners Secure the Network

Two hands support an unmarked circuit board with silver finned heatsinks above a grey stone workbench.

What Is Bitcoin Mining?

Bitcoin mining is the process that adds new transactions to the blockchain and creates new bitcoin. There are no pickaxes or tunnels. Specialized computers race to win a guessing game, and the winner gets to add the next block (a batch of transactions) and collects freshly created BTC. Across the whole network, these machines make about a sextillion (1021) guesses every second.

Mining does two jobs at once. First, it is how new bitcoin enters circulation: 3.125 BTC per block since the April 2024 halving. Second, it protects the record of past payments, because rewriting that record would mean redoing all the work spent on it. The two jobs are linked: miners spend real electricity to earn bitcoin, and that spending is what makes the history expensive to change.

Each time a miner adds a block, they collect two kinds of income: the block subsidy (the newly created bitcoin) and the transaction fees paid by everyone whose transaction made it into that block. The subsidy halves every four years or so, so over the very long run fees have to take over. Today they are a small part of the total: in the last 1,008 blocks before 6 November 2026, fees were under 1% of what miners earned. Why that share matters for Bitcoin’s long-term security is the subject of the lesson on transaction fees and Bitcoin’s security budget.

How Bitcoin Mining Works Step by Step

The easiest way to understand mining is to follow one block from assembly to acceptance.

Step 1: Collect Unconfirmed Transactions

Every Bitcoin node keeps a mempool (short for memory pool): a waiting room for transactions that have been announced but not yet put in a block. When you send bitcoin, your transaction spreads from node to node and lands in thousands of mempools, including the ones miners use.

A block has limited space, so miners pick the transactions that pay the most for the space they take up. That measure is the fee rate, written in satoshis per virtual byte (sat/vB); a satoshi is one hundred-millionth of a bitcoin. A small transaction paying 2,000 sats can outrank a large one paying 5,000 sats, because it pays more per byte. When many people want to transact at once, fee rates climb as users outbid each other. When things are quiet, even low fee rates confirm quickly. The fees lesson covers this fee market in more depth.

A chart of two waiting transactions. Width is the space each one takes in the block; height is the fee it pays for each byte of that space, so the colored area is its total fee. A small transaction paying 2,000 sats is narrow and tall: it has the higher fee rate and goes first. A large transaction paying 5,000 sats takes much more space but is short: it pays fewer sats per byte and goes after it. Miners rank by the height, the fee rate in satoshis per virtual byte (sat/vB), not by the total fee.
Miners rank transactions by fee rate, not by total fee. Block space is limited, so what counts is how much a transaction pays for each byte it takes up. A small transaction paying 2,000 sats can go ahead of a large one paying 5,000.

Step 2: Construct a Candidate Block

The miner picks transactions from the mempool and assembles a candidate block. The first transaction in it is the coinbase transaction, the one that pays the miner the subsidy plus fees. The miner then builds the block header, a short 80-byte summary that is the only part that gets hashed. It contains:

  • A version number, which miners also use to signal that they are ready for a proposed rule upgrade (a readiness signal, not a vote)
  • The hash (digital fingerprint) of the previous block, which links the block to the chain
  • The Merkle root: a single fingerprint that summarizes every transaction in the block, so changing any transaction changes this value
  • A timestamp
  • The current difficulty target, in compact form
  • A nonce: a number the miner is free to change

Step 3: Hash the Block Header

This is where the work happens. A hash function such as SHA-256 turns any input into a fixed-size number that looks random, and changing the input even slightly gives a completely different number. Bitcoin runs the header through SHA-256 twice. The miner needs a result that is below a number called the target.

Think of it as rolling a die with an astronomically large number of sides and needing a result below a certain value. Each roll is one hash. If the result is too high, the miner changes the nonce and rolls again. When the network makes mining harder, it lowers the value you need to roll under, so you need more rolls on average.

Two number lines, each covering every possible result from lowest to highest, with a marked target. The part below the target is the winning range. Each dot is one roll of the die, which is one hash. Gray dots are too high, so the miner changes the nonce and rolls again; the orange dot lands below the target, a valid hash. Each roll lands at a random spot. In the first line the target is higher and it takes fewer rolls on average. In the second, the network has made mining harder by lowering the target: the winning range is smaller and it takes more rolls on average. Not to scale: the real winning range is astronomically small.
Mining is rolling a giant die until the result is below the target. Each roll is one hash. When the network makes mining harder, it lowers the target, so finding a winning roll takes more tries on average.

The nonce field has only about 4.3 billion possible values, which a modern machine runs through in a tiny fraction of a second. To keep going, miners also change a spare field inside the coinbase transaction, called the extra nonce. Because that changes the Merkle root, it gives the header a fresh set of 4.3 billion values to try. A single modern machine makes hundreds of trillions of these guesses per second, and nearly all the electricity it uses ends up as heat.

Step 4: Find a Valid Hash

Eventually, by pure trial and error, some miner finds a header whose hash is below the target. That hash is the proof of work: evidence that someone, on average, made an enormous number of guesses. There is no shortcut and no way to predict which guess will win.

Written out in hexadecimal, a winning hash in November 2026 starts with about 19 zeros. Billions upon billions of attempts fail and are thrown away. Finding the winner is hard, but checking it is trivial: anyone can hash the header once and see that it is below the target.

Step 5: Broadcast the Block

The winning miner sends the block to the network, and it spreads within seconds. Every node that receives it checks, on its own, that:

  • The hash really is below the target
  • Every transaction in the block is valid
  • The block follows all the consensus rules
  • The coinbase transaction doesn’t pay itself more than the subsidy plus fees allow

Nodes don’t vote on this. Each full node applies the rules itself and simply rejects a block that breaks them, however much work went into it. Proof of work only decides between competing chains of valid blocks. How those rules are enforced, and how they have changed over the years, is explained in who enforces Bitcoin’s rules.

Step 6: Network Acceptance

Once a block checks out, nodes add it to their copy of the blockchain and miners start on the next one. The miner’s reward is now recorded, but the coinbase output can’t be spent until 100 more blocks have been added (about 17 hours). The reason: two miners sometimes find a block at almost the same moment. The network soon builds on one of them, and the other becomes a stale (often called orphaned) block that drops out of the chain, taking its reward with it. The waiting period makes sure nobody spends coins from a block that might disappear.

Two miners find a block at almost the same moment, so the chain splits in two. The network builds on one side. The other block becomes stale: it drops out of the chain, taking its reward with it. The winning block pays its miner 3.125 BTC plus fees, but that reward stays locked while 100 more blocks are added, about 17 hours. After block 100 the winner can spend it. The wait makes sure nobody spends coins from a block that might disappear.
New coins wait 100 blocks before they can be spent. Sometimes two blocks are found at almost the same moment and one of them drops out, taking its reward with it. Waiting about 17 hours makes sure nobody spends coins from a block that might disappear.

This cycle repeats about every 10 minutes, day and night, and has done since the genesis block on 3 January 2009. Each new block makes earlier ones harder to change, because rewriting an old block means redoing its proof of work and that of every block after it.

What Are ASIC Miners?

An ASIC miner is a computer built for one job: computing SHA-256 hashes as fast and as efficiently as possible. ASIC stands for Application-Specific Integrated Circuit. A laptop’s processor can run games, spreadsheets and web browsers. An ASIC can do exactly one thing.

The Evolution of Mining Hardware

GenerationHardwareEraRough speed of one device
1stCPU (ordinary computer processors)2009–2010Millions of hashes per second (MH/s)
2ndGPU (graphics cards)2010–2013Hundreds of MH/s
3rdFPGA (reprogrammable chips)2011–2013Hundreds of MH/s to about 1 GH/s, using less power
4thASIC (custom mining chips)2013–presentBillions (GH/s) in 2013; hundreds of trillions (TH/s) today

Satoshi mined on an ordinary computer in 2009; by 2010 graphics cards, built for many simple calculations in parallel, had taken over; and within months of the first ASICs shipping in 2013, CPU and GPU mining stopped making sense.

Today a mainstream machine such as the Antminer S21 does about 200 TH/s (200 trillion hashes per second) while drawing about 3,500 watts, roughly two hairdryers running nonstop. Newer models are faster and more efficient still; the ASIC lesson compares them.

Can you mine bitcoin with your laptop? Technically yes; profitably, no. An ASIC is millions of times faster than a laptop at this one task and far more efficient per watt. It is a bicycle racing a jet.

A scale of hashes per second in which each tick is 1,000 times the one before: million (MH/s), billion (GH/s), trillion (TH/s), 1,000 trillion, quintillion (EH/s) and sextillion (ZH/s). An ordinary computer processor in 2009 did millions of hashes a second. GPUs and FPGAs, from 2010 to 2013, did hundreds of millions. The first ASICs in 2013 did billions. One Antminer S21 today does about 200 trillion, millions of times faster than a laptop. The whole network in November 2026 does about 1,000 EH/s, a sextillion hashes a second, which is about 5 million S21s.
Hashing power has grown from millions of guesses a second to about a sextillion. Each tick on the scale is a thousand times the one before. One ASIC is millions of times faster than a laptop, and the whole network is about five million of them.

What Makes ASICs So Fast

An ASIC has the SHA-256 algorithm built directly into the silicon. There is no operating system on the chip and no general-purpose instruction set; every transistor serves that one calculation. That brings:

  • Speed: no time spent on anything but hashing
  • Efficiency: far less electricity per hash
  • Zero versatility: if Bitcoin ever changed its mining algorithm, existing ASICs could no longer mine it; the few coins that also use SHA-256 are far too small to keep most of them running

How Bitcoin Mining Pools Fit In

One S21 is about one five-millionth of the network’s hashing power. Mining alone, it would find a block about once a century on average. That is why nearly all miners join mining pools: groups that combine their hashing power and share the rewards according to the work each one contributed. A pool doesn’t change your expected earnings (apart from its fee, usually a few percent); it turns a lottery ticket into a small, steady income. The mining pools lesson shows the odds in detail and how to join one.

Mining Difficulty and the Difficulty Adjustment

The difficulty adjustment keeps blocks arriving about every 10 minutes, however much mining hardware switches on or off.

How the Difficulty Adjustment Works

Every 2,016 blocks (roughly two weeks), every node recalculates the target using the same formula:

  • If the last 2,016 blocks came in less than two weeks, the network was too fast, so the target is lowered (mining gets harder)
  • If they took more than two weeks, the network was too slow, so the target is raised (mining gets easier)
  • Each adjustment is capped at a factor of four in either direction

This is why blocks still average about 10 minutes, even though total hashing power has grown from a single CPU to about 1,000 EH/s in November 2026. An EH/s (exahash per second) is a quintillion (1018) hashes per second, so that is about one zettahash (1021) per second. Nobody manages it; every node computes the same result from the same block timestamps.

The adjustment proved itself in 2021, when China banned mining and about half of the world’s hashing power went offline within weeks. Blocks slowed down, and at the next adjustment difficulty fell by about 28%, the largest drop in Bitcoin’s history, bringing block times back toward normal. As those miners set up again abroad, difficulty climbed back. No one had to intervene.

Why Difficulty Matters for ASIC Miners

When bitcoin’s price rises, mining pays more, so miners plug in more machines. More hashing power means difficulty rises at the next adjustment, and each machine then earns less bitcoin. When the price falls, the least efficient machines stop paying for their electricity and are switched off, difficulty drops, and the remaining miners earn a little more. Over time this pushes mining profitability toward the cost of electricity for the typical miner.

The Role of Hashrate in Network Security

Hashrate is the total guessing power pointed at Bitcoin. The higher it is, the more expensive it is for anyone to outpace the honest miners and rewrite recent blocks.

Current Global Hashrate

Hashrate is measured in hashes per second. 1 TH/s is a trillion (1012), 1 EH/s is a quintillion (1018), and 1 ZH/s is 1,000 EH/s. On 6 November 2026, mempool.space estimated the network at about 1,035 EH/s, just over one zettahash per second. You can check the current figure at any time on mempool.space’s hashrate chart. The numbers this course uses (hashrate, difficulty, price, fee share and coins mined) are collected, with their date and where to check each one, in the profitability lesson’s table.

The Economics of a 51% Attack

A “51% attack” means controlling more hashing power than everyone else combined, so that your private version of the chain can grow faster than the public one. The main thing an attacker gains is a double-spend: paying someone, waiting for them to deliver, then publishing a longer chain in which that payment never happened and the coins went back to the attacker. An attacker with a majority could also refuse to include certain transactions (censorship).

How much hashing power would that take? If the attacker brings new machines, they must out-hash the entire existing network: more than about 1,000 EH/s today, roughly five million S21-class machines, plus the power plants and buildings to run them. If instead they take over hashing power that already exists, for example by pressuring or compromising a few large pools, they need just over half of it. That second path is the more realistic worry, which is why the concentration of mining in a few pools matters (see the pools lesson).

Two paths to a 51% attack, drawn to the same scale. Path 1, bringing brand-new machines: the honest miners keep all of their roughly 1,000 EH/s, so the attacker needs more than 1,000 EH/s, about 5 million S21-class machines plus the power plants and buildings to run them. Path 2, taking over existing pools, for example by pressuring or compromising a few large ones: that hashing power moves from the honest side to the attacker, so the honest miners are left with just under half and the attacker needs just over half. This second path is the more realistic worry. A majority means more hashing power than everyone else combined.
New machines must out-hash the whole network, but taking over existing pools needs just over half. A majority means more hashing power than everyone else combined. New machines leave the honest miners with all of today’s roughly 1,000 EH/s, while taking over pools moves part of it to the attacker’s side.

Even with a majority, an attacker can’t take coins from other people’s wallets, create coins out of thin air or change the rules, because every node would reject such blocks. An attack would also be visible on-chain and would likely hit bitcoin’s price, which hurts the value of the attacker’s own coins and machines. Many people therefore consider it economically irrational, though that reasoning assumes the attacker cares about profit. More detail is in how proof of work secures Bitcoin.

Leaving transactions out takes less than a majority. Whoever builds a block’s template (the candidate block, with its list of transactions) decides what goes in, and today a few pool operators build the templates for most blocks. A transaction they skip waits for a block built by someone else; only a majority could go further and refuse to build on such blocks. The pools lesson explains who builds templates and how Stratum V2 and DATUM let individual miners build their own.

Hashrate Follows Price

Hashrate tends to follow bitcoin’s price with a lag of months, because new machines take time to buy, ship and install. As long as bitcoin is valuable, miners will spend energy to earn it, and that spending is what protects the chain.

Bitcoin Mining Geography: Where Are Miners Located?

Mining goes where electricity is cheap and the rules are predictable. After China’s 2021 ban, the map changed a lot:

  • United States: the largest mining country. Estimates of its share vary with the method, from roughly a third of global hashrate to much more; Cambridge’s 2025 survey warned that its own US figure is probably overstated because US firms answered most. Texas, with cheap gas and wind power and a deregulated grid, is the best-known hub, and several listed mining companies operate large US sites.
  • Kazakhstan: absorbed a lot of hashing power after the China ban thanks to cheap coal power, then tightened its rules after electricity shortages.
  • Canada: especially Quebec, with cheap hydroelectric power, and Alberta, where electricity comes mostly from natural gas; the cold climate helps with cooling.
  • Russia and the Nordic countries: cheap power in some regions (and cold air in the Nordics), with sanctions in Russia and restrictions in some Nordic countries.
  • Latin America and Africa: sites using stranded hydro, solar or flared gas, for example hydro in Paraguay and flared gas from Argentina’s oil fields. El Salvador’s government has mined with geothermal power from a volcano. Ethiopia grew quickly as a mining location, but in August 2025 its state utility stopped signing new power deals with miners to prioritize domestic demand.

Geography matters for decentralization. When two-thirds to three-quarters of hashrate was in China (about 75% in September 2019 and 65% in April 2020, by Cambridge’s estimates), one government had outsized influence over Bitcoin’s mining. Today’s map is more spread out, though still far from even.

Bitcoin Mining’s Environmental Footprint

Mining uses a lot of electricity; nobody disputes that. Cambridge’s 2025 industry report estimated about 138 TWh a year (terawatt-hours; one TWh is a billion kilowatt-hours, or kWh, the unit on a household electricity bill), around 0.5% of the world’s electricity, and hashrate has grown since then, so today’s figure is higher. The debate is about what that energy buys and where it comes from.

The Energy Mix

In the same Cambridge survey, mining companies reported that about 52% of their energy came from sustainable sources (42.6% renewables and 9.8% nuclear), with natural gas the largest single source at 38%. These are self-reported figures from the companies that answered. Miners can set up almost anywhere, so they look for the cheapest power, which is often energy that has no other buyer: remote hydro, gas that would otherwise be flared at oil wells, and wind or solar output that the grid can’t absorb at that moment. Critics answer that miners also run on fossil-heavy grids and that demand from miners can keep older plants running.

Mining as a Flexible Energy Buyer

Miners can be switched off within seconds and don’t care where they are, which makes them unusual electricity customers. In Texas, some take part in demand-response programs and shut down during heat waves to free up grid capacity. In remote places, small hydro plants that could never justify a transmission line can sell their power to a container of ASICs parked at the dam.

Comparison to Traditional Finance

You will often see Bitcoin’s energy use compared with the banking system (branches, data centers, card networks, cash transport). Estimates of the banking side vary enormously depending on what is counted, so such comparisons settle little. One real difference is measurability: Bitcoin’s hashrate can be observed from public data, while the energy use of traditional finance is spread across millions of buildings and systems.

The Thermodynamic Argument for Proof of Work

Supporters of proof of work make a further argument: to rewrite Bitcoin’s history you must spend real energy, and there is no political or social shortcut. A bank can reverse a payment with a database edit; reversing a confirmed Bitcoin transaction means out-computing the whole network. On this view the energy is the price of a ledger nobody can quietly change. Critics reply that the same security could be bought more cheaply in other ways, or that the cost is too high for what it protects. This is a genuine disagreement about values and trade-offs, not something a calculation settles.

Key Takeaways

  • Mining adds blocks by finding a header hash below a target through trial and error; that is proof of work.
  • Miners pick transactions by fee rate (sat/vB), not by the total fee.
  • ASICs are built only for SHA-256 hashing, and a single modern machine does hundreds of trillions of guesses per second, which made CPU and GPU mining obsolete.
  • Every 2,016 blocks (about two weeks) the difficulty adjusts to keep blocks near 10 minutes apart, whatever the hashrate.
  • In November 2026 the network ran at about 1,000 EH/s. A 51% attack with new hardware would need more than all of that; taking over existing pools is the more realistic risk.
  • Whoever builds a block’s template chooses its transactions, and today a few pool operators build most of them.
  • Mining’s energy use is large; how much of it is clean, and whether it is worth it, are open debates.

Frequently Asked Questions

How long does it take to mine one bitcoin?

With one Antminer S21 (200 TH/s) in a pool, at the network’s hashrate in November 2026 (about 1,035 EH/s), you would earn about 0.0000875 BTC a day, or roughly 8,750 satoshis. At that rate one full bitcoin takes about 31 years, and longer if difficulty rises. Miners sum this up in one number, hashprice: what one unit of hashing power earns per day, about $33 per PH/s (1,000 TH/s) per day in November 2026. The profitability lesson shows how to work it out with current numbers.

Can I mine Bitcoin on my phone or personal computer?

You can run mining software on almost anything, but a phone or laptop is millions of times slower than an ASIC and would never earn meaningful bitcoin. Any app that promises profitable bitcoin mining on a phone is a scam, and so are most “cloud mining” offers that ask you to pay upfront for a share of someone else’s machines. The lesson on home mining and mining scams shows the warning signs, and what a newcomer can really run at home.

What happens to Bitcoin mining when all 21 million bitcoin are mined?

The subsidy reaches zero around the year 2140. After that, miners earn only transaction fees. The change is gradual, one halving at a time. Whether fees alone will pay for enough security is an open question, discussed in transaction fees and Bitcoin’s security budget and in what happens when all bitcoins are mined.

Is Bitcoin mining legal?

Mining is legal in most countries, including the United States, Canada and most of Europe. Some countries have banned or restricted it; China banned it in 2021. Rules and taxes vary by place, so check your local laws. In many countries, including the US, mined bitcoin counts as taxable income.

How much electricity does one ASIC miner use?

An Antminer S21 draws about 3,500 watts, around 2,520 kWh a month if it runs nonstop. What that costs depends entirely on your electricity rate; the ASIC lesson works out the monthly bill at several rates.

Check Your Understanding

1. Your wallet offers two fee options for a transaction: 3 sat/vB or 20 sat/vB. Why does the number per vB matter more than the total fee?

Answer

Block space is the scarce thing. Miners fill blocks with the transactions that pay the most per unit of space, so they rank by fee rate. A bigger transaction needs a bigger total fee to reach the same fee rate. At 20 sat/vB you normally go ahead of everyone paying less per byte, whatever their total. The exception is a transaction that spends coins from another unconfirmed one: the two can be ranked together, by their combined rate.

2. Half of all miners suddenly switch off. What happens to block times, and what fixes it?

Answer

Blocks slow to about one every 20 minutes, because the remaining machines need twice as long on average to find a winning hash. At the next adjustment (every 2,016 blocks), every node raises the target, making it easier to find a valid hash. If the drop came partway through the period, that adjustment only partly makes up for it, and the one after brings block times back to about 10 minutes. After China’s 2021 ban, miners went offline over several weeks and difficulty fell in several steps.

3. Why would a 51% attacker using brand-new machines need more than all of today’s hashrate, not half of it?

Answer

The honest miners keep mining. To have a majority, the attacker’s new hardware must exceed everything the honest network already has: more than about 1,000 EH/s in November 2026. Half would be enough only if the attacker took that hashing power away from the honest side, for example by taking over existing pools.