# Gavin Andresen # 2010-12-03 18:25:00 # https://bitcointalk.org/index.php?topic=2055.msg26512#msg26512 @s{quotedtext} @s{quotedtext} @p{brk} Bitcoin contains this magical little piece of code: @p{brk} Code: int64 GetBlockValue(int nHeight, int64 nFees) @p{brk} { @p{brk} int64 nSubsidy = 50 * COIN; @p{par} // Subsidy is cut in half every 4 years @p{brk} nSubsidy @s{gt}@s{gt}= (nHeight / 210000); @p{par} return nSubsidy + nFees; @p{brk} } @p{brk} @p{brk} If you try to create more than GetBlockValue coins (50, right now) when you get lucky and generate a block, all the other clients will reject it. @p{par} There are a bunch of other checks to prevent cheating (make sure you actually did the work to find a valid hash for the block, make sure all the transactions in the block are valid, etc), but that simple little piece of code is what restricts the supply. @p{brk}