How Bitcoin mining works: a step-by-step guide for beginners
Mining is how new Bitcoin blocks are made and how new coins enter circulation. Here is what a miner actually does, why it takes so much computing work, and how the rewards are paid.

Photo: “Crypto Mining Rig” by moneybright, CC BY 2.0, via Flickr (edited: cropped and resized).
Bitcoin mining is the process of creating new blocks. Miners bundle waiting transactions, then repeatedly hash an 80-byte block header until the result falls below a target [1]. The first valid block earns the block reward — new coins plus fees [2] — and makes past transactions harder to change [3].
Key points
- 1Mining is a guessing race: miners change a small field in the block header and hash it again and again until the hash is low enough.
- 2Finding a valid block is hard, but checking one takes a single hash, so every node can verify the work cheaply.
- 3The winner may claim the block reward: the block subsidy (new coins, 3.125 BTC since 2024) plus the fees of included transactions.
- 4Most miners join pools so that they receive small, regular payouts instead of rare, large ones.
- 5Mining is what makes rewriting Bitcoin’s history expensive; it is not a simple way for beginners to earn money.
On this page
- What problem does Bitcoin mining solve?
- What does a miner actually do, step by step?
- What is the “puzzle” miners are solving?
- How likely is one machine to find a block?
- What do miners get paid?
- Why do most miners join mining pools?
- What happens when two miners find a block at once?
- How does mining make Bitcoin hard to rewrite?
- Is mining a way for beginners to earn bitcoin?
- What mistakes do beginners make here?
- Frequently asked questions
- The bottom line
- Sources
What problem does Bitcoin mining solve?#
Bitcoin has no central company keeping the ledger. Thousands of independent computers, called nodes, each keep their own copy. That raises two questions: who gets to add the next page of transactions, and how do you stop someone from quietly rewriting old pages? Mining answers both.
The Bitcoin developer documentation puts it simply: because the chain is maintained by anonymous peers, each block must prove that a significant amount of work went into creating it, so that anyone trying to modify past blocks has to work harder than honest peers who only add new ones [4]. The whitepaper calls this proof-of-work and describes it as “one-CPU-one-vote”: the valid history is the chain with the most work behind it, not the one backed by the most identities or IP addresses [3].
What does a miner actually do, step by step?#
A miner is both software and hardware. The software assembles a candidate block; the hardware — today, specialised chips called ASICs — does the repetitive hashing [1]. Here is the loop, in the order it happens.
- Collect waiting transactions
The miner’s node picks transactions from its mempool, the list of valid transactions it has heard about that are not yet in a block.
- Write the coinbase transaction
The first transaction in every block is a special one that pays the block reward to the miner. It is called the coinbase transaction (nothing to do with the company of the same name).
- Build the block header
The miner fills in an 80-byte header: version, the previous block’s hash, a merkle root that summarises every transaction, the time, the encoded target, and a nonce.
- Hash, change the nonce, hash again
The hardware hashes the header. If the result is not below the target, it changes the nonce and tries again — billions or trillions of times per second.
- Broadcast the winning block
When a hash is low enough, the miner sends the complete block to the network. Other nodes check it and, if it is valid, start building on top of it.
Only the 80-byte header is hashed, so a block with many transactions is no slower to mine than a block with few [4]. The nonce field is just 4 bytes — about 4.3 billion possible values — so fast hardware runs through all of them quickly. When that happens, the mining software changes a spare “extra nonce” inside the coinbase transaction, which produces a new merkle root and therefore a fresh header to try [1].
| Field | Size | What it does |
|---|---|---|
| Version | 4 bytes | Says which set of validation rules the block follows |
| Previous block hash | 32 bytes | Links this block to the one before it, so old blocks cannot change unnoticed |
| Merkle root | 32 bytes | One hash that summarises every transaction in the block |
| Time | 4 bytes | When the miner started hashing, within limits that nodes enforce |
| nBits | 4 bytes | The encoded target the header’s hash must not exceed |
| Nonce | 4 bytes | A free number the miner changes to get a new hash on each attempt |
Field sizes from the Bitcoin developer reference [5]. 4 + 32 + 32 + 4 + 4 + 4 = 80 bytes.
What is the “puzzle” miners are solving?#
A hash function turns any input into a fixed-length number that looks random. Change one character of the input and you get a completely different number, so there is no shortcut to producing a particular result [4]. Bitcoin’s rule is that a block’s header hash must be at or below a number called the target. The only known way to get there is trial and error.
The developer guide gives an easy illustration. If the target were half of the largest possible hash, about every other attempt would succeed. Bitcoin assumes that lowering the target makes the average number of attempts rise in proportion [4]. Real targets are astronomically small, which is why the network collectively makes an enormous number of attempts for every block.
| Step | Value |
|---|---|
| Target = 1/2 of the maximum hash | about 2 attempts on average |
| Target = 1/1,000 of the maximum | about 1,000 attempts on average |
| Target = 1/1,000,000 of the maximum | about 1,000,000 attempts on average |
| Checking a winning block | 1 hash, for anyone |
That asymmetry is the whole trick: finding a valid block is expensive, but checking it is almost free. The whitepaper makes the same point — the work needed grows with the requirement, yet it “can be verified by executing a single hash” [3].
Who sets the target? Nobody does by hand. Every 2,016 blocks, each node recalculates it from how long the previous 2,016 blocks took, aiming for one block every ten minutes on average [4]. The full mechanism is covered in our guide to the difficulty adjustment.
How likely is one machine to find a block?#
The Bitcoin Wiki gives a rule of thumb for the average time a single miner waits between blocks: difficulty × 2^32 ÷ the miner’s hashes per second [6]. Difficulty is simply a way of expressing the target as a more readable number: higher difficulty means a lower target and more guesses per block. Plugging in round numbers shows why almost nobody mines alone.
| Step | Value |
|---|---|
| Network difficulty (hypothetical) | 100,000,000,000,000 |
| Expected hashes per block = difficulty × 2^32 | ≈ 4.29 × 10^23 |
| One machine’s speed (hypothetical) | 200 TH/s = 2 × 10^14 hashes per second |
| Average wait = 4.29 × 10^23 ÷ 2 × 10^14 | ≈ 2.15 × 10^9 seconds |
| Same wait in days | ≈ 24,855 days |
| Same wait in years | ≈ 68 years |
This is an average, not an appointment. The wiki stresses that it is “just probability”: a miner could get lucky next week or never find a block at all [6]. The same arithmetic, run across all miners, is how data providers estimate the network’s hash rate.
What do miners get paid?#
The block reward is what a miner may claim for creating a valid block. It equals the block subsidy — newly created bitcoin — plus the transaction fees paid by every transaction in the block [2]. The subsidy started at 50 BTC and is halved every 210,000 blocks; since the April 2024 halving it is 3.125 BTC per block [7]. See Bitcoin halving explained for the full schedule.
| Part | Where it comes from | How it changes over time |
|---|---|---|
| Block subsidy | New coins created by the coinbase transaction | Halves every 210,000 blocks until it reaches zero |
| Transaction fees | Inputs minus outputs of each included transaction | Set by users competing for block space; not halved |
Fees exist because a transaction’s inputs may be worth more than its outputs; the difference can be claimed by the miner who includes it [4]. Miners therefore tend to fill blocks with the transactions paying the most per unit of space — the reason fees rise when the network is busy (see transaction fees explained).
Why do most miners join mining pools?#
Because of the odds shown above. The developer guide describes two ways to mine. A solo miner keeps the entire reward but faces long, unpredictable gaps between payouts. A pooled miner combines hashing power with others and receives small payments more often, shared roughly in proportion to the work contributed [1].
Pools measure each member’s work with shares. The pool sets its own target a few orders of magnitude easier than the network’s. Each member’s hardware then finds many hashes that beat the pool’s target but not the network’s; these prove how much hashing the member did. Occasionally one of those shares also beats the network target — that is a real block, and the pool publishes it [1].
| Step | Value |
|---|---|
| Shares needed per block, on average | 100 |
| Block subsidy | 3.125 BTC |
| Transaction fees in the block (hypothetical) | 0.1 BTC |
| Total paid to the pool = 3.125 + 0.1 | 3.225 BTC |
| Value of one share = 3.225 ÷ 100 | 0.03225 BTC |
| If you submitted 3 shares = 3 × 0.03225 | 0.09675 BTC, before the pool’s own fee |
Real pools use a variety of payout formulas built on this basic share system [1], and they charge fees. The point is the shape: pooling swaps a tiny chance of a large reward for a steady trickle of small ones.
Solo mining vs pool mining
What happens when two miners find a block at once?#
It happens. Two miners can each find a valid block at the same block height a few seconds apart. Nodes usually keep the first one they see, so for a short time the network disagrees. The tie breaks when the next block is found on top of one of them: nodes follow the chain with the most accumulated work and drop the other block, which becomes a stale block [4]. The whitepaper describes the same rule: nodes work on the first block they receive but keep the other branch in case it becomes longer [3].
This is why services wait for several confirmations before treating a payment as settled — each extra block on top makes it less likely that the block holding your transaction will be replaced. Read more in blocks and confirmations.
How does mining make Bitcoin hard to rewrite?#
Each header contains the previous block’s hash, so changing an old transaction changes that block’s hash and breaks every block after it. To make the edit stick, an attacker would have to redo the proof-of-work for that block and all later ones, then overtake the honest chain [3]. The developer guide notes that only someone with a majority of the network’s hashing power could do this reliably — the so-called 51 percent attack — though even less than half still has some chance of success [4].
Why old blocks get harder to change
The whitepaper adds an economic argument: an attacker with that much computing power should find it more profitable to follow the rules and collect new coins than to undermine the system that gives those coins their value [3]. That is an argument about incentives, not a mathematical guarantee.
Is mining a way for beginners to earn bitcoin?#
For most people, no. Mining needs specialised hardware, cheap electricity and a way to handle heat and noise, and the odds for a single machine are tiny, as the worked example shows. EU regulators also point out that the energy consumption of some crypto-assets is high, partly because of mining, and that consumers should be aware of the environmental impact [9].
Mining in one box
What mistakes do beginners make here?#
- Thinking miners “solve hard maths problems”
The task is not clever maths; it is brute-force guessing. Miners change a number and hash again until the result is low enough.
- Believing more miners means faster transactions
When hash power rises, the difficulty adjustment raises the bar so that blocks still arrive about every ten minutes on average.
- Assuming miners control the rules
Miners choose which valid transactions to include, but every node checks blocks against the consensus rules and rejects invalid ones, whoever mined them.
- Treating mining as passive income
Hardware, electricity and pool fees come first, and rewards depend on luck and on the bitcoin price. Offers that promise steady mining income deserve extra suspicion.
Frequently asked questions#
Can I mine bitcoin on my laptop or phone?
Technically you can run mining software, but against specialised ASIC hardware your chance of ever finding a block is effectively zero, and the electricity costs more than any expected reward.
How long does it take to mine one bitcoin?
Miners do not mine coins one at a time. The network as a whole produces one block about every ten minutes on average, and each block’s subsidy is currently 3.125 BTC [7]. How much any single miner earns depends on its share of total hash power.
What happens to mining when all 21 million bitcoin are issued?
Is mining the same as staking?
No. Mining spends computing work to earn the right to add a block. Staking, used by proof-of-stake networks such as Ethereum, locks up coins instead. See staking.
Do miners decide which transactions go into a block?
Yes, within the rules. A miner can include any valid transactions it likes, and usually picks those paying higher fees. In pools using the widely used Stratum protocol, members cannot inspect or add transactions — the pool chooses them [1].
The bottom line#
Mining is a lottery in which each ticket is one hash of a block header. The target sets how many tickets the whole network must buy, the block reward pays the winner, and the accumulated work is what makes Bitcoin’s history expensive to rewrite.
To see how the network keeps blocks near ten minutes as miners come and go, read the difficulty adjustment guide next, then the hash rate profile.
Sources#
Grade A = primary source (regulator, protocol specification, client code, original author). Grade B = expert secondary source used for explanation only.
- Abitcoin.org developer documentation. Developer Guides: Mining, 2026.
- Abitcoin.org developer documentation. Bitcoin Developer Glossary: Block reward, 2026.
- ASatoshi Nakamoto. Bitcoin: A Peer-to-Peer Electronic Cash System, 2008.
- Abitcoin.org developer documentation. Developer Guides: Block Chain, 2026.
- Abitcoin.org developer documentation. Developer Reference: Block Chain (block headers), 2026.
- BBitcoin Wiki. Difficulty, 2026.
- BBitcoin Wiki. Controlled supply, 2026.
- ABitcoin Core (GitHub). src/consensus/consensus.h (COINBASE_MATURITY), 2026.
- AEuropean Supervisory Authorities (EBA, ESMA, EIOPA). EU financial regulators warn consumers on the risks of crypto-assets, 2022.
- AUS Federal Trade Commission (Consumer Advice). What To Know About Cryptocurrency and Scams, 2026.


