How Bitcoin Mining Works: A Beginner's Guide
Learn the basics of Bitcoin mining, from proof‑of‑work to block rewards, and understand how new bitcoins are created and transactions are secured.
Key takeaways
- Bitcoin mining uses proof‑of‑work to add new blocks and secure the network.
- Miners compete to solve a cryptographic puzzle, and the first to succeed earns the block reward.
- Mining hardware, energy consumption, and network difficulty all influence profitability.
What Is Bitcoin Mining?
Bitcoin mining is the process by which new bitcoins are created and transactions are confirmed on the blockchain, the public ledger that records every transfer of value.
In practice, mining means running specialized computers that repeatedly perform a cryptographic calculation called proof‑of‑work. When a computer solves the puzzle, it earns the right to add a new block of transactions to the chain.
The term “mining” is borrowed from gold mining because, like extracting a precious metal, miners expend resources (electricity and hardware) to produce something of value—in this case, newly minted bitcoins and transaction fees.
Proof‑of‑Work Explained
Proof‑of‑work (PoW) requires miners to find a hash—a 256‑bit number— that is lower than a target set by the network. The hash is produced by feeding the block header into the SHA‑256 algorithm, which outputs a seemingly random string of characters.
The target is adjusted every 2016 blocks (about every two weeks) so that, on average, the network finds one valid block roughly every ten minutes regardless of how much total hash power is deployed.
Because the hash function is deterministic, any change to the block data (for example, swapping the order of transactions) produces a completely different hash, forcing miners to start over.
- Hash function: SHA‑256, deterministic and irreversible.
- Target difficulty: higher difficulty means a lower target value, making the puzzle harder.
- Nonce: a 32‑bit number miners change to produce different hashes.
The Mining Process Step‑by‑Step
1. **Collect transactions** – A miner pulls unconfirmed transactions from the mempool, checks that each input is valid, and orders them into a candidate block. The order can affect fees earned, so miners often prioritize transactions with higher fees per byte.
2. **Add the coinbase transaction** – The first transaction in every block is the coinbase. It does not spend any existing bitcoins; instead, it creates new coins equal to the current block reward (currently 6.25 BTC) plus any transaction fees from the other transactions in the block.
3. **Hash the block header** – The miner assembles a block header containing the previous block’s hash, the Merkle root of all transactions, a timestamp, the current difficulty target, and a nonce. The miner repeatedly hashes this header, incrementing the nonce each time, until the resulting hash is below the target.
4. **Broadcast the solution** – When a valid hash is found, the miner immediately shares the new block with the network. Other nodes verify the block’s proof‑of‑work and the validity of every transaction before appending it to their copy of the blockchain.

Discussion 0