How does Bitcoin mining work? The mechanism, step by step
Mining is how Bitcoin writes its ledger without anyone in charge: roughly every ten minutes, machines all over the world compete for the right to add the next page, and the winner is paid in brand-new bitcoin. There is no clever equation and no puzzle to solve: it is a giant lottery where every attempt costs electricity. Here is the mechanism in order, with the real values of a block mined on 28 October 2026, then the reward, pools, energy, and where a small machine like mine fits in.
Published 28 October 2026 · by Pixel · 11 min read
Mining means packing waiting transactions into a block, then computing the double SHA-256 of its 80-byte header over and over, changing a number, the nonce, until the hash falls below the target: 19 or 20 leading zeros today. The winner receives 3.125 BTC plus fees, about 3.137 BTC on average (network as of 17 October 2026).
Contents 9 parts and a FAQ · 11 min read
- What is mining for?
- From transactions to a block template: the mempool
- The 80-byte header: what the machine actually computes
- Double SHA-256, nonce and extra nonce: the draw
- The target: why the winning hash starts with so many zeros
- What does the miner earn? Subsidy and fees
- Why miners join pools, and who mines today
- Why does mining use so much energy?
- And a home miner in all this?
1. What is mining for?
Bitcoin is a public ledger of every transaction, copied across thousands of computers, the nodes A computer that keeps a full copy of Bitcoin and checks every block itself. Run your own node. The problem is easy to state: who gets to write the next page, with no bank or authority to decide, and without a cheat being able to rewrite the past to spend the same bitcoin twice?
The answer in Satoshi Nakamoto’s white paper is called proof of work: to propose a block, you must show you spent a lot of computation finding it. Rewriting an old block would mean redoing all that work, then the work of every block after it, faster than the rest of the network. The white paper sums it up: proof of work is “one-CPU-one-vote”.
So mining does two jobs at once: it secures the ledger and it issues new bitcoin, paid to whoever finds the block. If you are just starting, the guide to getting started with Bitcoin mining gives the short version; here, we open the hood.
2. From transactions to a block template: the mempool
When you send bitcoin, your transaction is broadcast to the network’s nodes, which check it and keep it in their mempool The waiting room for transactions not yet written into a block. Whoever builds the block chooses which ones go in., the waiting room for transactions not yet written into a block. On 28 October 2026 around 11:00 UTC, 47,784 transactions were waiting there according to mempool.space, about 20 million vbytes The unit of size of a transaction. Fees are paid per vbyte, not according to the amount sent.: enough to fill some twenty blocks, each holding at most one million.
A block has a size limit (a weight of 4 million units in Bitcoin Core’s code), so choices must be made. The miner’s node builds a block template, taking first the transactions that pay the highest fee per vbyte. At the top it adds a special transaction, the coinbase The first transaction of a block, the one that pays the reward. On a solo pool it pays your address directly., which pays the reward to the miner: it is the only way new bitcoin come into existence.
A real example: block 973,541, mined on 28 October 2026, holds 6,061 transactions and weighs 3,997,625 units out of the 4 million allowed. In a pool A server that machines connect to. A regular pool shares the earnings, a solo pool does not. Solo or pool?, the pool builds this template from its node and sends it to the machines; when you mine with your own node, you choose the transactions yourself (solo mining with Bitcoin Core).
3. The 80-byte header: what the machine actually computes
Your miner never sees the thousands of transactions. It only works on the block’s header: 80 bytes, six fields, always in the same order. The transactions are summed up in a single hash A 64-character code computed from the block. Impossible to predict: you have to try., the Merkle root: changing one transaction would change that root, so the header, so the whole calculation.
| Field | Size | What it is for | In block 973,541 |
|---|---|---|---|
| Version | 4 bytes | The validation rules followed. Some of its bits also serve as spare search space (“version rolling”). | 0x3a222000 |
| Previous block hash | 32 bytes | The link to the block before: changing an old block would break everything after it. | 00000000000000000000a186…dcc58c (block 973,540) |
| Merkle root | 32 bytes | A single hash that sums up every transaction in the block. | 1f7617e1…92532c, for 6,061 transactions |
| Time | 4 bytes | The time stated by the miner, later than the median of the previous 11 blocks. | 28 October 2026, 11:07 UTC |
| nBits | 4 bytes | The target, in a compact form: the block’s hash must be less than or equal to it. | 0x17020093 |
| Nonce The number the machine changes on every attempt to get a new hash. | 4 bytes | The number the machine changes on every attempt. | 1,613,434,802 |
| Total | 80 bytes | This small piece of data, and only this, is what the machine runs twice through SHA-256 The hash calculation Bitcoin uses, and so mining. Bitcoin Cash uses the same one: the same machines mine either.. | hash: 00000000000000000001c527…69a3c |
The “previous block hash” field is what makes a chain of blocks: each block contains the hash of the one before, which contains the one before that, back to the first block in 2009. That is why nobody can quietly change an old block.
4. Double SHA-256, nonce and extra nonce: the draw
For each attempt, the machine runs the header through the SHA-256 function, then runs the result through SHA-256 again: that is double SHA-256. Out comes a 256-bit hash, written as 64 hexadecimal characters, impossible to predict: flipping a single bit of the header gives a completely different hash. So you cannot aim for a good hash, only try again and again.
What changes from one attempt to the next is first the nonce, the header’s last field. It is 4 bytes: about 4.29 billion possible values. A lot for a human, very little for a chip: a Bitaxe Gamma at 1.2 TH/s (rated) makes about 1.2 trillion attempts per second, so it runs through every nonce in about 3.6 milliseconds, roughly 279 times a second.
Something else has to change then. The pool (or your own mining software) leaves a small free field in the coinbase transaction, the extra nonce: by changing it, the machine changes the coinbase, so the Merkle root, so the header, and starts again with 4.29 billion fresh nonces. Recent chips also roll a few bits of the version field, known as version rolling and provided for by BIP 320, and the timestamp can move forward a little.
You can check the principle yourself: the double SHA-256 of the 80 header bytes of block 973,541 gives exactly 00000000000000000001c527…69a3c, the hash shown by block explorers (which write it byte-reversed, by convention). And any node redoes that calculation in a split second: finding is very slow, checking is instant.
5. The target: why the winning hash starts with so many zeros
A hash is also a gigantic number. The network sets a limit, the target (encoded in the nBits field): a block is only valid if its hash is less than or equal to that target. Since the target is tiny compared with all possible hashes, a winning hash necessarily starts with a long run of zeros.
At the current difficulty (140.6 T, network as of 17 October 2026), it takes about 79 leading zero bits, or 19 or 20 zeros in hexadecimal: the hash of block 973,541 has 19, followed by a 1. Every attempt has the same small chance, and none brings the next one closer.
Every 2016 blocks, the network adjusts the target: Bitcoin Core’s code aims for 10 minutes per block and two weeks per period (14 days of 1,440 minutes, divided by 10 minutes, is 2016 blocks). If the last 2016 blocks came too fast, the target drops and difficulty rises; too slow, the opposite, with a change of at most a factor of 4 each time. That keeps the pace at about one block every ten minutes, however many machines are plugged in. The details, “shares” and your best share are in mining difficulty explained.
6. What does the miner earn? Subsidy and fees
Whoever finds the block pays the reward to themselves in the coinbase transaction. It has two parts:
3.125 BTC of new bitcoin per block, since the halving of 20 April 2024 (block 840,000)about 0.012 BTC per block on average, 0.4% of the reward (network as of 17 October 2026)about 3.137 BTC, roughly €227,000 at the price of 17 October 2026at block 1,050,000, around April 2028: a 1.5625 BTC subsidyThe subsidy started at 50 BTC in 2009 and is cut in half every 210,000 blocks, about four years: that is the halving, written into the code (Bitcoin Core’s GetBlockSubsidy function). The next one falls at block 1,050,000, five times 210,000; its date, around April 2028, is an estimate that depends on the actual pace of blocks.
These successive cuts cap the total at a little under 21 million bitcoin; on top of that, Bitcoin Core’s code rejects any amount above 21 million as a sanity check (MAX_MONEY). At block 973,541, about 895,000 were left to be issued, for every miner in the world. When the subsidy has become negligible, around 2140, only fees will remain, as the white paper already planned.
These bitcoin cannot be spent right away: they need 100 more blocks, about 16 hours 40 minutes. What actually happens when a small miner wins: found a block solo, what next?
7. Why miners join pools, and who mines today
With about 600,000 billion billion attempts needed per block on average, a single machine can wait for centuries, and a Bitaxe for millennia. Pools combine the hashrate of many machines: the pool asks them for hashes much easier than the target, called shares, which prove the work done, then splits the earnings according to that work. On average a machine earns the same in a pool as solo, minus the pool’s fee, but the earnings arrive more regularly: solo or pool, which one?
| Pool | Blocks found in a year | Share of blocks |
|---|---|---|
| Foundry USA | 14,679 | 28.0% |
| AntPool | 9,572 | 18.3% |
| F2Pool | 6,720 | 12.8% |
| ViaBTC | 5,019 | 9.6% |
| SpiderPool | 4,540 | 8.7% |
| The five together | 40,530 | 77.4% |
Two pools, Foundry USA and AntPool, found 46.3% of the year’s blocks, and the top five 77.4%. A pool does not own the machines mining on it, and every miner can switch by changing an address in their settings. But the pool builds the block template, so it chooses the transactions: this concentration is a real issue, which I covered in a video (in French), 6 companies control Bitcoin. Here is how.
Every machine mining solo, in someone’s home, on a pool that pays the reward straight to the miner’s own address, is a bit of hashrate outside these giants. That is also the idea behind FindMyBlock, the Bitcoin solo pool I built, with no fee: solo mining on FindMyBlock.
8. Why does mining use so much energy?
Because the energy spent is precisely what makes the ledger expensive to attack, and because difficulty adapts. As long as mining pays more than the electricity, new machines arrive, network hashrate rises, and the 2016-block adjustment raises difficulty to keep ten minutes per block. More efficient machines therefore do not necessarily lower total consumption: mostly, they raise the difficulty.
The network now runs at about 1,006 EH/s (network as of 17 October 2026), that is 1,006 billion billion hashes per second, a figure computed from the difficulty. Its consumption depends on the machines’ average efficiency, in joules per TH: at this hashrate, every J/TH of average efficiency is about 1.0 GW, around the clock. For example, if every machine on the network had the efficiency of a Thor P2 (15.3 J/TH, measured at the wall), the network would draw about 15 GW. The real fleet mixes recent and older machines: for a tracked, sourced estimate, the reference is the Cambridge Bitcoin Electricity Consumption Index (CBECI).
At home it is simpler: every watt drawn ends up as heat in the room. A 15 to 18 W Bitaxe Gamma costs at most about €32 of electricity a year at €0.20 per kWh, running day and night. The math for each machine: Bitcoin miner power consumption, and to put the heat to use: heat your home mining bitcoin.
9. And a home miner in all this?
A Bitaxe Gamma does exactly the same calculation as industrial farms, with the same chip as the Antminer S21 Pro, a recent industrial machine (the BM1370, according to the Bitaxe project repository): about 1.2 trillion double SHA-256 hashes per second (1.2 TH/s, rated). Against the network, that is about a 1 in 840 million chance at each block: it would take about 840 million Bitaxes to match Bitcoin’s whole hashrate.
Over a year, that comes to about a 1 in 16,000 chance of finding a block solo (network as of 17 October 2026). My shelf, 13 machines for about 50 TH/s, has about a 1 in 383 chance a year, and has not found a Bitcoin block yet. It is small, but not zero: every attempt has the same chance, whether the machine sits at home or in a farm, and small machines have already won whole blocks.
For the odds of your own machine, the solo mining calculator redoes this math. For how long it would take to build up one bitcoin, machine by machine: how long to mine one bitcoin. And to choose a machine: which Bitaxe to buy. To watch the mechanism run for a few euros, a NerdMiner does the same double SHA-256 on an ESP32 chip, millions of times slower: it is a learning tool, not a way to earn.
Network figures as of 17 October 2026, recalculated at each difficulty adjustment; example block, mempool and pool shares read on mempool.space on 28 October 2026. Technical words are in the glossary.
Frequently asked questions
Does mining create bitcoin?
Yes: it is the only way new bitcoin come into existence. Whoever finds a block pays themselves the subsidy, 3.125 BTC since April 2024, in the block’s first transaction, plus the fees of the transactions it contains. The subsidy is cut in half every 210,000 blocks, about four years.
How does Bitcoin mining work, in one sentence?
Machines compute the double SHA-256 of a block header over and over, changing a number called the nonce, until they get a hash below the target set by the network; the first to succeed adds the block and collects the reward, roughly every ten minutes.
Why does Bitcoin mining use so much energy?
Because difficulty adjusts every 2016 blocks to the network’s hashrate: as long as mining pays, new machines arrive and difficulty rises. That spending is also what makes rewriting history prohibitively expensive. For a dated, quantified estimate, see the Cambridge CBECI index.
How many bitcoin are left to mine?
At block 973,541 (28 October 2026), about 895,000 out of a total of just under 21 million, the limit written into Bitcoin Core’s code. Since the subsidy halves roughly every four years, the last satoshis will be mined around 2140.
Can I mine bitcoin at home?
Yes, with a small dedicated machine such as a Bitaxe (1.2 TH/s rated, 15 to 18 W), but not to get rich: solo, it is about a 1 in 16,000 chance a year of finding a block (network as of 17 October 2026). To get started: getting started with Bitcoin mining.
Sources
- Satoshi Nakamoto, the Bitcoin white paper (proof of work, incentive, network)
- bitcoin.org developer reference: the 80-byte block header and its six fields
- bitcoin.org developer guide: block templates, extra nonce, solo and pool mining
- Bitcoin Core: 10 minutes per block, two weeks per period, a halving every 210,000 blocks
- Bitcoin Core: the new difficulty computed every 2016 blocks (pow.cpp)
- Bitcoin Core: the 50 BTC subsidy halved at each halving (GetBlockSubsidy)
- mempool.space, block 973,541 of 28 October 2026
- mempool.space: share of blocks found by each pool
A question about this guide? Ask it on the Discord, several of us answer there.
Other guides
-
Why you almost never find a block: mining difficulty explained
The zeros, the target, and why the network adjusts itself every two weeks.
2 min read · updated 17 Oct 2026 -
Solo or pool: which one?
Same average earnings, two very different ways to receive them.
2 min read · published 23 Sept 2026 -
Getting started with Bitcoin mining at home
The principle, the machine, the cost, solo or pool, and the five steps to start.
3 min read · updated 17 Oct 2026 · new -
How long does it take to mine one bitcoin? The math, machine by machine
Centuries in a pool, a lottery solo: the math for each machine reviewed here.
12 min read · published 28 Oct 2026 · new