Mining Economics
Mining hardware (ASICs, GPUs), mining pools, hashrate, energy consumption, profitability calculations, mining difficulty, and block rewards.
Overview
Mining is the process of validating transactions and adding blocks to the blockchain. Understanding mining economics is essential for network security and profitability analysis.
Mining Hardware
Mining Pools
Pool Types
| Type | Description | Pros | Cons |
|---|---|---|---|
| PPS | Pay Per Share | Stable income | Higher fees |
| PPLNS | Pay Per Last N Shares | Lower fees | Variable income |
| SOLO | Solo mining | No fees | High variance |
| PROP | Proportional | Fair share | Pool hopping |
| FPPS | Full PPS | Includes fees | Higher fees |
Pool Hashrate Distribution (2024)
| Pool | Hashrate Share | Region | Fee |
|---|---|---|---|
| Foundry USA | 30% | USA | 2.5% |
| AntPool | 18% | China | 2.0% |
| ViaBTC | 15% | China | 2.0% |
| F2Pool | 12% | China | 2.5% |
| Binance Pool | 10% | Global | 2.5% |
| Others | 15% | Various | 1-3% |
Pool Selection Criteria
def calculate_pool_score(pool):
"""Score = (Reward à (1 - Fee)) / (Variance à Latency)"""
reward_per_share = pool.block_reward / pool.difficulty
expected_income = reward_per_share * pool.your_hashrate
adjusted_income = expected_income * (1 - pool.fee)
variance_factor = 1 / pool.variance
latency_factor = 1 / (pool.latency_ms / 1000)
return (adjusted_income * variance_factor * latency_factor) / 1000
Hashrate and Difficulty
Hashrate Calculation
Difficulty Adjustment
Bitcoin Difficulty Schedule
| Year | Difficulty | Hashrate (EH/s) | Block Time |
|---|---|---|---|
| 2009 | 1 | 0.000001 | 10 min |
| 2012 | 4M | 0.01 | 10 min |
| 2016 | 1T | 1 | 10 min |
| 2020 | 20T | 120 | 10 min |
| 2024 | 80T | 600 | 10 min |
| 2025 | 100T+ | 800+ | 10 min |
Difficulty Target
Target (hex): 0000000000000000000abc...
Target (bits): 0x1703a2b2
bits[0:3] = exponent (0x17 = 23 bytes)
bits[3:8] = coefficient (03a2b2)
Target = coefficient à 2^(8 à (exponent - 3))
Target = 0x03a2b2 Ã 2^(8 Ã 20)
Block Rewards
Bitcoin Halving Schedule
| Halving | Date | Block Reward | Total Supply |
|---|---|---|---|
| 0 | 2009 | 50 BTC | 0 |
| 1 | 2012 | 25 BTC | 10.5M |
| 2 | 2016 | 12.5 BTC | 15.75M |
| 3 | 2020 | 6.25 BTC | 18.375M |
| 4 | 2024 | 3.125 BTC | 19.6875M |
| 5 | 2028 | 1.5625 BTC | 20.34375M |
| â | 2140 | 0 BTC | 21M |
Block Reward Formula
Revenue Breakdown
def calculate_block_revenue(block_height):
# Block subsidy
halvings = block_height // 210000
subsidy = 50 / (2 ** halvings)
# Transaction fees (variable)
avg_fee_per_block = 0.5 # BTC (varies)
total_revenue = subsidy + avg_fee_per_block
return {
"subsidy": subsidy,
"fees": avg_fee_per_block,
"total": total_revenue,
"usd_value": total_revenue * btc_price
}
Energy Consumption
Bitcoin Energy Statistics
| Metric | Value (2024) |
|---|---|
| Annual Energy | ~150 TWh |
| Global Share | 0.07% |
| Per Transaction | ~700 kWh |
| Carbon Footprint | ~65 Mt CO2 |
| Renewable Share | ~55% |
| Stranded Energy | ~30% |
Energy Comparison
| Activity | Energy (kWh) | BTC Equivalent |
|---|---|---|
| 1 BTC Transaction | 700 | 1 |
| Average US Home (year) | 10,500 | 15 |
| Gold Mining (1 oz) | 50,000 | 71 |
| Aluminum Smelting (1 ton) | 15,000 | 21 |
| Netflix Streaming (hour) | 0.08 | 0.0001 |
Mining Energy Mix
Profitability Calculations
Basic Formula
Detailed Profitability Calculator
def mining_profitability(
hashrate_th, # TH/s
power_watts, # Watts
electricity_cost, # $/kWh
btc_price, # USD
pool_fee=0.02, # 2%
difficulty=80e12 # Current difficulty
):
# Daily revenue
hashrate_ths = hashrate_th * 1e12
blocks_per_day = 144 # Bitcoin
your_share = hashrate_ths / (difficulty * 2**32 / 600)
btc_per_day = your_share * (3.125 + 0.5) * (1 - pool_fee)
revenue_usd = btc_per_day * btc_price
# Daily cost
energy_kwh = power_watts * 24 / 1000
electricity_cost_daily = energy_kwh * electricity_cost
# Profit
profit = revenue_usd - electricity_cost_daily
roi_days = (hardware_cost / profit) if profit > 0 else float('inf')
return {
"btc_per_day": btc_per_day,
"revenue_usd": revenue_usd,
"electricity_cost": electricity_cost_daily,
"profit_usd": profit,
"roi_days": roi_days
}
Example Calculations
| Hardware | Hashrate | Power | Elec Cost | Revenue/Day | Cost/Day | Profit/Day |
|---|---|---|---|---|---|---|
| Antminer S21 | 200 TH/s | 3500W | 28 | 23.80 | ||
| Antminer S19 | 110 TH/s | 3250W | 15 | 11.10 | ||
| GPU Rig (8x) | 0.6 GH/s | 1200W | 8 | 6.56 | ||
| Antminer S21 | 200 TH/s | 3500W | 28 | 19.60 |
Mining Farm Economics
Cost Structure
| Cost Category | Percentage | Notes |
|---|---|---|
| Electricity | 60-70% | Largest variable cost |
| Hardware | 15-20% | Depreciation over 3-5 years |
| Cooling | 5-10% | Depends on climate |
| Rent/Facility | 3-5% | Location dependent |
| Maintenance | 2-3% | Hardware replacement |
| Staff | 1-2% | 24/7 operations |
Location Analysis
| Region | Elec Cost | Climate | Infrastructure | Regulatory |
|---|---|---|---|---|
| Texas, USA | $0.04-0.06 | Hot | Excellent | Favorable |
| Kazakhstan | $0.03-0.05 | Extreme | Limited | Uncertain |
| Iceland | $0.03-0.04 | Cold | Good | Favorable |
| Norway | $0.04-0.06 | Cold | Excellent | Favorable |
| Paraguay | $0.01-0.02 | Moderate | Limited | Uncertain |
| Russia | $0.03-0.05 | Extreme | Good | Uncertain |
Mining Farm ROI
Network Statistics
Bitcoin Mining Metrics (2024)
| Metric | Value |
|---|---|
| Total Hashrate | 600+ EH/s |
| Difficulty | 80+ T |
| Block Time | 10 minutes |
| Blocks/Day | 144 |
| Total Miners | ~1M |
| Solo Miners | <1% |
| Pool Miners | >99% |
Mining Revenue History
| Year | Block Reward | BTC/Day | USD/Day | Revenue/Hash |
|---|---|---|---|---|
| 2012 | 25 BTC | 3,600 | $10K | High |
| 2016 | 12.5 BTC | 1,800 | $1M | Medium |
| 2020 | 6.25 BTC | 900 | $15M | Low |
| 2024 | 3.125 BTC | 450 | $30M+ | Very Low |
Trade-offs
Solo vs Pool Mining
| Aspect | Solo Mining | Pool Mining |
|---|---|---|
| Variance | Very High | Low |
| Fees | None | 1-3% |
| Reward Frequency | Rare | Regular |
| Independence | Full | Shared |
| Setup Complexity | Simple | Moderate |
| Recommended For | Large miners | Most miners |
ASIC vs GPU Mining
| Aspect | ASIC Mining | GPU Mining |
|---|---|---|
| Hashrate | Very High | Medium |
| Efficiency | Very High | Low |
| Flexibility | Algorithm-locked | Multi-algorithm |
| Lifespan | 3-5 years | 5-7 years |
| Resale Value | Depreciates fast | Holds value |
| Initial Cost | High | Medium |
| Best For | Bitcoin | Altcoins |
Energy Cost vs Capital Expenditure
| Strategy | OpEx Focus | CapEx Focus |
|---|---|---|
| Low Elec + Expensive HW | Low profit margin | High profit margin |
| High Elec + Cheap HW | Negative profit | Break-even |
| Moderate Elec + Moderate HW | Balanced | Balanced |
| Cheap Elec + Expensive HW | High profit | Highest profit |
Interview Questions
-
How does Bitcoin's difficulty adjustment maintain 10-minute block times?
- Answer: Every 2016 blocks (~2 weeks), difficulty adjusts based on actual vs expected time. If blocks are faster, difficulty increases; if slower, difficulty decreases. This self-correcting mechanism ensures consistent block times.
-
Why do mining pools exist and how do they benefit miners?
- Answer: Pools combine hashrate to find blocks more frequently, reducing variance. Miners receive proportional shares of rewards. This provides steady income instead of rare large payouts.
-
What happens to mining economics after Bitcoin reaches 21 million supply?
- Answer: Miners will rely solely on transaction fees. If Bitcoin has high usage and demand, fees could be sufficient. Some argue fees alone won't incentivize mining, potentially reducing security.
Quiz Questions
-
What is the current Bitcoin block reward after the 2024 halving?
- A) 6.25 BTC
- B) 3.125 BTC â
- C) 1.5625 BTC
- D) 0.5 BTC
-
Which mining hardware is most energy-efficient for SHA-256?
- A) GPUs
- B) FPGAs
- C) ASICs â
- D) CPUs
-
What percentage of Bitcoin mining uses renewable energy?
- A) 25%
- B) 40%
- C) 55% â
- D) 75%
Practice
- Build a mining profitability calculator in Python
- Simulate Bitcoin difficulty adjustment algorithm
- Analyze historical mining revenue and difficulty correlation
- Design a mining farm business plan with cost projections