Post
Topic
Board Bitcoin Discussion
Merits 2 from 2 users
Re: Myth vs Facts and My Assumptions about Bitcoin
by
o_e_l_e_o
on 19/01/2022, 20:30:31 UTC
⭐ Merited by Falconer (1) ,_BlackStar (1)
Although from the start I used a wallet that has the RBF feature but I really haven't tried it until now. I found the possibility of double spending based on what I've read about the functionality of the RBF feature so we are always advised to stay aware of 0conf transactions when trading between users as it is not secure, but I really don't know how it works.
RBF is described in BIP 125, which you can read here: https://github.com/bitcoin/bips/blob/master/bip-0125.mediawiki

Every time you spend bitcoin, each input in your transaction contains a 4 bit value known as nSequence. It was initially intended to be used to allow users to replace transaction in the mempool with a new transaction with a high nSequence value, but posed issues to both bandwidth and memory due to the fact no additional fees were required to replace transactions, and so it was disabled years ago. More recently, the nSequence value was repurposed for other uses. One of those uses is in relation to time locking transactions, and another one of those uses is for RBF. If you (or your wallet software) sets nSequence to either 0xffffffff or 0xfffffffe, then RBF is disabled. If you set it to any other value, RBF is enabled.

If RBF is enabled, then after you have made a transaction but before it has received its first confirmation, and it is still unconfirmed, then you can easily replace that transaction. If you spend any of the inputs from that original transaction in a new transaction, and the new transaction pays higher relative and absolute fees than the original transaction, then the original transaction will be evicted from the mempool and replaced with your new one. This allows you to make the same transaction again but with a higher fee, but also allows you to change the transaction entirely and redirect the coins to different addresses.