Mining
Mining is the decentralized process where specialized computers, known as miners, solve complex Proof-of-Work puzzles to validate transactions, add new blocks to Bitcoin's blockchain, and introduce new bitcoin into circulation.
Key Takeaways
- Involves hashing block headers with SHA-256 to meet a target value, requiring immense computational power.
- Adjusts difficulty every 2016 blocks to maintain ~10-minute block intervals, ensuring network stability.
- Rewards include a subsidy (halving every 210,000 blocks) and transaction fees, converting energy into bitcoin.
- Pools mitigate variance by sharing rewards based on contributed work.
- Secures Bitcoin against attacks, with the total hash rate in 2025 exceeding 1 EH/s, making 51% attacks economically infeasible.
In-Depth Explanation
Bitcoin mining, as outlined in Satoshi Nakamoto's 2008 whitepaper, is the backbone of the network's security and consensus. It operates via a competitive, decentralized process where miners assemble and validate transactions into blocks, solving a Proof-of-Work (PoW) puzzle to append them to the blockchain. This ensures chronological order, prevents double-spending, and distributes new Bitcoin fairly.
Here's the step-by-step technical process:
Transaction Collection
Miners gather unconfirmed transactions from the mempool (a pool of pending transactions broadcast across the network). They prioritize based on fee rates to maximize rewards.
Block Assembly
- Create a coinbase transaction: The first transaction in the block, which includes the block subsidy (3.125 BTC as of 2025) and any fees. It also contains arbitrary data, like the famous "The Times 03/Jan/2009 Chancellor on brink of second bailout for banks" in the genesis block.
- Build a Merkle tree: Transactions are hashed pairwise using SHA-256 until a single Merkle root is derived, efficiently summarizing all transactions.
Block Header Construction
The 80-byte header is critical for PoW:
Proof-of-Work Solving
- Double-hash the header: Compute H = SHA-256(SHA-256(header)), known as SHA-256d.
- The hash must be less than or equal to the target: H ≤ target, where target is a 256-bit number derived from the bits field.
- Difficulty D = target_max / target_current, with target_max being the easiest (0x1d00ffff). In August 2025, difficulty hovers around 127.62 trillion, requiring hashes to start with ~28 leading zeros on average.
- Miners iterate the nonce (and sometimes extraNonce in coinbase) billions of times per second until a valid H is found.
Broadcast and Validation
Successful miners broadcast the block. Full nodes verify it: check PoW, transaction validity (no double-spends via UTXO set), and rules like SegWit weight limits (~4 million weight units, effective ~2-4 MB block size).
Difficulty Adjustment
Every 2016 blocks (~2 weeks), difficulty recalculates: new_target = old_target * (actual_time / expected_time), where expected_time = 2016 * 600 seconds (10 minutes per block). This self-regulates against hash rate fluctuations; in 2025, post-halving, hash rate peaks at ~1.085 EH/s (exahashes/second), with recent adjustments projecting a ~3% drop to 123.7 trillion difficulty.
Hardware Evolution: Early mining used CPUs, then GPUs/FPGAs, but since 2013, ASICs dominate, custom chips like Bitmain's Antminer S21 (200 TH/s, ~3.5 kW). Efficiency is measured in J/TH (joules per terahash); modern ASICs achieve <20 J/TH. Energy consumption turns real-world work into security, with global mining using ~150 TWh/year, often from renewables.
Mining Pools: To reduce reward variance (solo mining might take years for a block), miners join pools. They submit "shares", partial PoW solutions above a pool-set target but below network target. Pools use protocols like Stratum V2 for efficiency, distributing rewards via methods like PPS (Pay Per Share) or PPLNS (Pay Per Last N Shares).
Rewards and Economics: The subsidy halves every 210,000 blocks (~4 years); post-2024 halving, it's 3.125 BTC/block. Fees, driven by demand (e.g., via Lightning Network off-chain scaling), will dominate as subsidies approach zero by 2140. In 2025, despite record difficulty, miner revenues surge 105% YoY due to BTC price appreciation and efficient operations.
Unlike centralized systems, Bitcoin's PoW makes attacks like 51% (reorgs) cost-prohibitive, requiring >50% hash rate, estimated at billions in hardware/electricity. This energy-backed immutability sets Bitcoin apart as tamper-proof sound money.
Why Bitcoiners Care
Mining decentralizes control from inflationary fiat issuers to a global, competitive network of participants. Bitcoiners value it as the mechanism that enforces scarcity through honest work, creating the hardest money ever. Resilient to censorship, inflation, and manipulation, far superior to vulnerable centralized currencies.