The Replace by Fee (RBF) is a useful feature of Bitcoin and other cryptocurrencies that allows us to increase the fee of a transaction after it has been made to speed up its confirmation.
El replacement fee o Replace by Fee (RBF), It is a method that allows us to be able replace a transaction, before being confirmed, by another version with a higher rate.
It is very useful and practical in cases where a transaction is sent and it takes a long time to confirm. This way a new transaction can be sent to be prioritized by the miners. In addition, the previous one is invalidated by sharing the same entries. In this way, we can increase the commission rate that we will pay the miners, so that they speed up the confirmation of this new transaction, leaving the other unusable.
Imagine that you made a transaction to pay for a product that you need urgently, and that your seller will not send it until the transaction is confirmed. But at the time you made the transfer, you chose a lower commission rate than is recommended at the time. So hours have passed and your transaction remains unconfirmed.
In this case you can use the option of Replace by Fee (RBF). You just need to create a new transaction with the same amount of cryptocurrency that you originally transferred. And send it to the same address, but with a higher rate. With which the miners will be motivated by said commission, and will process the transaction immediately. So you can receive your product without further delay. The initial transaction is invalidated and does not represent a new expense for you.
How does the process Replace by Fee (RBF)?
Actually when we apply the Replace by Fee (RBF)We are not increasing the transaction fee that we carry out and it is unconfirmed. Instead, we are creating a new transaction with the same inputs and outputs as the previous one, but with a much higher commission. So the miners will give priority to it, including it in a block faster.
In this case the important thing is the unspent tickets that are used. If both transactions share the same inputs, once they are spent in one transaction, the second will be omitted by the miners, because previously after taking the transaction from the mempool they check that the transaction is valid, and among the checks is to check that the tickets have not been spent on another transaction already confirmed or on the same block that is being confirmed.
When we make a transaction, our wallet It will show us a suggestion of the commission that should be paid according to the priority of our transaction and the speed with which we want it to be confirmed. But the network can be overloaded in a matter of minutes, so our fee may be insufficient seconds after sending the transaction.
This makes our transaction stagnate in the network mempool. Therefore, the implementation of Replace by Fee (RBF) It is a great alternative solution to this problem. Since the user changes the stagnant transaction for another that includes a higher fee, so that it is processed and confirmed on the network. This way you can combat network congestion. A situation that generated hundreds and thousands of stagnant transactions in the mempool. And although it is not a perfect solution, it does partially solve the problem of transactions.
However, this option only allows you to forward a transaction to the same destination address. With the difference that the commission to be paid must be higher. A similar process can be seen in the Child Pays for Parents (CPFP) that we explain in another great article from our Academy.
How much do you know, cryptonuta?
Is it possible to use Replace-by-Fee to perform double spending attacks?TRUE!
Replace-by-Fee has potential use for performing double-spending attacks. This is because a user can issue a payment to one address with a low fee, and then issue another payment to another address of his own with a higher fee. The problem is known and hence the recommendation to always wait because the transactions receive at least 3 confirmations from the network.
When is a transaction replaceable?
The marketing process includesseveral phases that are reflected below: Replace by Fee (RBF) It is based on the following standards:
- Original transactions must not be confirmed. And they must indicate their replaceability explicitly or through inheritance. That is, if any of the entries in the original transaction has an nSequence number less than (0xffffffff - 1). Or, that its predecessor transactions indicate replacement ability (inheritance).
- The new transaction created for replacement can only include an unconfirmed entry, if it was included in the original transaction.
- The commission for the new transaction is higher than the original transaction.
- When the number of transactions to replace does not exceed 100 of them.
- Transaction replacement is an optional process. Currently no wallet is configured by default to make replacements. Just as they are not for making inheritance replacements.