Stackchain archive / ledger

CAmount GetBlockSubsidy()

DocumentedStackchain Magazine

Date: 2025-02-15 · basis: publication date recorded in the magazine inventory

Contributor

Will Schoellkopf

What happened

Will Schoellkopf, author of The Bitcoin Dog, walks through validation.cpp's GetBlockSubsidy() line by line from an excerpt of his book: there is no hard-coded 21 million, the 50-coin subsidy is right-shifted once per 210,000-block halving, and because 5,000,000,000 is 33 bits long there can only be 33 halving eras, ending around 2140. He explains the BIP-42 guard against the 'infinite inflation bug' at 64 halvings, why miners are subsidised for security rather than gifted coins, and the 51% attack and double-spend threat the subsidy is meant to price out. The piece is framed around the 4th halving and block 840,000 and ends by saying node runners, not miners or attackers, enforce the limit.

Archive summary written from the sources below — not a quotation.

From the sources

Who says there will only ever be 21 million Bitcoin? There is no hard-coded limit defined above.https://www.stackchainmagazine.net/camount-getblocksubsidy/
We run the nodes. We validate the blocks. Us stackchainers, WE are the majority. Just like #stackchain, we are DECENTRALIZED!https://www.stackchainmagazine.net/camount-getblocksubsidy/
There is no hard-coded 21 million number.https://www.stackchainmagazine.net/camount-getblocksubsidy/

Receipt

No receipt is held for this entry.

In plain English

Line-by-line walkthrough of bitcoind's GetBlockSubsidy() showing why 21 million is not hard-coded.

Machine-written summary, not an editorial statement.

Provenance

Stackchain Magazine article, catalogue item 47, category how-to-technical. Summarised by the archive from the published piece; quotes below are verbatim excerpts. Original: https://www.stackchainmagazine.net/camount-getblocksubsidy/

Uncertainty

Archive summary of a published article, not the article itself. Quotes are short verbatim excerpts; read the original for full context.
Part of the Stackchain community archive · the ledger. Coverage-limited: this records what the archive holds and says plainly what it does not. Sourced, testimony and uncertain material are kept visibly distinct and are never promoted by appearing here.