Skip to content

Instantly share code, notes, and snippets.

@janbraiins
Last active October 2, 2022 15:28
Show Gist options
  • Star 12 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save janbraiins/d855ef4e0d905308ee21d812026c9d54 to your computer and use it in GitHub Desktop.
Save janbraiins/d855ef4e0d905308ee21d812026c9d54 to your computer and use it in GitHub Desktop.
Estimates cost for mining 1 bitcoin on a recent hardware
#!/usr/bin/python
el_cost_usd = 0.035
# network difficulty
ndiff = 15958652328578.91
block_reward = 6.25
# S9 with AB enabled consumes ~13% less energy (assuming 4-midstates enabled for AB)
# Below is a favorite overclocked configuration (15.6 Th/s , 1331 W)
efficiency_w_per_ths = 85.3
# S9: heavily downclocked
# efficiency_w_per_ths = 71
efficiency_kw_per_hs = efficiency_w_per_ths * 1e-3 * 1e-12
cost = el_cost_usd * efficiency_kw_per_hs * ndiff * (1<<32) / (block_reward * 3600)
print('Cost for mining 1BTC is %.2f (electricity rate USD %.2f/kWh)' % (cost, el_cost_usd))
# 14 TH/s (e.g. S9)
single_hashrate = 14e12
# average power consumption with S9 and AB enabled
power_kw = 1.372 * 0.87
# network difficulty
ndiff = 5646403851534.72
total_hashrate = ndiff * (1<<32) / 600
total_power_gw = power_kw * 1e-6 * total_hashrate / single_hashrate
print('Rough estimate of network power %.3f GW' % total_power_gw)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment