Learning Objectives:

  • Master the proof-of-work algorithm

  • Understand mining economics and incentives

  • Analyze mining hardware and pools


3.3.1: Proof-of-Work Algorithm

Core PoW Concept:

Miners compete to find a nonce such that the block hash is below the difficulty target.

text
Proof-of-Work Formula:

Find nonce such that:
SHA-256(SHA-256(Block_Header)) < Target

Block_Header = Version + Prev_Hash + Merkle_Root + Timestamp + Target + Nonce

Target = 2²⁵⁶ / Difficulty

Difficulty = Difficulty_1_Target / Current_Target

Difficulty_1_Target = 0x1d00ffff (first difficulty target)

Mining Process:

text
Mining Algorithm:

1. Build candidate block:
   a. Select transactions from mempool
   b. Calculate Merkle root
   c. Set timestamp
   d. Set difficulty target

2. Mine:
   For nonce from 0 to 2³²:
     hash = SHA-256(SHA-256(block_header + nonce))
     if hash < target: SOLUTION FOUND!
     else: continue

3. Block found:
   a. Broadcast block to network
   b. Collect block reward + fees
   c. Reset nonce for next block

Modern Mining:
- ASIC hardware
- Mining pools
- Nonce + extraNonce (4 bytes)
- Timestamp can be adjusted

3.3.2: Mining Difficulty

Difficulty Adjustment Formula:

Bitcoin adjusts difficulty every 2016 blocks (~2 weeks) to maintain 10-minute block time.

text
Difficulty Adjustment:

New_Difficulty = Old_Difficulty × (Actual_Time / Expected_Time)

Where:
- Expected_Time = 2016 × 600 = 1,209,600 seconds (2 weeks)
- Actual_Time = Time since last adjustment

Adjustment Limits:
- Max increase: 4× (300% increase)
- Max decrease: 0.25× (75% decrease)

Example:
If actual time = 1,000,000 seconds (faster):
New_Difficulty = Old_Difficulty × (1,000,000 / 1,209,600)
New_Difficulty = Old_Difficulty × 0.827

If actual time = 1,500,000 seconds (slower):
New_Difficulty = Old_Difficulty × (1,500,000 / 1,209,600)
New_Difficulty = Old_Difficulty × 1.240

Difficulty Statistics (2024):

text
Current Network Stats:
- Difficulty: ~50,000,000,000,000 (50 trillion)
- Hash Rate: ~500 EH/s (500 quintillion hashes/second)
- Block Time: ~10 minutes
- Blocks per day: ~144
- Network Growth: ~50% per year

Mining Probability:
Probability of finding a block per hash:
P = 1 / Difficulty

For Difficulty = 50 trillion:
P = 1 / 5e13 = 2 × 10^-14

Expected hashes per block:
E[hashes] = Difficulty × 2³²
= 5e13 × 4.29e9 = 2.15e23 hashes

Time to mine (at 500 EH/s):
T = 2.15e23 / (5e20) = 430 seconds ≈ 7.2 minutes

3.3.3: Mining Hardware

Evolution of Mining Hardware:

 
 
Era Hardware Hash Rate Efficiency Year
CPU Era Intel/AMD CPU < 100 MH/s 10-100 W 2009-2010
GPU Era AMD/NVIDIA GPU 500 MH/s – 5 GH/s 100-300 W 2010-2011
FPGA Era Field Programmable Gate Arrays 5-50 GH/s 50-100 W 2011-2012
ASIC Era Application-Specific ICs 100 GH/s – 100 TH/s 100-1000 W 2013-2015
Modern ASIC 7nm, 5nm chips 100-500 TH/s 3000-5000 W 2016-2024

ASIC Mining Hardware (2024):

 
 
Model Hash Rate Power Efficiency Cooling
Bitmain Antminer S21 200 TH/s 3,500 W 17.5 J/TH Air
MicroBT Whatsminer M56 180 TH/s 3,200 W 17.8 J/TH Air
Bitmain Antminer S19 110 TH/s 3,250 W 29.5 J/TH Air
MicroBT Whatsminer M50 126 TH/s 3,276 W 26.0 J/TH Air

3.3.4: Mining Pools

Why Mining Pools Exist:

text
Mining Pool Economics:

