Skip to content

Instantly share code, notes, and snippets.

View daira's full-sized avatar

Daira-Emma Hopwood daira

View GitHub Profile
@daira
daira / supply.py
Created November 12, 2022 00:10
Calculate the Zcash supply after a given block height on Mainnet or Testnet
#!/usr/bin/env python3
def exact_div(x, y):
assert x % y == 0
return x // y
# floor(u/x + v/y)
def div2(u, x, v, y):
return (u*y + v*x) // (x*y)
@daira
daira / incorrect_supply.py
Created November 12, 2022 00:20
Calculate the Zcash supply after a given block height on Mainnet or Testnet
#!/usr/bin/env python3
# ***INCORRECT VERSION, FOR ILLUSTRATION ONLY***
def exact_div(x, y):
assert x % y == 0
return x // y
# floor(u/x + v/y)
def div2(u, x, v, y):
@daira
daira / incorrect_supply.py
Created November 12, 2022 00:20
INCORRECTLY calculate the Zcash supply after a given block height on Mainnet or Testnet (treating Blossom as never activated)
#!/usr/bin/env python3
# ***INCORRECT VERSION, FOR ILLUSTRATION ONLY***
def exact_div(x, y):
assert x % y == 0
return x // y
# floor(u/x + v/y)
def div2(u, x, v, y):
@daira
daira / incorrect_supply_blockchair.py
Created November 12, 2022 00:32
INCORRECTLY calculate the Zcash supply after a given block height on Mainnet or Testnet (not taking into account the slow start)
#!/usr/bin/env python3
# ***INCORRECT VERSION, FOR ILLUSTRATION ONLY***
def exact_div(x, y):
assert x % y == 0
return x // y
# floor(u/x + v/y)
def div2(u, x, v, y):