The Bitcoin blockchain is the "oldest" in the digital landscape, and therefore we can also consider it the most tested and solid; but…
Well, something technically impossible has been recorded: a double expense!
Here we are:
It sounds surreal, but it happened.
Let's see how.
As we know, the validation of the BTC blockchain blocks are sequential and the fundamental element is that the hash of the previous one is reported in the next block.
Validation, subsequently, takes place through the Proof of Work (PoW) consent protocol.
Apparently it could be enough to ward off any attacks, but to avoid them absolutely, the difficulty of the protocol increases every 14 days; this is because some miners could join and increase the height of the block too much.
Not only that, the unit of time was also introduced as a parameter.
The timestamp found in the block is set by the Miner, but to prevent it from falsifying entered data, 2 protection mechanisms have been provided:
The MPT (Median Past Time) rule, that is that the timestamp must be greater than half of the last 11 blocks, in this case 6. And therefore the minimum confirmation must be 6 blocks, thus reducing the risk that someone could attack the network;
The Future Block Time rule, in this rule, however, the timestamp cannot be more than 2 hours ahead of a constant named MAX_FUTURE_BLOCK_TIME; furthermore, the maximum time provided by the node and the actual time of the machine cannot exceed 90 minutes. In this way, all timestamps that do not respect these rules are discarded.
So how did it happen?
Let's take a good look at the photo I entered: we can see that there was a time lag in the timestamps that blocked the bitcoin network for 2 minutes.
Thanks to this indecision of the network, in order to identify the longest one, someone was able to spend that amount for the longest chain.
We are sure that this is a double expense as no RBF (Replace by Fee) was detected.
The offending block is 666833 and the double spending figure is 0.00062063 BTC.
This fact could alarm someone, but it is completely unfounded as the system has recovered immediately and there is no sign that a similar event can re-occur.
Hehehe, I guess a lot of the readers were alarmed, right?
Don't worry, it's not necessary, now I'll explain what happened and how Team Nakamoto thought about this possibility too.
Follow me!
But what is it?
Simply a block that has two validations and both have been considered TRUE by the other nodes. So one might say that the Nakamoto team designed bullshit then, but that's not the case. This possibility was already known and, in this regard, the blockchain considers the chain with more blocks valid.
How can such a thing happen?
Very simple: the physical latencies due to the network, or, if it is more understandable, to the communication times between the nodes.
Let me explain with an example.
Suppose that a block is validated in Russia, and the same block is also validated in Mexico, the block thus validated will be delivered to the miners that are geographically closest; and on that block they will start undermining the next one.
Regardless of whether the solution to the problem is different, these blocks create a conflict because they are both valid but only one can be added.
Then?
At this point a rule is inserted: the longest blockchain becomes reliable (therefore true).
In practice, when the next block is confirmed, the previous block is confirmed valid, which can be “Russian” or “Mexican”.
Since, however, the Stale-Block contains transactions that must be recorded (otherwise you could, in fact, incur the double expense), the data are delivered to the MemPool which will insert them in a future block.
The factors that contribute to the creation of the Stale-Blocks are mainly the distances between the computers that make up the nodes and the communication delays.
Someone careful enough could assert that, in this way, an attack on the Bitcoin network can be launched.
Yes, it is possible as long as you are able to perform these maneuvers (he must be really good!)
I constantly check my transaction until I see it validated on a block that will become Stale-Block. Once I am sure that the block is defined as Stale-Block, I immediately execute another transaction of the same amount, increasing the validation reward so that the miners validate the second transaction before the original retrieved from the Stale-Block.
Here is explained in a technical way, albeit very simple as it was possible to have a double expense: it did not happen, in fact!
The possibilities of bypassing the Bitcoin network are there, yes, but only on paper: a procedure as I described is so difficult to apply that it is even impossible: in the time that we become aware that our transaction is part of a Stale-Block, the information has already been delivered to the Mempools and in the process of being validated.