In 2010, there was an incident of value overflow on Bitcoin.
I am not a developer, but I want to know what the bug was in more detail. #1 is the only answer I found online, and #2-3 are my attempts to alternative answers.
1. Source: https://bitfalls.com/2018/01/14/curious-case-184-billion-bitcoin/
Total outputs were greater than 184,467,440,737.09551615, the maximum number that could be stored, by 50.51. And 50.51 was equal to the input value, so the tx was processed.
This was the tx, according to the source.
- from my address which has 50.51 BTC
- send 92233720368.54277039 to address A
- send 92233720368.54277039 to address B
- send 50.51 BTC to address C
But I am not sure. Looking at the block on jgarzik's original post, it looks like 50.51 was a separate tx from the two 92233720368.54277039 txs. And the input value for those 2 large txs seems to be 0.5. It doesn't really make sense. So, here are my alternative possible answers.
2. The combined outputs of two large txs, 184,467,440,737(decimals cut off for simplicity), is subtracted from the input of 0.5, which results in -184,467,440,736.5. But because the variable was an unsigned number, it was wrapped (around the max number of 184,467,440,737.09551615) to end up as 0.5 (or smaller). This is equal to the input value, so the tx is included.
3. Similar to #1, but I saw somewhere that negative sign could erroneously be interpreted as another number digit. So (rather than wrapped around the max number) -184,467,440,736.5 is seen as a larger positive number. I don't know what number it will become. 1,000,000,000,000 + 184,467,440,736.5? Or 2 x 184,467,440,736.5?
Maybe something else? Please let me know what you think really happened. Thank you in advance.