Bitcoin Forum
April 16, 2024, 11:09:45 AM *
News: Latest Bitcoin Core release: 26.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Is there a non-trivial way to get the total number of coins in circulation?  (Read 643 times)
homogenousj (OP)
Newbie
*
Offline Offline

Activity: 3
Merit: 0


View Profile
January 14, 2017, 04:41:30 PM
 #1

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.
1713265785
Hero Member
*
Offline Offline

Posts: 1713265785

View Profile Personal Message (Offline)

Ignore
1713265785
Reply with quote  #2

1713265785
Report to moderator
1713265785
Hero Member
*
Offline Offline

Posts: 1713265785

View Profile Personal Message (Offline)

Ignore
1713265785
Reply with quote  #2

1713265785
Report to moderator
Make sure you back up your wallet regularly! Unlike a bank account, nobody can help you if you lose access to your BTC.
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
achow101
Moderator
Legendary
*
expert
Offline Offline

Activity: 3360
Merit: 6505


Just writing some code


View Profile WWW
January 14, 2017, 04:52:33 PM
Merited by ABCbits (1)
 #2

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.

arubi
Jr. Member
*
Offline Offline

Activity: 31
Merit: 1


View Profile
January 14, 2017, 05:02:02 PM
Merited by ABCbits (1)
 #3

How about:

Code:
bitcoin-cli gettxoutsetinfo
And look for 'total_amount'
homogenousj (OP)
Newbie
*
Offline Offline

Activity: 3
Merit: 0


View Profile
January 14, 2017, 05:23:21 PM
 #4

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!
homogenousj (OP)
Newbie
*
Offline Offline

Activity: 3
Merit: 0


View Profile
January 14, 2017, 05:38:36 PM
 #5

How about:

Code:
bitcoin-cli gettxoutsetinfo
And look for 'total_amount'
That's wonderful. Thank you for the help!!!!!!  Grin
Quickseller
Copper Member
Legendary
*
Offline Offline

Activity: 2870
Merit: 2298


View Profile
January 16, 2017, 04:51:07 AM
 #6

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. 
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!