Blockstream

Mining

Mining is the decentralized process where specialized computers, known as miners, select transactions and repeatedly hash candidate blocks to meet Bitcoin's Proof-of-Work target, 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 ZH/s (1,000 exahashes per second), 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:

Field

Size (Bytes)

Description

Version

4

Block version number; since BIP 9 this field carries upgrade signalling bits (e.g. 0x20000000 for post-Taproot blocks).

Previous Block Hash

32

SHA-256 hash of the prior block's header, linking the chain.

Merkle Root

32

Root hash of the transaction Merkle tree.

Timestamp

4

Unix timestamp of block creation (must be within network median time).

Bits

4

Compact representation of the difficulty target.

Nonce

4

Variable incremented to find a valid hash.

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). As of August 2025, difficulty was around 127.62 trillion, requiring block hashes to begin with roughly 19 to 20 leading hexadecimal zeros (about 79 zero bits) 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 ZH/s (zettahashes per 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 estimated at 138 TWh/year, of which roughly 43% comes from renewable sources.

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), may become the primary source of miner revenue as the subsidy approaches zero by 2140. In 2025, despite record difficulty, miner revenue is a function of the block subsidy, transaction fees, and the bitcoin price.

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-resistant 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, and far harder to debase than centralized currencies.

Share:

Copied!