Author

Topic: Is there a non-trivial way to get the total number of coins in circulation? (Read 668 times)

copper member
Activity: 2996
Merit: 2374
You cannot add the value of the fees when doing this calculation, you can only add the block subsidies.

This is fairly easy to calculate since there is a fixed block subsidy schedule. The total number of Bitcoins created is 50*210000+25*210000+12.5*28167=16102087.5 BTC. Then subtract the 0.01000001 that were burned in block 124724 and the total is 16102087.48999999 BTC.

Those burned Bitcoin were from the miner (midnightmagic) not paying out the full amount he was entitled to from the block reward. The fees of that block (0.01 BTC) and one satoshi were burned and are now permanently out of circulation.
There are also OP_RETURN outputs that should be subtracted from the number of bitcoin in circulation, as these outputs are provably unspendable, and there is no mechanism in the current protocol to return these outputs to circulation. I am not sure how much bitcoin has been destroyed this way. 
newbie
Activity: 3
Merit: 0
How about:

Code:
bitcoin-cli gettxoutsetinfo
And look for 'total_amount'
That's wonderful. Thank you for the help!!!!!!  Grin
newbie
Activity: 3
Merit: 0
You cannot add the value of the fees when doing this calculation, you can only add the block subsidies.

This is fairly easy to calculate since there is a fixed block subsidy schedule. The total number of Bitcoins created is 50*210000+25*210000+12.5*28167=16102087.5 BTC. Then subtract the 0.01000001 that were burned in block 124724 and the total is 16102087.48999999 BTC.

Those burned Bitcoin were from the miner (midnightmagic) not paying out the full amount he was entitled to from the block reward. The fees of that block (0.01 BTC) and one satoshi were burned and are now permanently out of circulation.
Sorry about that, I misspoke on fees. I should have said subsidy Smiley

I'm trying to do this in a way that doesn't rely on understanding the fee structure ahead of time. It's a long story, happy to explain at a later time if interested.

Thank you for the information!
jr. member
Activity: 31
Merit: 1
How about:

Code:
bitcoin-cli gettxoutsetinfo
And look for 'total_amount'
staff
Activity: 3458
Merit: 6793
Just writing some code
You cannot add the value of the fees when doing this calculation, you can only add the block subsidies.

This is fairly easy to calculate since there is a fixed block subsidy schedule. The total number of Bitcoins created is 50*210000+25*210000+12.5*28167=16102087.5 BTC. Then subtract the 0.01000001 that were burned in block 124724 and the total is 16102087.48999999 BTC.

Those burned Bitcoin were from the miner (midnightmagic) not paying out the full amount he was entitled to from the block reward. The fees of that block (0.01 BTC) and one satoshi were burned and are now permanently out of circulation.
newbie
Activity: 3
Merit: 0
Speaking in regards to the current bitcoin-qt client (or litecoin-qt, or both would be even better.)

Looking through the code base I do not see a way to do this other than to manually add the value of each block + fees.

Am I overlooking something?

Thank you for the help.
Jump to: