I also wonder when the final halving technically occurs. How is it programmed? Is there a hard stop, or does it stop when the reward is less than two satoshi and no more halving is possible?
there are NO BTC in the blockchain. no BTC in the block reward
all units of measure are hard coded as sats..
the initial reward of 2009 was 5000000000sats which for visual display, comfort of conversation and common money recognition is where 5000000000 is representative of 50btc. yep the 50btc reward is just GUI display of the wallet and not hard coded
this 5000000000 is actually in binary
100101010000001011111001000000000
to get to 2500000000 (25btc) in binary is simple. you just remove the suffix byte
10010101000000101111100100000000
yep each halving is just 1 byte less of the reward which the translates binary to decimal to a number you can recognise
the very last halving is where the final 1byte becomes 0