What is a replay attack

What is a replay attack

Many opponents of SegWit2x point out that the update code does not include replay protection. CryptoInsider has tried to understand what a replay attack is and how it might affect an upcoming hard fork.

To understand what a replay attack is, first we need to understand how transactions are carried out on the bitcoin blockchain. To do this, we will consider bitcoin as a global ledger and transactions as bank checks. Since the global ledger is digital, anyone can audit it simply by downloading a complete copy of the blockchain to their hard drive. This also means that all checks in the register are public. Anyone can examine the transaction and confirm the accuracy of its signature.

A hard fork is an update to the global registry. If everyone updates, only one global registry will be kept. If not everyone updates, then 2 global registries will appear: old and new.

Until the fork, both registries are completely identical with each other. They contain the same transaction history. However, after the fork, miners will begin to find new blocks, as a result of which different transactions will be carried out in these registries, which means that account balances will differ. For example, this happened during the Bitcoin Cash hard fork on August 1, 2017..

If you have a positive account balance in the ledger before the split, then after the split you will have the same positive account balance in both ledgers. But what if you want to spend money in one ledger and store it in another?

At this point, a problem arises. If you spend money in one registry, then someone might copy your signature check and submit it for inclusion in another registry. Thus, an attacker can spend your money in one of the registries because your signature is correct in each of them. Of course, along with this, the recipient’s address will be copied, as well as the amount of the check (otherwise the signature will be incorrect), but in any case, this presents a serious problem..

A person using a copy of a check in a different ledger is replaying the transaction when you intended to transfer money in only one of them. This is called a replay attack..

Bitcoin Cash solved this problem by slightly modifying the check itself. They have created a special mark on the check that helps to determine that this check belongs to the Bitcoin Cash registry and not to another registry..

This way, any node operating on the Bitcoin network will automatically reject Bitcoin Cash checks because they have a special mark on their checks. Any node operating on the Bitcoin Cash network rejects Bitcoin checks because they do not have such a mark.

This mark is called replay protection because it prevents a replay attack from being carried out..

Segwit2x developers refuse to add replay protection. They argue that Bitcoin Core itself should add this protection to the Bitcoin blockchain if they are so concerned about it..

Unfortunately, in most cases, implementing replay protection is only possible through a hard fork. As you know, hard forks are not backward compatible. Also, not everyone will update the software, which will create another registry. Many Bitcoin Core developers are of the opinion that a hard fork that is not planned for implementation in 12+ months will follow this scenario..

Thus, if Bitcoin Core decides to add replay protection in the remaining period of time (there are 3 months left before the implementation of Segwit2x), then most likely there will be 3 registries: Segwit2x, bitcoin with protection and old bitcoin. You can add more Bitcoin Cash here.

If you use Bitcoin and want to protect yourself from replay attacks after the Segwit2x hard fork, then you will have to split your accounts in the Bitcoin Core and Segwit2x ledgers..

The most obvious way is mixing coins. To do this, you will have to find a transaction that cannot be reproduced on another blockchain. You might think that there are simply no such transactions in registries with the same history, but there is at least one type of transaction that will allow you to do this..

These are the so-called coinbase transactions, that is, transactions that go to the address of the miners and carry with them rewards for mining blocks. Naturally, these transactions will be different on different blockchains and therefore cannot be replayed on another blockchain. If you create a transaction that mixes with an unreproducible transaction, then you end up with another unrepeatable transaction. All subsequent transactions that are mixed with a new non-replayable transaction will also become non-replayable. Thus, an increasing number of unreproducible transactions will gradually spread over the network..

It is clear that the main role in the distribution of such transactions will be assigned to exchanges and other services. If you are not going to make large transfers, then you should not worry too much about this problem. Most likely, after the fork, users will have to refrain from making transactions for some time, but, as the experience of Bitcoin Cash has shown, there is nothing wrong with that..

Similar articles