Bitcoin halving
The few lines that decide how much new bitcoin the world mints.
GetBlockSubsidy starts at 50 BTC and cuts that reward in half every 210,000 blocks.
Satoshi Nakamoto and Bitcoin Core. GetBlockSubsidy.
License on this page
License notice
The MIT License (MIT). Copyright (c) 2009-2026 The Bitcoin Core developers. Copyright (c) 2009-2026 Bitcoin Developers. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the Software), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
GetBlockSubsidy decides how much new bitcoin the world mints. It starts at 50 coins and cuts that reward in half every 210,000 blocks. Satoshi Nakamoto wrote the first client, and Bitcoin Core tends the function now.
Height divided by 210,000 is the number of halvings already behind us. The code shifts right by that count and drops the fraction. Add the halves together and the series lands on the 21 million coin cap. The bars are a whole monetary policy in a few lines.