The job of a Bitcoin miner is to validate transactions, and in exchange get a portion of the reward in BTC for doing it. However, greed is always present when it comes to money. there also exists a special type of contract that was put into place to discourage miners from cheating.
Unfortunately, according to a recent report, these ‘timelocked’ contracts seem to contain a critical bug, which compromises them and could potentially let miners steal from each other.
A New Bitcoin Bug Poses A Major Problem
Back in late April 2020, an engineer known by his pseudonym, 0xb10c, published a report that brought a lot of concern to the crypto industry.
With Bitcoin being as big as it is — and constantly growing even bigger — there was a need for an entire network of developers who would test Bitcoin’s own network and guard it against theoretical attacks. 0xb10c is a developer who belongs to this world-wide network, and their report focuses on the key area of Bitcoin research.
The report revealed that over a million of these timelocked transactions that were made between September of last year and March of 2020 were not properly enforced.
This means that, in theory, an attack could take place, and see miners steal each other’s BTC.
affected about 10% of timelocked transactions. In terms of BTC, this could impact around 2% of the transactions.
How Do Timelocked Transactions Work?
Timelocked transactions basically prevent Bitcoin’s recipient from accessing the coins right away. Instead, the miner needs to wait for a certain number of blocks to stack up over the block in which the transaction was approved.
With each block needing approximately 10 minutes to be solved, developers are able to program the timelock to expire when a certain number of blocks is processed. So, if the timelock is set to expire after six blocks, that means that the recipient will receive the coins after about an hour.
However, the timelocks that are bugged work more quickly, and they are set to expire after only one block and prevent ‘fee snipping.’ Basically, if another miner tried to replace a block that was mined by someone else with their own, which may contain validated transactions and those that are still pending, the timelock prevents them from including the pending ones. That way, the miner would only steal a portion of the reward, which might not be worth going through the whole process.
The bug represents a major long-term risk, especially when the miners start prioritizing the fees instead of block rewards, which are especially low now, after the third halving.