Solo Mining:
- Find block: 6.25 BTC reward
- Probability: 1 / (Hash_Rate / Network_Hash_Rate)
- Expected time: (Network_Hash_Rate / Hash_Rate) × 10 minutes

Pool Mining:
- Combine hash power
- Share rewards proportionally
- Regular payouts
- Lower variance

Example (Small Miner):
- Hash Rate: 100 TH/s
- Network: 500 EH/s = 5e8 TH/s
- Solo: 1 block every 5e6 blocks ≈ 95 years
- Pool: Daily payouts (~0.0001 BTC/day)

Pool Mining Methods:

 
 
Method Description Reward Distribution Risk
PPS Pay Per Share Fixed per share Pool risk
PPLNS Pay Per Last N Shares Proportional to shares Miner risk
FPPS Full PPS Includes transaction fees Pool risk
Solo Solo Mining Full block reward No pool risk

Top Mining Pools (2024):

text
Mining Pool Distribution:

1. Foundry USA: ~30%
2. Antpool: ~20%
3. F2Pool: ~15%
4. Binance Pool: ~10%
5. ViaBTC: ~8%
6. Others: ~17%

Concentration Risk:
- Top 2 pools: 50%+ of hash rate
- Top 4 pools: 75%+ of hash rate
- Potential for 51% attack (theoretical)
- Mitigation: Pool decentralization efforts

3.3.5: Block Reward and Subsidy

Halving Schedule:

text
Bitcoin Halving Events:

Block #0 (2009): 50 BTC
Block #210,000 (2012): 25 BTC (Halving 1)
Block #420,000 (2016): 12.5 BTC (Halving 2)
Block #630,000 (2020): 6.25 BTC (Halving 3)
Block #840,000 (2024): 3.125 BTC (Halving 4)
Block #1,050,000 (2028): 1.5625 BTC (Halving 5)

Total Supply:
- Circulating: ~19.5 million BTC (as of 2024)
- Remaining: ~1.5 million BTC
- Final block: ~2140

Halving Formula:
Block_Reward = 50 / (2^(Block_Height / 210000))

Where Block_Height is the current block number

Mining Revenue Components:

text
Mining Revenue = Block_Reward + Transaction_Fees

Transaction Fees:
- Voluntary payments to miners
- Priority mechanism
- Fee rate: sat/vB

Fee Market:
- High demand: Higher fees
- Low demand: Lower fees
- Block space limits

Block Reward vs Fees:
2009: 100% reward, 0% fees
2016: 95% reward, 5% fees
2024: 85% reward, 15% fees
2040: 50% reward, 50% fees (estimated)

ADDITIONAL DEEP TECHNICAL NOTES:

1. Mining Profitability Calculation

text
Mining Profitability:

Revenue = (Block_Reward + Fees) × (Hash_Rate / Network_Hash_Rate) × 144 (blocks/day)

Cost = Electricity_Cost × Power_Consumption + Hardware_Amortization

Profit = Revenue - Cost

ROI = Profit / Hardware_Cost

Break-Even = Hardware_Cost / Daily_Profit

Example:
- Hash Rate: 100 TH/s
- Power: 3,000 W
- Electricity: $0.05/kWh
- Hardware: $4,000
- Network: 500 EH/s
- Block Reward: 3.125 BTC
- BTC Price: $60,000

Daily Revenue:
= (3.125 × $60,000) × (1e14 / 5e23) × 144
= $187,500 × 2e-10 × 144
= $0.54/day

Daily Cost:
= 3,000 W × 24 × $0.05 / 1000
= $3.60/day

Daily Profit:
= $0.54 - $3.60 = -$3.06/day

Break-Even:
= $4,000 / -$3.06 = Never (unprofitable)

2. Mining Security

51% Attack Analysis:

text
51% Attack:

Requirements:
- Control >50% of network hash rate
- Cost: >50% of total mining hardware + electricity
- Current (2024): ~$25M/day to attack

What Attack Can Do:
- Double-spend: Spend coins, then orphan transactions
- Censor: Exclude transactions/addresses
- Mine empty blocks: Deny service

What Attack Cannot Do:
- Reverse other people's transactions
- Create new coins
- Steal coins (without private keys)

Defenses:
- Economic incentives
- Difficulty adjustment
- Network monitoring
- Community response