when is the mining of the last bitcoin? I have read online that the last bitcoin will be mined in the year 2140. However, I am not completely sure how this is calculated. As I have seen some sources say there is 32 Reward Eras and given that each reward era is roughly 4 years wouldn't the end date be:
2009 + 4 * 32 = 2137.
Thanks in advance for any explanations.
There will be 32 halvings, but the block subsidy will be reduced 33 times with the last reduction not halving it, but reducing it from 1 sat per block to 0 sats per block (see table with calculation). So there will actually be 33 eras with a block subsidy, which would mean that per your calculation the last new bitcoins would be created in 2141.
However, the first halving occurred in 2012, so that's how you get to 2140 if you assume 4 years per era. Actually, the average time per block since the Genesis block has been about 9.5 minutes (4,431 days for 671,456 blocks). In 2020, the average block interval was about 9.9 minutes. Assuming that an interval of 9.9 minutes would be maintained, the last block with a block subsidy would be found in December 2138.