> "The proof-of-work chain is a solution to the Byzantine Generals' Problem."
Learning Objectives
- Explain the Proof of Work mining puzzle and why it provides Sybil resistance in a permissionless network
- Calculate mining difficulty from target bits and explain the difficulty adjustment algorithm
- Analyze mining economics including hardware costs, electricity costs, block rewards, and fee revenue
- Evaluate the 51% attack threat model including historical near-misses and economic deterrents
- Assess Bitcoin's energy consumption using real data and evaluate both sides of the environmental debate
In This Chapter
- 7.1 The Mining Puzzle
- 7.2 Difficulty Adjustment
- 7.3 Block Rewards and the Halving
- 7.4 Mining Hardware Evolution
- 7.5 Mining Economics
- 7.6 Mining Pools
- 7.7 The 51% Attack
- 7.8 Selfish Mining and Other Attack Strategies
- 7.9 The Energy Debate
- 7.10 Putting It All Together: Mining as Mechanism Design
- 7.11 Summary and Bridge to Chapter 8
Chapter 7: Mining and Proof of Work: How Bitcoin Achieves Consensus
"The proof-of-work chain is a solution to the Byzantine Generals' Problem." — Satoshi Nakamoto, November 2008
In Chapter 3, we examined the fundamental challenge of distributed systems: how do participants who do not trust each other agree on a single version of truth? In Chapter 6, we dissected the structure of Bitcoin blocks and transactions. Now we arrive at the mechanism that binds those ideas together — the engine that makes Bitcoin work without a central authority. That mechanism is mining, and the consensus algorithm it implements is Proof of Work.
Mining is arguably the most misunderstood aspect of Bitcoin. To many outsiders, it conjures images of pointless computation — machines burning electricity to solve meaningless puzzles. To insiders, it is sometimes treated with almost religious reverence, as though the energy expenditure is inherently virtuous. Neither view is accurate. Mining is an economic mechanism design: a system that converts real-world energy expenditure into a digital security guarantee. Understanding exactly how it works, what it costs, and what it accomplishes is essential for any serious student of blockchain technology.
This chapter proceeds from the cryptographic puzzle itself through the economics that sustain it, the centralization pressures that threaten it, the attacks that exploit it, and the environmental questions that surround it. We will use real data throughout, particularly in the energy debate, where ideology has too often replaced evidence on both sides.
7.1 The Mining Puzzle
7.1.1 The Core Mechanism
At its most basic, Bitcoin mining is a brute-force search for a number. The miner assembles a candidate block — a collection of valid transactions plus a block header — and then repeatedly modifies a field in the header called the nonce (number used once), computing the SHA-256 hash of the header each time, until the resulting hash value falls below a predetermined target.
Recall from Chapter 2 that a cryptographic hash function like SHA-256 produces output that is computationally indistinguishable from random. Given an input, you cannot predict the output without actually computing it. Given a desired output property (such as "starts with 20 leading zero bits"), you cannot reverse-engineer an input that will produce it. You can only try inputs one by one.
The mining puzzle can be stated precisely:
Find a nonce n such that:
SHA-256(SHA-256(block_header(n))) < target
where block_header(n) is the 80-byte block header with the nonce field set to n.
7.1.2 A Worked Example
To make the mining puzzle concrete, let us walk through a simplified example. Suppose we are mining with a target that requires the hash to begin with at least 4 leading zero hex characters (16 leading zero bits). Our target would be:
0000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
We assemble our block header (80 bytes containing the version, previous block hash, Merkle root, timestamp, difficulty bits, and nonce) and begin our search:
Nonce 0: SHA-256d(header) = 7a3f1b2c... (starts with 7 — too high, try again)
Nonce 1: SHA-256d(header) = e891cd04... (starts with e — too high)
Nonce 2: SHA-256d(header) = 3201ab88... (starts with 3 — too high)
...
Nonce 47382: SHA-256d(header) = 00001c3a... (starts with 0000 — below target!)
After 47,382 attempts (in this example), we found a nonce that produces a hash beginning with the required leading zeros. This hash is below our target, so the block is valid. We broadcast it to the network, and every other node independently verifies the hash — which takes only a single computation — and accepts the block.
This asymmetry is crucial: finding the solution is hard (many attempts required), but verifying the solution is trivial (one hash computation). This is sometimes called a "one-way" property, and it is what makes Proof of Work practical. If verification were as expensive as discovery, nodes would not be able to keep up with the rate of new blocks.
7.1.3 Why Double Hashing?
Bitcoin uses SHA-256 applied twice — SHA-256(SHA-256(x)) — rather than a single application. This is sometimes called SHA-256d. Satoshi never publicly explained this choice, but the cryptographic community has identified two likely reasons:
-
Length extension attack resistance. SHA-256, like all Merkle-Damgard hash functions, is vulnerable to length extension attacks where an attacker who knows
H(m)can computeH(m || padding || m')without knowingm. Double hashing eliminates this vulnerability because the inner hash produces a fixed-length intermediate value. -
Defense in depth. If a partial preimage attack is discovered against SHA-256 that reduces the search space by some factor, double hashing means the attacker must break both layers. The cost compounds multiplicatively rather than additively.
It is worth noting that the computational overhead of double hashing is negligible — it exactly doubles the number of SHA-256 operations per mining attempt, but since the inner hash always operates on a fixed 32-byte input, the second pass is fast. The security benefit far outweighs the marginal cost.
7.1.4 The Probability Analysis
Since SHA-256 output is effectively random across 2^256 possible values, the probability of any single hash attempt falling below the target is:
P(success) = target / 2^256
For example, at the time of writing (early 2026), the Bitcoin difficulty is approximately 110 trillion (1.1 x 10^14). The corresponding target is a 256-bit number with roughly 76 leading zero bits. The probability of any single hash succeeding is approximately:
P = 1 / (110 x 10^12 x 2^32) ≈ 1 / (4.7 x 10^23)
This means that, on average, a miner must compute approximately 4.7 x 10^23 hashes before finding a valid block. At the network's total hashrate of roughly 700 EH/s (700 x 10^18 hashes per second), this takes about 10 minutes on average — by design.
7.1.5 The Nonce Space and Beyond
The nonce field in the block header is 32 bits, allowing 2^32 (approximately 4.3 billion) values. At modern hashrates, a single ASIC can exhaust the entire nonce space in under a second. This is why miners also modify other fields:
- The coinbase transaction's extra nonce field. The coinbase transaction (the first transaction in a block, which creates the block reward) contains an arbitrary data field. Changing this field changes the Merkle root in the block header, effectively creating a new 2^32-value nonce space to search.
- The timestamp. The block header timestamp can be adjusted within a range accepted by the protocol (roughly, it must be greater than the median of the previous 11 blocks and less than two hours in the future).
Together, these modifications give miners an effectively unlimited search space.
7.1.6 Sybil Resistance
The fundamental insight of Proof of Work — the reason Satoshi Nakamoto's design succeeded where earlier digital cash systems failed — is that it provides Sybil resistance in a permissionless network.
In a traditional distributed system, you might use one-node-one-vote to achieve consensus. But in an open network where anyone can join, an attacker can create millions of fake identities (Sybil nodes) and outvote honest participants. Proof of Work replaces one-node-one-vote with one-hash-one-vote. Creating fake identities is free, but computing hashes requires real energy expenditure. The cost of attacking the network scales linearly with the hash power of honest participants, making attacks prohibitively expensive.
💡 Key Insight: Proof of Work does not solve the Byzantine Generals' Problem in the traditional computer science sense (it provides probabilistic rather than deterministic finality). What it does is make the cost of attacking the system proportional to the resources deployed to defend it, in a system where anyone can participate without permission.
7.2 Difficulty Adjustment
7.2.1 The 10-Minute Target
Bitcoin is designed to produce one block approximately every 10 minutes, regardless of how much hash power is directed at mining. If blocks came too fast, the network would struggle with propagation delays — blocks would be mined before the previous block had reached all nodes, leading to frequent chain splits and wasted work. If blocks came too slowly, transaction confirmation times would become unacceptably long.
The 10-minute target is a compromise. It is fast enough for reasonable confirmation times (an hour for six confirmations) and slow enough to keep orphan rates low even on a global peer-to-peer network with heterogeneous latency.
To understand why the block interval matters, consider what happens at the extremes. If Bitcoin produced blocks every 1 second (as some naive altcoins attempted), the time to propagate a block across the global network — typically 5-15 seconds for a full block — would far exceed the block interval. Multiple miners would frequently mine on different chain tips, producing a tree of competing forks rather than a linear chain. The honest chain would waste most of its work on orphaned branches, and an attacker with substantially less than 50% would be able to outpace it. Conversely, if blocks came every hour, a user would need to wait 6 hours for 6 confirmations — impractical for any time-sensitive transaction. Litecoin chose a 2.5-minute target, Dogecoin chose 1 minute; each made different tradeoffs in the same design space.
💡 Key Insight: The block interval is not just a user experience choice — it is a security parameter. Shorter intervals mean more orphaned blocks, which reduces the effective hashrate defending the chain and makes attacks cheaper.
7.2.2 The Adjustment Algorithm
Every 2,016 blocks (approximately two weeks at the 10-minute target), the Bitcoin protocol adjusts the mining difficulty. The algorithm is straightforward:
new_difficulty = old_difficulty × (2016 × 10 minutes) / actual_time_for_last_2016_blocks
Or equivalently, in terms of the target (which is inversely proportional to difficulty):
new_target = old_target × actual_time / expected_time
where expected_time = 2016 × 600 seconds = 1,209,600 seconds (exactly two weeks).
Constraints: The adjustment is clamped to a factor of 4 in either direction. That is, the difficulty can at most quadruple or be reduced to one-quarter in a single adjustment period. This prevents extreme swings if a large amount of hash power suddenly joins or leaves the network.
7.2.3 A Subtle Off-by-One
Bitcoin's difficulty adjustment has a well-known off-by-one error in the original code. The actual time is calculated as the difference between the timestamps of block N and block N-2016, which measures the time for 2,015 inter-block intervals rather than 2,016. This means the adjustment is very slightly biased — the actual average block time is approximately 10 minutes and 0.3 seconds rather than exactly 10 minutes. Over Bitcoin's lifetime, this has resulted in blocks being produced very slightly faster than the nominal rate.
7.2.4 Historical Difficulty
Bitcoin's difficulty has increased by a factor of approximately 60 trillion since the genesis block in January 2009, when the difficulty was 1 (meaning any hash with 32 leading zero bits was valid). The trajectory has been approximately exponential, with notable plateaus and dips corresponding to:
- 2014-2015: Post-Mt. Gox crash; price dropped 85%, some miners shut down temporarily.
- 2018: Post-2017 bubble; similar pattern of price decline and hashrate reduction.
- May-July 2021: China's mining ban; approximately 50% of global hashrate went offline over several weeks, producing the largest difficulty decrease in Bitcoin's history (28% in a single adjustment on July 3, 2021).
- 2022: Post-FTX crash; mild hashrate reduction as margins compressed.
- 2024-2026: Post-fourth-halving adjustment; continued upward trend as new-generation ASICs deployed.
📊 By the Numbers: Bitcoin's difficulty reached 100 trillion for the first time in late 2024. At that difficulty, finding a valid block requires on average approximately 4.3 x 10^23 SHA-256d computations — roughly the number of stars in the observable universe multiplied by a factor of a trillion.
7.3 Block Rewards and the Halving
7.3.1 The Coinbase Reward
Each valid block entitles the miner to create a special transaction — the coinbase transaction — that produces new bitcoin from nothing. This is the only mechanism by which new bitcoin enters circulation. The coinbase transaction has no inputs (or rather, its input is a null reference) and one or more outputs directing the newly created bitcoin to addresses controlled by the miner.
The coinbase reward has followed a predetermined schedule since Bitcoin's inception:
| Block Range | Years (approx.) | Reward per Block | Total BTC Created |
|---|---|---|---|
| 0 - 209,999 | 2009-2012 | 50 BTC | 10,500,000 |
| 210,000 - 419,999 | 2012-2016 | 25 BTC | 5,250,000 |
| 420,000 - 629,999 | 2016-2020 | 12.5 BTC | 2,625,000 |
| 630,000 - 839,999 | 2020-2024 | 6.25 BTC | 1,312,500 |
| 840,000 - 1,049,999 | 2024-2028 | 3.125 BTC | 656,250 |
7.3.2 The Halving Schedule
Every 210,000 blocks (approximately four years), the block reward is cut in half. This event is known as the halving (or "halvening" in community slang). The halving serves two purposes:
-
Controlled monetary policy. The total supply of bitcoin asymptotically approaches 21 million. The geometric series 50 + 25 + 12.5 + ... converges to 100 BTC per 210,000-block epoch, and 100 × 210,000 = 21,000,000.
-
Transition to fee-based security. As the block subsidy diminishes, transaction fees must eventually comprise the majority of miner revenue. This is by design — the subsidy is a temporary bootstrapping mechanism.
The halvings to date: - First halving: November 28, 2012 (block 210,000). Reward: 50 → 25 BTC. - Second halving: July 9, 2016 (block 420,000). Reward: 25 → 12.5 BTC. - Third halving: May 11, 2020 (block 630,000). Reward: 12.5 → 6.25 BTC. - Fourth halving: April 19, 2024 (block 840,000). Reward: 6.25 → 3.125 BTC. - Fifth halving (projected): ~2028 (block 1,050,000). Reward: 3.125 → 1.5625 BTC.
7.3.3 The Halving and Market Psychology
Each halving reduces the rate of new bitcoin entering the market by 50%. This supply shock has historically been followed by significant price appreciation, though the causal mechanism is debated:
The supply-side argument: If demand remains constant but the flow of new supply is cut in half, economic theory predicts price increases. Pre-halving, 900 BTC per day entered the market (at 6.25 BTC/block x 144 blocks); post-fourth-halving, this dropped to 450 BTC per day. At $85,000 per BTC, that is a reduction of $38.25 million per day in selling pressure from miners (who must sell to cover operating costs).
The narrative argument: Halvings are widely anticipated events in the Bitcoin community. The expectation of price appreciation may be self-fulfilling — traders buy in advance, driving up the price, which attracts media attention, which attracts more buyers.
The efficient market counterargument: If halvings are perfectly predictable (they are — the block height is known years in advance), rational markets should price in the supply reduction well before it occurs. The fact that price often increases significantly after the halving suggests either that markets are not fully efficient or that the halving triggers second-order effects (media attention, narrative shifts) that are not easily priced in advance.
Whatever the cause, the historical pattern is notable: Bitcoin reached new all-time highs within 12-18 months after each of the first four halvings. Whether this pattern will continue is a question for the market, not for computer science — but it has significant implications for mining economics, as price appreciation can offset the reduced block subsidy.
7.3.4 The Fee Transition Problem
The transition from subsidy-dominated to fee-dominated miner revenue is one of the most important open questions in Bitcoin's long-term security model. As of early 2026, transaction fees typically comprise 5-15% of total miner revenue per block, though this percentage spiked dramatically during periods of high network congestion (fees exceeded 40% of block revenue during the Ordinals/BRC-20 inscription boom of 2023-2024).
The concern is straightforward: if the block subsidy approaches zero and transaction fees do not grow sufficiently to compensate, the total revenue available to miners decreases. Lower revenue means less hash power securing the network, which means lower cost to attack.
Several factors may mitigate this concern: - Bitcoin's price appreciation may offset the declining subsidy in fiat terms. - Layer 2 solutions (Lightning Network, discussed in Chapter 12) may generate sufficient on-chain settlement transactions to sustain fees. - New use cases like Ordinals inscriptions have demonstrated that demand for block space can grow in unexpected ways. - Fee markets may mature as users develop better fee estimation tools and time-preference-based bidding.
⚠️ Open Question: The fee transition is not guaranteed to work smoothly. Some researchers, notably Princeton's Arvind Narayanan and collaborators, have argued that a purely fee-based security model creates perverse incentives including "fee sniping" (discussed in Section 7.8). The community has no consensus on whether this will be a serious problem.
7.4 Mining Hardware Evolution
7.4.1 The Four Eras
The history of Bitcoin mining hardware is a compressed lesson in semiconductor economics and competitive dynamics:
Era 1: CPU Mining (2009-2010). In Bitcoin's earliest days, Satoshi and a handful of enthusiasts mined using standard desktop CPUs. Satoshi's original Bitcoin client included a built-in mining function. A typical CPU could compute a few million hashes per second (MH/s). During this period, the difficulty was so low that a single laptop could find blocks.
Era 2: GPU Mining (2010-2013). In October 2010, the first GPU mining code was released. GPUs are massively parallel processors designed for graphics rendering — the same architecture that makes them good at rendering pixels makes them good at computing SHA-256 hashes in parallel. A high-end GPU could compute hundreds of MH/s, roughly 100x faster than a CPU. GPU mining democratized the process somewhat (gamers already owned the hardware) while beginning the professionalization of mining.
Era 3: FPGA Mining (2011-2013). Field-Programmable Gate Arrays offered better energy efficiency than GPUs (more hashes per watt) but similar raw throughput. The FPGA era was brief — the chips were expensive, difficult to program, and quickly overtaken by the next generation.
Era 4: ASIC Mining (2013-present). Application-Specific Integrated Circuits are chips designed to do one thing: compute SHA-256d hashes as fast and efficiently as possible. The first Bitcoin ASICs shipped in early 2013 (Avalon, then Butterfly Labs, then KnCMiner). Within months, they rendered all previous mining hardware obsolete.
7.4.2 The ASIC Arms Race
The ASIC era has been characterized by a relentless drive toward smaller process nodes and higher efficiency:
| Generation | Year | Process Node | Efficiency (J/TH) | Example |
|---|---|---|---|---|
| Early ASICs | 2013 | 130nm | ~1,000 | Avalon A1 |
| Mid ASICs | 2016 | 16nm | ~100 | Antminer S9 |
| Modern ASICs | 2020 | 7nm | ~30 | Antminer S19 Pro |
| Current ASICs | 2024 | 5nm | ~15 | Antminer S21 |
| Next-gen ASICs | 2025-26 | 3nm | ~10 | Antminer S21+ XP |
The trend is clear: each generation is roughly twice as efficient as its predecessor, following the semiconductor industry's scaling curves. However, as process nodes approach physical limits (3nm, 2nm), the rate of improvement is slowing.
7.4.3 Bitmain and Market Concentration
Bitmain Technologies, a Chinese company founded in 2013, has dominated ASIC manufacturing for most of Bitcoin's ASIC era. At its peak, Bitmain controlled an estimated 70-80% of the ASIC market. This concentration raised concerns about single points of failure and supply chain risk.
Competition has increased since 2020, with MicroBT (WhatsMiner series), Canaan (AvalonMiner series), and Intel (Bonanza Mine, discontinued 2024) entering or expanding in the market. As of 2026, Bitmain's market share has decreased to an estimated 50-60%, with MicroBT holding approximately 25-30%.
🔗 Cross-Reference: The tension between mining hardware centralization and Bitcoin's decentralization ethos recurs throughout blockchain design. Chapter 9 (Ethereum and EVM) discusses how Ethereum's transition to Proof of Stake was partly motivated by the ASIC centralization problem.
7.5 Mining Economics
7.5.1 The Fundamental Equation
Mining profitability reduces to a simple inequality:
Revenue > Costs
where:
Revenue = (Block reward + Transaction fees) × Probability of finding a block per unit time
Costs = Electricity costs + Hardware amortization + Cooling/facility costs + Labor + Internet/maintenance
For a miner operating at hashrate h in a network with total hashrate H:
Daily revenue = (h/H) × blocks_per_day × (block_reward + avg_fees) × BTC_price
Daily electricity cost = h × energy_per_hash × 24 × electricity_price
7.5.2 Breakeven Analysis
The breakeven electricity price — the maximum price per kWh at which mining remains profitable — is one of the most important metrics in the industry. As of early 2026, with a block reward of 3.125 BTC, a BTC price around $85,000, and current-generation hardware (approximately 15 J/TH):
Daily revenue per TH/s ≈ (1 TH/s / 700,000,000 TH/s) × 144 blocks × 3.5 BTC × $85,000
≈ $0.061 per day
Daily electricity cost per TH/s = 15 J/TH × 1 TH/s × 86,400 s/day × price_per_kWh / 3,600,000
= 0.36 kWh/day × price_per_kWh
Breakeven: $0.061 / 0.36 kWh = approximately $0.17 per kWh.
This means miners with current-generation hardware remain profitable at electricity prices below roughly $0.17/kWh, before accounting for other costs. In practice, after facility costs, cooling, maintenance, and hardware depreciation, most miners need electricity prices below $0.08/kWh to achieve healthy margins.
7.5.3 The Difficulty Death Spiral Concern
A common concern among critics is the "difficulty death spiral" scenario: if Bitcoin's price drops sharply, miners become unprofitable and shut down, reducing hashrate. With less hashrate, blocks take longer to produce — but the difficulty adjustment only occurs every 2,016 blocks. If blocks are taking 30 minutes instead of 10, it takes six weeks instead of two weeks to reach the next adjustment. During that six weeks, more miners may shut down, further slowing block production, creating a feedback loop that could potentially stall the chain entirely.
In practice, this death spiral has never occurred, for several reasons:
- Miners have different cost structures. When price drops, the highest-cost miners shut down first, but the lowest-cost miners remain profitable. The hashrate decline is gradual, not instantaneous.
- The 4x clamping limit constrains the adjustment. Even in the worst case, the difficulty can only decrease by 75% in a single period, preventing extreme oscillation.
- Miners with sunk hardware costs often mine at a loss temporarily, hoping for price recovery, because shutting down and restarting has its own costs.
- Historical evidence. Bitcoin's price has crashed 50-85% multiple times (2011, 2014, 2018, 2022), and while hashrate declined temporarily after each crash, the network never experienced a sustained difficulty spiral.
Nevertheless, the theoretical risk is real for smaller Proof of Work chains where the mining ecosystem is less diverse and miners can easily redirect their hardware to more profitable chains.
7.5.4 Geographic Migration
Mining has migrated globally in pursuit of cheap electricity:
- 2013-2021: China dominant. At its peak, China hosted 65-75% of global hashrate, concentrated in Sichuan (cheap hydroelectric during rainy season), Xinjiang (cheap coal), and Inner Mongolia (cheap coal). China's comprehensive mining ban in June 2021 forced a mass exodus.
- 2021-present: North America, Central Asia, Nordic countries. After the China ban, hashrate redistributed primarily to the United States (Texas, Georgia, New York), Kazakhstan (cheap coal and gas), Russia, Canada, and Nordic countries (geothermal in Iceland, hydroelectric in Norway/Sweden).
- 2024-2026: Stranded energy specialization. The latest trend is miners co-locating with stranded energy sources — flared natural gas at oil wells, curtailed renewable energy, behind-the-meter arrangements at power plants.
📊 By the Numbers (2026 estimates): - United States: ~38% of global hashrate - Russia: ~12% - Kazakhstan: ~8% - Canada: ~7% - Nordic countries: ~5% - Other: ~30%
7.5.5 The Python Profitability Calculator
The code/mining_economics.py script in this chapter's code directory implements a mining profitability calculator that models:
- Revenue based on hashrate, network difficulty, block reward, and BTC price
- Electricity costs at various price points
- Hardware amortization over configurable lifespans
- Breakeven analysis across a range of electricity prices and BTC prices
- Sensitivity analysis showing how profitability changes with each variable
We encourage you to experiment with the calculator to understand how sensitive mining profitability is to each parameter. You will find that electricity price and BTC price dominate, while hashrate improvements provide a temporary advantage that the difficulty adjustment eventually neutralizes.
7.6 Mining Pools
7.6.1 The Variance Problem
Consider a miner controlling 0.001% of the network hashrate. At current difficulty, this miner would expect to find one block every 694 days on average. But "on average" conceals enormous variance — the miner might find two blocks in a week, or none in three years. This variance makes solo mining financially untenable for all but the largest operations.
Mining pools solve this problem through risk pooling. A pool aggregates hash power from thousands of miners, finds blocks more frequently, and distributes rewards proportionally. A miner contributing 0.001% of the pool's hashrate receives 0.001% of each block reward the pool finds.
7.6.2 How Pools Work
Pool mining uses a share-based system:
- The pool operator distributes a block template to pool members.
- Each miner works on finding a valid nonce, but the pool also sets a lower share difficulty — a target much easier than the network target.
- When a miner finds a hash below the share difficulty but above the network target, they submit it as a share — proof that they performed work.
- When a miner finds a hash below the network target, the pool has found a block. The pool submits the block and distributes the reward among members proportional to shares submitted.
7.6.3 Reward Distribution Methods
Several reward distribution schemes exist:
Pay-Per-Share (PPS): The pool pays a fixed amount per share, regardless of whether the pool finds blocks. The pool operator absorbs the variance risk. This is the simplest model for miners but requires the pool to maintain significant reserves.
Full Pay-Per-Share (FPPS): Like PPS, but also distributes an estimated transaction fee component per share. This is the dominant model as of 2026.
Pay-Per-Last-N-Shares (PPLNS): Rewards are distributed based on the last N shares submitted before a block is found. This rewards loyal miners and penalizes pool-hoppers.
Proportional: Rewards are split proportionally based on shares submitted during each round (from the previous block to the current one). Simple but vulnerable to pool-hopping.
7.6.4 The Stratum Protocol
The communication protocol between pool operators and individual miners is called Stratum. The original Stratum protocol (V1), developed in 2012 by Marek Palatinus (founder of Slush Pool, now Braiins Pool), works as follows:
- The miner connects to the pool server over TCP.
- The pool sends a mining.notify message containing the block template: the previous block hash, the coinbase transaction (partially constructed), the Merkle branch (allowing the miner to compute the Merkle root for any coinbase modification), and the current target.
- The miner generates different coinbase values (varying the extra nonce), computes the resulting Merkle root, assembles the block header, and searches for a valid nonce.
- When the miner finds a share (or a valid block), it sends a mining.submit message back to the pool.
A critical detail: under Stratum V1, the pool operator constructs the block template, including selecting which transactions to include. Individual miners have no control over transaction selection. This gives pool operators significant power — a power they could use for transaction censorship or other manipulation.
Stratum V2, developed by Braiins and the broader mining community, addresses this by introducing a Job Declaration protocol that allows individual miners to construct their own block templates. The pool still coordinates work distribution and reward calculation, but transaction selection is decentralized. As of 2026, Stratum V2 adoption is growing but not yet universal — it requires firmware updates on miners and server-side support from pools.
7.6.5 Pool Centralization: The Data
Mining pool concentration is one of the most monitored metrics in Bitcoin's ecosystem. As of early 2026, the largest pools by hashrate share are approximately:
| Pool | Est. Hashrate Share | Headquarters |
|---|---|---|
| Foundry USA | ~30% | United States |
| AntPool | ~18% | China/HK |
| F2Pool | ~12% | China/Singapore |
| ViaBTC | ~10% | China/HK |
| Binance Pool | ~8% | Global |
| Other | ~22% | Various |
The top two pools control roughly 48% of hashrate — uncomfortably close to the 51% threshold. However, several factors mitigate this concern:
- Pool operators do not own the hashrate. Individual miners choose which pool to join and can switch pools instantly (or within minutes). If a pool attempted malicious behavior, its miners would leave.
- Stratum V2. The next-generation mining protocol (under development and partially deployed) allows individual miners to construct their own block templates rather than accepting the pool's template. This reduces pool operators' power over transaction selection.
- Historical precedent. In June 2014, the pool GHash.io briefly exceeded 50% of hashrate. Miners voluntarily left the pool within days, demonstrating the self-correcting nature of the system.
⚠️ Centralization Warning: While pool centralization has self-correcting properties, it is not a solved problem. During the GHash.io incident, the community discovered that some miners were slow to react, and the concentration persisted for several days. In a sophisticated attack scenario, "several days" might be enough.
7.7 The 51% Attack
7.7.1 Theory
The most discussed attack against Proof of Work blockchains is the 51% attack (more precisely, a majority hashrate attack). An attacker who controls more than 50% of the network's mining power can:
What the attacker CAN do: - Double-spend. The attacker sends bitcoin to a victim (e.g., an exchange), waits for confirmations, then mines a longer alternative chain that does not include that transaction, replacing the original chain and recovering the spent bitcoin. - Censor transactions. The attacker can refuse to include specific transactions in blocks they mine, preventing those transactions from confirming (as long as the attacker maintains majority hashrate). - Prevent other miners from finding blocks. By mining a private chain and releasing it strategically, the attacker can orphan blocks mined by honest miners, wasting their work.
What the attacker CANNOT do: - Steal bitcoin from arbitrary addresses. Mining does not grant access to private keys. The attacker cannot create transactions spending other people's bitcoin. - Change the block reward. The protocol rules are enforced by all full nodes, not just miners. A block claiming an invalid reward would be rejected by the network. - Reverse very old transactions (practically). While theoretically possible, rewriting a deep chain requires enormous sustained effort. The deeper the transaction, the more expensive the attack. - Destroy Bitcoin. Even a successful 51% attack does not permanently compromise the network. The community can respond by changing the Proof of Work algorithm (a "nuclear option" that would render the attacker's hardware worthless).
7.7.2 The Mathematics of Double-Spending
Satoshi's original whitepaper includes a probability analysis of double-spending that remains foundational. The question is: if an attacker controls a fraction q of the network hashrate (and honest miners control p = 1 - q), what is the probability that the attacker can catch up from a deficit of z blocks?
If the attacker is behind by z blocks (because the merchant waited for z confirmations before accepting the payment), the probability of the attacker eventually catching up follows a random walk analysis. When q < p (the attacker has less than 50% hashrate), the probability of catching up from z blocks behind is:
P(catch up) = (q/p)^z
For example, if the attacker has 30% of hashrate (q = 0.3, p = 0.7) and the merchant waits for 6 confirmations:
P = (0.3/0.7)^6 = (0.4286)^6 ≈ 0.006 = 0.6%
This is why 6 confirmations (approximately 1 hour) is the standard security threshold for most Bitcoin transactions — it reduces the probability of a successful double-spend to less than 1% even against a moderately powerful attacker.
For high-value transactions, more confirmations are warranted. Against an attacker with 45% hashrate and 6 confirmations, the probability rises to approximately 32% — uncomfortably high. At 12 confirmations against the same attacker, it drops to about 10%. The more hashrate the attacker controls, the more confirmations are needed.
📊 Confirmation Guidelines: - Small transactions (< $1,000): 1-2 confirmations usually sufficient - Medium transactions ($1,000 - $100,000): 3-6 confirmations - Large transactions (> $100,000): 6+ confirmations - Exchange deposits of large amounts: 10-60 confirmations (exchange-dependent)
7.7.3 Economic Deterrents
The cost of a 51% attack against Bitcoin is staggering. As of early 2026:
Hardware cost: Acquiring 51% of Bitcoin's hashrate (~357 EH/s) would require approximately 2.5 million current-generation ASIC units, at a cost of roughly $10-15 billion — assuming they were available, which they are not (global ASIC production is insufficient to fulfill such an order in less than years).
Electricity cost: Operating that hashrate would consume approximately 5-7 GW of power continuously, costing roughly $2-4 million per hour depending on electricity prices.
Opportunity cost: An entity with 51% hashrate would earn more by mining honestly than by attacking. The attack would likely crash Bitcoin's price, destroying the value of the attacker's own holdings and hardware.
Detection: A 51% attack would be visible to the entire network in real time. Exchanges would halt deposits, the community would mobilize, and the attacker's window of profitable exploitation would be narrow.
7.7.4 State-Level Threat Actors
A question frequently raised in the security community: could a nation-state execute a 51% attack against Bitcoin? The answer is "theoretically possible but practically implausible," for reasons that illuminate the depth of Bitcoin's security model.
Could they afford it? At $10-15 billion for hardware plus billions more in electricity, the cost is within the budget of major nation-states. The U.S. defense budget is approximately $900 billion per year; China's is approximately $300 billion.
Could they acquire the hardware? This is the binding constraint. Global ASIC production capacity is limited, and a sudden order for millions of units would take 1-2 years to fulfill, alerting the entire industry. A covert hardware acquisition program would face supply chain detection challenges.
Would it work? A state-level attack would be detected immediately. The Bitcoin community could respond by changing the proof-of-work algorithm (a hard fork), rendering all the attacker's hardware worthless. The attacker would have spent billions for a temporary disruption.
The economic argument. A nation-state motivated to destroy Bitcoin would likely find it more effective (and cheaper) to regulate it out of existence within their jurisdiction than to attack the protocol directly. China's 2021 mining ban eliminated more hashrate (approximately 50%) than any conceivable 51% attack, and it cost the Chinese government essentially nothing.
7.7.5 Historical Cases: Smaller Chains
While Bitcoin itself has never suffered a successful 51% attack, smaller Proof of Work chains have been attacked repeatedly:
Bitcoin Gold (BTG), May 2018. An attacker rented hash power (BTG uses the Equihash algorithm, which was still GPU-mineable) and executed a double-spend attack against several exchanges. Approximately $18 million worth of BTG was double-spent. The attacker deposited BTG on exchanges, exchanged it for other currencies, withdrew those currencies, then reorganized the BTG chain to reverse the original deposits. The attack succeeded because BTG's total hashrate was low enough that renting sufficient hash power on services like NiceHash was economically feasible.
Ethereum Classic (ETC), January 2019 and August 2020. ETC suffered multiple 51% attacks. In August 2020, there were three separate reorganizations within a single month, with the deepest reorg extending over 7,000 blocks. These attacks were facilitated by the availability of rental hashrate from miners who had migrated away from ETC as its price and hashrate declined.
The Rental Problem. These attacks highlight a critical vulnerability: when hash power can be rented (from services like NiceHash or from miners who dynamically switch between compatible chains), the cost of a 51% attack is not the capital cost of purchasing hardware but merely the rental cost for the duration of the attack. This is dramatically cheaper. For small-cap Proof of Work coins, the hourly cost of a 51% attack can be as low as a few hundred dollars (see https://www.crypto51.app for live estimates).
🔴 Security Principle: The security of a Proof of Work chain is directly proportional to the economic value securing it. Small chains with low hashrate and rentable mining algorithms are vulnerable to 51% attacks. This is not a theoretical concern — it has happened repeatedly.
7.8 Selfish Mining and Other Attack Strategies
7.8.1 The Selfish Mining Strategy
In 2013, Ittay Eyal and Emin Gun Sirer published a seminal paper, "Majority is Not Enough: Bitcoin Mining is Vulnerable," which described the selfish mining attack. The strategy works as follows:
- The selfish miner finds a block but does not broadcast it to the network. Instead, they continue mining on top of their secret block.
- When the honest network finds a block, the selfish miner releases their previously withheld block, creating a race between two chains of equal length.
- If the selfish miner has good network connectivity, they can often win this race, causing the honest miners' block to be orphaned.
- If the selfish miner finds a second block before the honest network finds one, they release both blocks, definitively orphaning the honest block.
The key insight is that selfish mining can be profitable for a miner with less than 50% of the hashrate — specifically, with as little as approximately 33% if the miner has excellent network connectivity (the exact threshold depends on the proportion of the honest network that receives the selfish miner's block first in a tie).
7.8.2 Why Selfish Mining Matters
Selfish mining challenges the common belief that Proof of Work is incentive-compatible — that rational miners always maximize revenue by following the protocol honestly. The paper showed that miners with sufficient hashrate have an incentive to deviate, and that the resulting equilibrium could lead to mining centralization (since selfish mining is more profitable, smaller miners would be economically pressured to join the selfish mining pool).
In practice, selfish mining has not been conclusively observed on the Bitcoin network for several reasons: - The hashrate threshold (roughly 25-33% for profitability) is difficult to achieve and maintain. - The strategy is detectable through statistical analysis of block timing and orphan rates. - The short-term revenue gain may be offset by long-term reputational damage and the risk of counter-measures.
7.8.3 Fee Sniping
As Bitcoin transitions toward a fee-dominated security model, fee sniping becomes a concern. In fee sniping, a miner who observes a recently mined block containing high fees deliberately attempts to mine an alternative block at the same height, "stealing" those fees. If the re-mining miner has sufficient hashrate, this is sometimes profitable.
Bitcoin Core mitigates fee sniping by setting the nLockTime field of transactions to the current block height, preventing them from being included in earlier blocks. However, this is a convention, not a consensus rule, and its effectiveness depends on wallet implementation.
7.8.4 Block Withholding Attack
In pool mining, a malicious miner can perform a block withholding attack: they submit shares (proving they are doing work) but discard any valid blocks they find (rather than submitting them to the pool). This harms the pool's expected revenue while the attacker still receives payment for submitted shares. The attack is difficult to detect because shares and valid blocks are indistinguishable from the pool operator's perspective until a block is actually found.
The block withholding attack is particularly insidious because it can be used as a competitive weapon between pools. Pool A could direct some of its miners to join Pool B and perform block withholding, reducing Pool B's revenue and making it less attractive to honest miners. This has been called the "inter-pool attack" and, while difficult to prove, has been suspected in several incidents where pools experienced anomalously low block-finding rates.
7.8.5 The Incentive Compatibility Question
Together, selfish mining, fee sniping, and block withholding raise a fundamental question: is Bitcoin's mining mechanism actually incentive-compatible? In mechanism design theory, a mechanism is incentive-compatible if all participants maximize their payoff by behaving honestly. The standard narrative about Bitcoin assumes incentive compatibility — miners earn the most by following the rules.
The research surveyed in this section suggests that this assumption is approximately correct for the current network (where the block subsidy dominates fees and hashrate is distributed among many miners), but may become less correct as the subsidy declines and fees become more variable. The long-term incentive structure of Bitcoin mining is not fully understood, and this remains one of the most important open questions in the field.
🧪 Research Frontier: The interaction between selfish mining, fee sniping, and the transition to a fee-dominated security model is an active area of research. See Carlsten et al. (2016), "On the Instability of Bitcoin Without the Block Reward," for the most cited analysis of these interconnected risks.
7.9 The Energy Debate
7.9.1 The Real Numbers
Let us begin with data rather than rhetoric.
Bitcoin's energy consumption as of early 2026, according to the Cambridge Bitcoin Electricity Consumption Index (CBECI): - Annualized electricity consumption: approximately 150-170 TWh/year - This represents: approximately 0.6-0.7% of global electricity production (~28,000 TWh/year per IEA) - Peak power draw: approximately 17-20 GW continuously
For context, these comparisons use data from the International Energy Agency (IEA), the Cambridge Centre for Alternative Finance, and peer-reviewed research:
| Activity | Est. Annual Energy (TWh) | Source |
|---|---|---|
| Bitcoin mining | 150-170 | CBECI, 2026 |
| Gold mining | 130-240 | World Gold Council / de Vries (2022) |
| Global banking system | 260-340 | Galaxy Digital (2021) / Valuechain (2023) |
| Global data centers (all) | 460-500 | IEA (2024) |
| YouTube streaming alone | 20-30 | Estimated from IEA data |
| U.S. residential A/C | 500+ | EIA (2023) |
| Global tumble dryers | 100-120 | IEA estimate |
| Global aviation | 3,000+ | IEA (2024) |
7.9.2 The Case Against: Environmental Concerns
⚖️ Both Sides — The Critique:
Critics of Bitcoin's energy consumption make several substantive arguments:
1. Absolute scale matters. Regardless of comparisons, 150+ TWh per year is an enormous amount of energy. This is comparable to the total electricity consumption of countries like Poland or Egypt. In a world facing a climate crisis, dedicating this much energy to a financial system used by a fraction of the global population is difficult to justify.
2. Carbon intensity. While the renewable percentage of Bitcoin mining has increased, a significant portion of mining still relies on fossil fuels. The Cambridge Centre for Alternative Finance estimated the sustainable energy mix at approximately 37-53% in 2022 (estimates vary widely due to methodological challenges). Even at 50% renewables, Bitcoin mining produces tens of millions of tonnes of CO2 annually.
3. Opportunity cost of renewables. When miners consume renewable energy, that energy is unavailable for other uses. If a Bitcoin mine in Texas consumes 500 MW of wind power, that wind power is not displacing 500 MW of natural gas on the grid. The relevant question is not "does Bitcoin use renewables?" but "what would that renewable energy power if Bitcoin mining didn't exist?"
4. E-waste. ASIC miners have functional lifespans of 3-5 years before they become unprofitable. This creates a significant electronic waste stream. De Vries and Stoll (2021) estimated Bitcoin's annual e-waste at approximately 30,000 tonnes — comparable to the IT waste of a country like the Netherlands.
5. The marginal analysis. Even if Bitcoin's total energy consumption is small relative to global totals, what matters is the marginal impact. Every additional TH/s of hashrate increases energy consumption without improving Bitcoin's utility for users (it only increases security, which is already astronomically high for practical purposes).
7.9.3 The Case For: Counterarguments
⚖️ Both Sides — The Defense:
Proponents of Bitcoin mining's energy use present the following counterarguments, with varying degrees of strength:
1. Energy consumption is not CO2 emission. The carbon footprint of Bitcoin mining depends entirely on the energy source. A miner running on hydroelectric power in Quebec has a fundamentally different environmental impact than one running on coal in Kazakhstan. Conflating energy consumption with environmental damage is a category error. The relevant metric is CO2 per transaction or per unit of secured value, not TWh.
2. The renewable mix is improving. Bitcoin miners are economically incentivized to seek the cheapest energy, which increasingly means renewables. The Bitcoin Mining Council (an industry group, so treat their data with appropriate skepticism) reported that its members' sustainable energy mix exceeded 60% in 2024. Third-party estimates (CBECI, Daniel Batten's analysis) range from 50-60% for the global mining network.
3. Stranded and curtailed energy. This is the strongest argument in the proponents' arsenal. Some mining operations specifically target energy that would otherwise be wasted: - Flared natural gas: Oil wells produce associated gas that is often flared (burned without capturing energy) because pipeline infrastructure is unavailable. Companies like Crusoe Energy Systems place mining containers at well sites, converting flared gas to electricity for mining. This captures energy that was already being wasted and reduces methane emissions (methane is a far more potent greenhouse gas than CO2). - Curtailed renewables: Wind and solar farms sometimes produce more electricity than the grid can absorb, particularly in areas with transmission constraints. Mining can absorb this surplus, improving the economics of renewable energy projects and potentially accelerating their deployment. - Demand response: Some mining operations contractually agree to shut down during peak grid demand, acting as interruptible load. ERCOT (the Texas grid operator) has enrolled Bitcoin miners in its demand response programs, which helps stabilize the grid.
4. Comparison to the value secured. Bitcoin secures hundreds of billions of dollars in value for millions of users worldwide, including people in countries with unreliable financial infrastructure. The energy cost per unit of value secured has decreased dramatically as Bitcoin has grown. Whether this is a "good" use of energy is ultimately a value judgment, not a technical question.
5. The thermodynamic argument. All monetary systems require energy to operate and secure. Gold mining and refining consume comparable energy. The global banking system, including branches, ATMs, data centers, and armored transport, consumes substantially more. The question is not whether Bitcoin uses energy but whether its energy use is proportionate to the service it provides.
7.9.4 The Methane Mitigation Argument
One specific environmental argument deserves separate treatment because it is both the most quantitatively compelling and the most counterintuitive: methane mitigation through flare gas mining.
When oil is extracted, associated natural gas is often produced as a byproduct. In remote locations without pipeline infrastructure, this gas cannot be transported to market economically. The standard practice is to flare it (burn it in an open flame) or, worse, vent it directly into the atmosphere. Vented methane is approximately 80 times more potent as a greenhouse gas than CO2 over a 20-year period.
Flaring converts methane to CO2 (a large improvement over venting) but wastes the energy entirely. Bitcoin mining offers a third option: burn the gas in a generator to produce electricity, use that electricity for mining, and capture the economic value of the energy. The combustion is more complete in a generator than in an open flare (reducing methane slip), and the economic incentive ensures the gas is actually burned rather than vented.
Several companies (Crusoe Energy Systems, Giga Energy, Upstream Data) have built businesses around this model. Crusoe, the largest, operates hundreds of modular data centers at oil well sites across the United States and has measurably reduced methane emissions at its partner locations.
The numbers are significant: the World Bank estimates that approximately 140 billion cubic meters of natural gas are flared globally each year, equivalent to roughly 270 TWh of electricity — more than enough to power the entire Bitcoin network. If even a fraction of this flared gas were redirected to mining, the net environmental impact could be positive (reduced methane emissions outweighing the CO2 from combustion).
⚖️ Both Sides — Caveat: The methane mitigation argument applies only to miners who actually co-locate with flare sites. As of 2026, this represents a single-digit percentage of total Bitcoin hashrate. The argument cannot be used to defend the environmental record of the majority of mining, which operates on grid electricity.
7.9.5 An Honest Assessment
⚖️ Both Sides — Synthesis:
Having presented both cases as fairly as we can, several honest conclusions emerge:
First, the energy consumption is real, significant, and not trivially justified by comparisons to other systems. "Gold mining uses energy too" does not make Bitcoin's energy use environmentally costless.
Second, the most compelling defense is the stranded/curtailed energy argument, but it applies to a subset of mining, not the majority. Claims that "Bitcoin mining is mostly renewable" or "Bitcoin fixes energy waste" overstate the current reality, though the trend is in that direction.
Third, the environmental impact is not fixed — it depends on policy, technology, and the energy mix of the jurisdictions where mining occurs. Countries that ban mining (as China did) push it toward jurisdictions with different energy mixes, with unpredictable net environmental effects.
Fourth, the Proof of Work energy debate is inseparable from the question of whether Proof of Stake (Chapter 10) provides equivalent security guarantees. If it does, then Proof of Work's energy expenditure is unnecessary for most blockchains. If it does not — if Proof of Work provides fundamentally different security properties — then the energy cost is the price of those properties.
Fifth, reasonable people can disagree. The energy debate is ultimately a question of values: how much energy is "worth" spending on a decentralized, censorship-resistant monetary system? The answer depends on how much you value those properties, which is a political and philosophical question, not a technical one.
📊 Data Integrity Note: Energy consumption estimates for Bitcoin mining carry significant uncertainty (typically ±20-30%) because hashrate-to-energy conversion depends on assumptions about the hardware mix in operation and the efficiency of cooling systems. The CBECI provides a range (lower bound, best estimate, upper bound) rather than a point estimate. Always cite ranges and methodologies, not single numbers.
7.10 Putting It All Together: Mining as Mechanism Design
Before we summarize, it is worth stepping back to see mining as what it fundamentally is: a mechanism design — an economic system engineered to produce a desired outcome (consensus on transaction ordering) from self-interested participants (miners) without a trusted coordinator.
The genius of Satoshi's design is how multiple mechanisms interlock:
- The puzzle creates cost. Proof of Work ensures that proposing a block requires real resource expenditure, making spam and Sybil attacks expensive.
- The reward creates incentive. Block rewards and transaction fees ensure that miners are compensated for their expenditure, attracting hash power to secure the network.
- The difficulty adjustment creates stability. By adjusting the puzzle's difficulty to maintain a consistent block rate, the protocol adapts to changing conditions without human intervention.
- The longest-chain rule creates convergence. By defining the valid chain as the one with the most cumulative Proof of Work, the protocol ensures that all honest nodes eventually agree on the same transaction history.
- The halving creates scarcity. The diminishing block subsidy ensures a finite supply while gradually transitioning the security model from subsidy-based to fee-based.
Each of these mechanisms has known imperfections — selfish mining exploits the reward structure, pool centralization threatens the decentralization assumption, the energy cost raises environmental concerns, and the fee transition introduces long-term uncertainty. But the system as a whole has functioned continuously since January 3, 2009 — over 17 years without a single hour of downtime — securing hundreds of billions of dollars in value. Whatever its theoretical vulnerabilities, its empirical track record is remarkable.
7.11 Summary and Bridge to Chapter 8
This chapter has traced Bitcoin mining from its cryptographic foundations through its economic realities. The Proof of Work mining puzzle — finding a nonce that produces a hash below the target — is elegantly simple but creates a remarkably robust consensus mechanism. The difficulty adjustment ensures that blocks arrive approximately every 10 minutes regardless of hash power fluctuations. The halving schedule creates a deflationary monetary policy converging to 21 million bitcoin.
The economics of mining are driven by the interplay of hardware efficiency, electricity cost, Bitcoin price, and network difficulty. The hardware arms race has progressed through four generations (CPU, GPU, FPGA, ASIC) and is now approaching semiconductor fabrication limits. Mining pools address the variance problem but introduce centralization risks that the community monitors vigilantly.
The 51% attack, while theoretically devastating, is economically prohibitive against Bitcoin — though smaller chains have been attacked repeatedly, demonstrating that Proof of Work security scales with economic value. Selfish mining and fee sniping challenge simplistic assumptions about miner incentives and remain active areas of research.
The energy debate defies easy answers. Bitcoin's energy consumption is real and significant. It is neither the environmental catastrophe that critics allege (the comparisons and renewable trends matter) nor the virtuous energy use that proponents celebrate (the scale and carbon intensity matter too). Honest engagement requires data, context, and a willingness to hold two truths simultaneously.
In Chapter 8, we turn from how new bitcoin is created to how existing bitcoin is managed: wallets, key management, and the user experience of Bitcoin. If mining is Bitcoin's engine, wallets are its steering wheel — and as we will see, the user experience challenges are every bit as formidable as the cryptographic ones.
Key Formulas in This Chapter
| Formula | Description |
|---|---|
| SHA-256(SHA-256(header)) < target | The mining puzzle |
| P(success) = target / 2^256 | Probability of finding a valid block per hash |
| new_target = old_target x (actual_time / expected_time) | Difficulty adjustment |
| Revenue = (h/H) x 144 x (subsidy + fees) x price | Daily mining revenue |
| Breakeven = daily_revenue / daily_energy_kWh | Maximum profitable electricity price |
Suggestions for Further Exploration
- Run the
code/mining_simulation.pyscript and observe how the time to find a valid nonce increases with difficulty. - Use the
code/mining_economics.pycalculator to find the breakeven electricity price at your local electricity rate. - Visit the Cambridge Bitcoin Electricity Consumption Index (https://ccaf.io/cbnsi/cbeci) and explore the live estimates.
- Read Eyal and Sirer's "Majority is Not Enough" paper (2014) for the original selfish mining analysis.
- Examine the block reward halving dates on a Bitcoin block explorer and correlate them with price history.