Bitcoin Forum
May 11, 2024, 08:27:21 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: main.h: MAX_MONEY = 21000000  (Read 1079 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
1715459241
Hero Member
*
Offline Offline

Posts: 1715459241

View Profile Personal Message (Offline)

Ignore
1715459241
Reply with quote  #2

1715459241
Report to moderator
The Bitcoin software, network, and concept is called "Bitcoin" with a capitalized "B". Bitcoin currency units are called "bitcoins" with a lowercase "b" -- this is often abbreviated BTC.
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1715459241
Hero Member
*
Offline Offline

Posts: 1715459241

View Profile Personal Message (Offline)

Ignore
1715459241
Reply with quote  #2

1715459241
Report to moderator
Foxpup
Legendary
*
Offline Offline

Activity: 4354
Merit: 3044


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!