Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am dlio on github.
  • I am lio (https://keybase.io/lio) on keybase.
  • I have a public key whose fingerprint is FF38 E2EE 35CB C53F D66B 8DC7 102D 6E80 FE1B 0093

To claim this, I am signing this object:

@dlio
dlio / getExtantCoins
Last active August 29, 2015 14:01
Forumla -- Total Extant Bitcoins at a Given Block
# bitcoin example, halving schedule
initial_reward = 50
halving_period = 210000
# given a block height, calculate number of bitcoins minted thus far
blocks = `bitcoind getblockcount`
# number of eras -- rounded up to nearest int
era_count = (blocks / halving_period).ceil
total_coins = 0