pull down to refresh

How possible is that when the total amount of bitcoin is 21 Million.
Integer overflow that wasn't checked in the code. It's explained in the stackexchange link above.
The block in question contained three transactions: the first is a coinbase transaction, the second is the one that did the overflow. The third is unknown, and not relevant.
The overflow transaction does not spend from the first transaction, rather it spends a UTXO that was created in an earlier transaction, which is actually in the blockchain and can be looked up today. The UTXO it spends is 0.5 BTC.
The two outputs of the overflow transaction are each 92233720368.54277039 whose bytes are 7ffffffffff863af in hex. The most significant bit of this number is the sign bit - if it is 1 then the number is negative, 0 it is positive. In this case, these values are positive. This allows these values to pass the check that the output values are not negative.
The next relevant check is that the amount in the inputs can provide for the amount in the outputs. However the way this was done was not by checking the values directly, but rather the fee was calculated (input amounts - output amounts), and the fee is checked to be non-negative.
But because the output values are so large, when they are added together, they overflow the maximum signed integer and become negative. Subtracting this sum from the 0.5 BTC input becomes an addition as subtracting a negative number is addition. So the calculated fee is greater than 0 and this last check passes.
There are two inflationary effects of this bug. The first is the obvious one of the two extremely large outputs. The second is the transaction fee. The miner of that block can collect the miscalculated transaction fee of the overflow transaction, and so there is an additional 0.00997538 Bitcoin created.
reply
Good information.
reply
they hardforked it?
The problematic TXs was removed.
reply