I'm creating a spreadsheet to track total bitcoins in circulation from day 1. This would be to add up each Bitcoin per day created and add to an accumulating total. For example, if we picked any day we could then see what the total amount of Bitcoins created was. If we picked the 1st January 2014 we could say the total Bitcoins mined equals X. If we pick today (3rd June 2019) we could say the total Bitcoins mined equals X. By definition, that would also mean we could calculate how many Bitcoins are left to be mined on any given day. Could some one assist me to find the way to create this spreadsheet? Thanks.
From command line the piping to date command needs a 2nd eye. Bit late for me here, but it's a unix timestamp conversion to whatever format you want.
You can find out by:
- getting the hash of each block at height X using the RPC or
bitcoin-cli getblockhash X
- using the blockhash to get information about that block using RPC or
bitcoin-cli getblock <HASH>
- get the timestamp of that block
- convert timestamp into the date format you want
- get the first transaction of the block (coinbase transaction) for the amount of newly mined coins using RPC or
bitcoin-cli gettransaction <TX>
And run it through every block in a loop.
bitcoin-cli getblockhash 1 00000000839a8e6886ab5951d76f411475428afc90947ee320161bbf18eb6048 bitcoin-cli getblock 00000000839a8e6886ab5951d76f411475428afc90947ee320161bbf18eb6048 | jq '.time' | date Mon Jun 3 18:54:45 UTC 2019 bitcoin-cli getrawtransaction `bitcoin-cli getblock 00000000839a8e6886ab5951d76f411475428afc90947ee320161bbf18eb6048 | jq -r '.tx'` true | jq '.vout.value' 50
Here is block #1 on a btc explorer showing the same data, 50 new coins.
You can loop like that on command line but probably better to do with RPC and a real programming language.