Bitcoin Forum
November 14, 2024, 06:59:19 PM *
News: Check out the artwork 1Dq created to commemorate this forum's 15th anniversary
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: main.h: MAX_MONEY = 21000000  (Read 1104 times)
pysiak (OP)
Newbie
*
Offline Offline

Activity: 20
Merit: 0


View Profile
November 11, 2013, 07:16:10 PM
 #1

I saw this question on zerohedge today. The guy was looking at https://github.com/bitcoin/bitcoin/blob/master/src/main.h and saying it's possible that this constant is changed in the future. I think he meant the whole network would be forced to accept a supply change.

This made me raise some questions:
- what happens if somebody runs a node or a pool with this variable different and we're reaching said supply?
- what if there was consensus in the whole community to increase this value, could that be done?
- if it were done and was adopted by all upgraded nodes, would that affect the mining curve and make new bitcoins's probability of getting mined different than it is now?
- wouldn't that invalidate the previously mined bitcoins worth?

Just thinking and wondering if anybody has had thougths around this.
Thanks
Foxpup
Legendary
*
Offline Offline

Activity: 4534
Merit: 3188


Vile Vixen and Miss Bitcointalk 2021-2023


View Profile
November 12, 2013, 01:06:08 AM
 #2

He clearly doesn't understand the code, then. MAX_MONEY is only used as a sanity check to prevent "impossible" transactions and integer overflows (any transaction sending more than MAX_MONEY is invalid, regardless of all other factors). The actual limit is enforced in this function in main.cpp:
Code:
int64 static GetBlockValue(int nHeight, int64 nFees)
{
    int64 nSubsidy = 50 * COIN;

    // Subsidy is cut in half every 210000 blocks, which will occur approximately every 4 years
    nSubsidy >>= (nHeight / 210000);

    return nSubsidy + nFees;
}

The result of this code is the first 210,000 blocks are worth BTC50 each, the next 210,000 blocks are worth BTC25 each, and so on (any block created with a greater value (eg, by modified or faulty mining software) will be rejected as invalid by all other nodes). This is a convergent infinite series with a limit of BTC21,000,000. However, due to rounding errors, the series is actually finite, and reaches a limit of BTC20,999,999.97690000 after 6,930,000 blocks.

Will pretend to do unspeakable things (while actually eating a taco) for bitcoins: 1K6d1EviQKX3SVKjPYmJGyWBb1avbmCFM4
I am not on the scammers' paradise known as Telegram! Do not believe anyone claiming to be me off-forum without a signed message from the above address! Accept no excuses and make no exceptions!
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!