1
0
mirror of https://github.com/bitcoinbook/bitcoinbook synced 2024-11-23 08:38:10 +00:00
bitcoinbook/code/max_money.py
David A. Harding 2f0d7d8c3a Revert CC-BY-SA material added since the second edition
The commit ab5ae32bae is the last commit
for the second edition, so all changes since then are dropped except for
several commits for the third edition authored by Andreas Antonopoulos.

No attempt is made to remove CC-BY-SA or other licensed content present
in the already-published first or second editions.

This revert may itself be reverted for versions of the book published
under CC-BY-SA.
2023-02-01 06:31:10 -10:00

18 lines
453 B
Python

# Original block reward for miners was 50 BTC
start_block_reward = 50
# 210000 is around every 4 years with a 10 minute block interval
reward_interval = 210000
def max_money():
# 50 BTC = 50 0000 0000 Satoshis
current_reward = 50 * 10**8
total = 0
while current_reward > 0:
total += reward_interval * current_reward
current_reward /= 2
return total
print("Total BTC to ever be created:", max_money(), "Satoshis")