What mining does
Mining is how new blocks are added to Bitcoin's blockchain. A miner gathers waiting transactions into a block, then makes guess after guess until one gives the block a valid proof of work. When a miner finds one, it sends the block to the network, and nodes that accept it add it to their copy of the chain. The miner who made it collects new bitcoin plus the fees in it.
That proof of work is what makes the chain hard to rewrite. Changing an old block means redoing its work and the work of every block after it. The whitepaper describes the cost as CPU time and electricity.
The seven stages below follow one block from waiting transactions to the next difficulty adjustment.
Bitcoin whitepaper, sections 4 to 6 ↗
- Mempool
- Template
- Header
- Hashing
- Winner
- Verify
- Difficulty
1. Transactions wait in the mempool
When you send bitcoin, your wallet broadcasts the transaction to nodes on the network, and they pass it on to their peers. Each node checks it and keeps it in its own memory pool, or mempool, until it is confirmed in a block.
There is no single, shared mempool. Each node holds its own set, in memory. A node that restarts loses its mempool, and nodes drop transactions to make room when they fill up, so two nodes rarely hold exactly the same set.
Fees are compared by fee rate, in satoshis per virtual byte (sat/vB). A transaction's virtual size is its weight divided by 4, rounded up (BIP 141). A 200 vB transaction paying 600 sats has a fee rate of 600 ÷ 200 = 3 sat/vB. At about 14:05 UTC on 17 November 2026, mempool.space suggested 3 sat/vB for the next block.
Some rules about what a node accepts into its mempool are policy: each node's own choice, which it can change. Bitcoin Core's defaults include a minimum relay fee and a dust limit. A block containing a transaction that breaks those defaults is still valid.
Developer guide: memory pool ↗ · BIP 141 ↗ · Bitcoin Core: policy.h ↗ · mempool.space: recommended fees ↗
2. A miner builds a block template
A block template is a candidate block: the transactions a miner wants to include, in order. Bitcoin Core's built-in template builder picks the highest fee rates first, counting a transaction together with any unconfirmed parents it depends on, because that earns the most. The selection and order are the miner's choice. The consensus rules only require that every transaction is valid and that the block stays within the weight limit of 4,000,000 weight units.
The first transaction in every block is the coinbase transaction. It has no inputs to spend. It creates the block subsidy and collects the fees from every other transaction in the block, and pays them to wherever the miner chooses. Nodes reject a block whose coinbase pays out more than the subsidy plus those fees. Paying out less is allowed, and the difference is never created.
Bitcoin Core: miner.cpp ↗ · Bitcoin Core: consensus.h ↗ · Bitcoin Core: validation.cpp ↗ · Developer guide: block chain ↗
3. The block header
Miners do not hash the whole block. They hash its header, a summary of 80 bytes with six fields:
| Field | Size | What it holds |
|---|---|---|
| Version | 4 bytes | Which set of block rules the block follows. |
| Previous block hash | 32 bytes | The hash of the previous block's header. This is what chains the blocks together. |
| Merkle root | 32 bytes | A fingerprint of every transaction in the block. Change any transaction and it changes. |
| Time | 4 bytes | A timestamp, which must be later than the median of the previous 11 blocks and no more than two hours ahead of a node's clock. |
| Bits | 4 bytes | The target, in a compact encoded form. |
| Nonce | 4 bytes | A number the miner is free to change. |
4 + 32 + 32 + 4 + 4 + 4 = 80 bytes.
Developer reference: block headers ↗ · Bitcoin Core: block.h ↗
4. Hashing
The miner runs the header through SHA-256, then runs the result through SHA-256 again. The output is the block's hash, 32 bytes that look random. A tiny change to the header gives a completely different hash, and there is no way to predict the hash without computing it.
If the hash does not meet the target, the miner changes the nonce and tries again. The nonce has about 4.3 billion possible values, which a modern mining chip runs through in a fraction of a second. After that, the miner changes something else: an extra nonce inside the coinbase transaction (which changes the merkle root) or the time field, and starts through the nonces again.
Each attempt is a guess, and every guess has the same chance. Nothing makes one guess better than another, and nothing is learned from a failed one. A miner with more hashing power only makes more guesses per second.
The scale is large. On 17 November 2026, mempool.space estimated the network's hashrate at about 973 EH/s, averaged over three days, which is about 973 × 1018 guesses a second. Over the ten minutes a block takes on average, that is 973 × 1018 × 600 = about 5.8 × 1023 guesses, across the whole network, per block found.
Bitcoin Core: hash.h (double SHA-256) ↗ · Developer guide: mining ↗ · mempool.space: 3-day hashrate ↗
5. A winning hash
A hash wins when, read as a number, it is less than or equal to the target. That hash is the proof of work.
A hash is usually written as 64 hexadecimal digits. Because the target is a very small number compared with all possible hashes, a winning hash starts with a long run of zeros. The hash of block 840,000 begins with 19 of them: 0000000000000000000320283a… The rule is the comparison with the target. Counting zeros is only a quick way to see it.
Finding a winning hash takes an enormous number of guesses. Checking one takes a single hash: any node hashes the header once and compares the result with the target.
Developer reference: target ↗ · Bitcoin whitepaper, section 4 ↗ · mempool.space: block 840,000 ↗
6. Broadcast and verify
The miner sends the new block to its peers, and it spreads across the network. Every full node checks every rule itself before accepting it, including:
- every signature is valid;
- no coin is spent twice, and every coin spent exists;
- the block is within the weight limit;
- the coinbase pays out no more than the subsidy plus fees;
- the header hash meets the target, and the target is the right one for that height.
A block that breaks any rule is rejected, however much work went into it. Proof of work only decides between valid blocks.
When a node has a choice between valid chains, it follows the one with the most accumulated proof of work. Usually that is obvious. Occasionally two miners find a block at almost the same moment, and nodes briefly disagree about which came first. Each works on the one it saw first and keeps the other. When the next block arrives on one side, that side has more work, and nodes on the other switch to it. The block left behind is called a stale block. Any of its transactions that the winning chain does not include go back into nodes' mempools.
This is why waiting for confirmations helps. Each block added on top of yours makes it less likely that your transaction's block is replaced. The whitepaper shows that an attacker's chance of catching up falls exponentially with each block. Newly created coins in a coinbase cannot be spent until the block is 100 blocks deep, for the same reason.
Bitcoin whitepaper, sections 5 and 11 ↗ · Developer guide: block chain ↗ · Developer guide: memory pool ↗ · Bitcoin Core: consensus.h ↗
7. Difficulty adjustment
Every 2,016 blocks, each node recalculates the target. The aim is an average of one block every 10 minutes, so 2,016 blocks should take 2,016 × 10 minutes = 20,160 minutes, which is two weeks.
Bitcoin Core compares how long the previous period actually took, from its timestamps, with those two weeks, and scales the target by the same ratio:
- If the period took one week, the new target is half the old one, so a winning hash is twice as hard to find.
- If it took four weeks, the target doubles, and blocks get easier.
The change is capped at a factor of 4 either way, however fast or slow the period was. Every node does the same calculation, and a block with the wrong target is invalid.
On 17 November 2026, mempool.space showed that the last adjustment lowered difficulty by about 9.1%. The next is due at block 977,760, which is 485 × 2,016. Blocks in the current period had averaged about 545 seconds, and 600 ÷ 545 = about 1.10, so mempool.space estimated a rise of about 10%. That estimate changes as blocks arrive.
Bitcoin Core: pow.cpp ↗ · Bitcoin Core: chainparams.cpp ↗ · mempool.space: difficulty adjustment ↗
The subsidy and halvings
The subsidy started at 50 BTC per block and halves every 210,000 blocks. Bitcoin Core calculates it from the block height alone.
| From block | Subsidy |
|---|---|
| 0 | 50 BTC |
| 210,000 | 25 BTC |
| 420,000 | 12.5 BTC |
| 630,000 | 6.25 BTC |
| 840,000 (20 April 2024) | 3.125 BTC |
| 1,050,000 | 1.5625 BTC |
On 17 November 2026 the chain was at block 976,279. The next halving is 1,050,000 − 976,279 = 73,721 blocks away. At ten minutes a block, that is 737,210 minutes, or about 512 days, which points to around April 2028. Blocks rarely average exactly ten minutes, so the date is approximate.
The subsidy is counted in whole satoshis. 50 BTC is 5,000,000,000 sats, and halving that 33 times leaves less than one (5,000,000,000 ÷ 233 = about 0.58), so the subsidy reaches zero at the 33rd halving, block 33 × 210,000 = 6,930,000.
Bitcoin Core: GetBlockSubsidy ↗ · Bitcoin Core: chainparams.cpp ↗ · mempool.space: block height ↗
Fees over time
Each halving cuts the new bitcoin a miner earns per block. If fees stay at the same level, they make up a larger share of the reward after each one. The whitepaper expected this: once a set number of coins is in circulation, the incentive can move entirely to transaction fees.
That share is still small. Over the 144 blocks from 976,136 to 976,279, mempool.space recorded 45,269,169,385 sats paid to miners. The subsidy accounts for 144 × 312,500,000 = 45,000,000,000 of it, leaving 269,169,385 sats in fees, or about 0.6% of the total. That works out to about 1.87 million sats of fees per block.
Fees depend on demand for block space. When more transactions are waiting than the next blocks can fit, the fee rate needed to get into one rises.
Bitcoin whitepaper, section 6 ↗ · mempool.space: rewards, last 144 blocks ↗
Pools
A miner on its own may wait a long time between blocks, then receive a large payment. A pool combines many miners' work and splits the rewards among them, which trades the occasional large payment for small, regular ones.
To measure each member's work, the pool sets its own target, much easier than the network's. A hash below the pool's target is a share. Shares prove a miner is working, and the pool pays roughly in proportion to them. Now and then a share also meets the network target, and that one is a block.
Who builds the template matters. With the widely used Stratum protocol (now often called Stratum V1), the pool builds the template and sends miners a header to work on and a coinbase to complete. Bitcoin Optech notes that pool members have no insight or control over what they mine.
Two newer approaches hand that choice back:
- Stratum V2 encrypts the link between miner and pool, and its specification lets miners build their own block templates. Its site lists some projects in production and others still in progress.
- DATUM, from the OCEAN pool, has each miner build templates with its own Bitcoin node through a DATUM gateway. The pool tracks contributions and splits rewards, and payouts go to miners in the coinbase.
Both depend on the pool supporting them.
Developer guide: pool mining ↗ · Bitcoin Optech: pooled mining ↗ · Stratum V2 ↗ · OCEAN: DATUM ↗
What miners can and cannot do
Miners choose which valid transactions go into their blocks, and in what order. They can leave a transaction out, and if every miner does, it waits.
Miners cannot spend anyone else's coins, because they cannot produce valid signatures for them. They cannot create more bitcoin than the subsidy allows or change the rules, because nodes reject blocks that break them, however much work the blocks carry.
A miner or group with more than half the hashrate could do more harm. It could:
- reorganise recent blocks, replacing them with its own chain, which would let it reverse its own recent payments;
- keep other miners' blocks off the chain, and with them any transaction it wants to censor.
It still could not take coins that never belonged to it or create value from nothing. Each confirmation makes a reorganisation of your block more costly, which is why large payments are worth more confirmations. Bitcoin Optech also notes that a miner with less than half the hashrate can gain an unfair share of rewards through selfish mining.
Bitcoin whitepaper, section 11 ↗ · Bitcoin Optech: selfish mining ↗ · Developer guide: block chain ↗
Next
To try mining at home, the Bitaxe guide covers a small open-source miner, including pointing it at a pool app on your own node. To check every block yourself, run a node you actually use.
Sources & further reading
Researched 17 November 2026. Software and services change: check the current documents before you act.
- Bitcoin: a peer-to-peer electronic cash system (whitepaper) ↗
- Bitcoin Core: consensus.h (block weight limit, coinbase maturity) ↗
- Bitcoin Core: chainparams.cpp (halving interval, target spacing and timespan) ↗
- Bitcoin Core: pow.cpp (difficulty adjustment) ↗
- Bitcoin Core: validation.cpp (block subsidy, coinbase amount) ↗
- Bitcoin Core: block.h (block header) ↗
- Bitcoin Core: hash.h (double SHA-256) ↗
- Bitcoin Core: policy.h (relay policy, dust limit) ↗
- Bitcoin Core: miner.cpp (block template building) ↗
- BIP 141: Segregated Witness (block weight, virtual size) ↗
- Bitcoin Developer Guide: block chain ↗
- Bitcoin Developer Guide: mining ↗
- Bitcoin Developer Guide: P2P network (memory pool) ↗
- Bitcoin Developer Reference: block chain (block headers) ↗
- Bitcoin Optech: pooled mining ↗
- Bitcoin Optech: selfish mining ↗
- Stratum V2 ↗
- OCEAN: DATUM ↗
- mempool.space: block height (API) ↗
- mempool.space: 3-day hashrate (API) ↗
- mempool.space: difficulty adjustment (API) ↗
- mempool.space: rewards for the last 144 blocks (API) ↗
- mempool.space: recommended fees (API) ↗
- mempool.space: block 840,000 ↗
Bitaxe: mining bitcoin at home with an open-source miner → · Bitcoin, without the vocabulary test → · Run a node you actually use → · A calm guide to a stuck transaction → · Managing your coins and fees →
