Bitcoin - what is RBF?

in #bitcoin2 years ago

I haven't been exchanging cryptocurrencies for years - does anyone have tips on how it's easiest/best to do it in 2022? A quick google got me to https://news.bitcoin.com/5-of-the-best-crypto-swapping-services/ - it's from 2019, it's from a domain known to have a political bias (that applies to both bitcoin.com and bitcoin.org), but anyway I ended up at changelly.com - and thought of writing a long rant on my terrible user experiences there. Things started to go sour due to RBF. Such a rant would not be complete without explaining RBF. The draft of this blog post diverged quickly, so I decided to change the topic ...

Unconfirmed vs confirmed, double spend

In the bitcoin world, a transaction may be "unconfirmed" (aka "0 confirmations" or "0-conf") or "confirmed" (and some sites will also request things like "6 confirmations" - but that's outside the scope of this article). An "unconfirmed transaction" is a signed message that is "floating around" in the network, a confirmed transaction is written to the blockchain, the immutable consensus-driven ledger. If paying "sufficent" in transaction fee, by average it would take around five minutes for a transaction to be confirmed - but it may take several hours, it's simply the nature of the Bitcoin blockchain. If paying too low transaction fee, it may even take days, weeks or forever. In the early days of Bitcoin, an unconfirmed transaction could generally be trusted - one could generally be confident that sooner or later it would end up at the blockchain, and one could give the customer a coffee as soon as the customer produced a "0-conf".

In the Bitcoin speech, a "double spend" is when someone creates a second transaction using the same bitcoins over again - perhaps buying the second coffee somewhere else - or more likely, "paying" the same money back to oneself (efficiently cancelling the first transaction). In the end, only one of the transactions will end up in the blockchain, and someone may have gotten a coffee for free. If one is selling coffee, this may be just a "calculated cost of business". Even with credit cards, the "chargeback rate" may sometimes be as high as 1%. It's a bit different if selling gold coins over the counter with some few percent markup to anonymous customers - then it may make sense to make sure the transaction is confirmed before delivering the goods.

One way to do a "double spend" is to create a new transaction with a higher transaction fee and hope it will be picked up by a miner. This is called RBF (replace by fee). A greedy miner could grab the higher fee and include the second transaction in the blockchain - there is nothing in the protocol preventing it. There is sort of a "gentlemens agreement" that the first transaction is to be considered valid and the second rejected. Later, this "gentlemens agreement" was slightly formalized, wallets like electrum comes with a checkbox that one can tick when sending the transaction. Checkbox ticked, a "double spend" should be honored and the original transaction discarded - checkbox not ticked, the "double spend" should be rejected.

As said, a transaction with too low transaction fees paid may be stuck for days, weeks or forever. Tagging transaction with RBF prior to sending it, and then bumping the fee if needed is the only reliable good way to resolve such a problem. It's possible to save quite a lot of transaction fees by using RBF in a smart way. The preconditions are that the recipient either can trust the sender, or that the receipient only cares about confirmed transactions. If you want to buy coffee and drink it while it's hot, it's a terrible, terrible idea to use RBF.

Politics and infighting

RBF isn't just a technical thing - it's also a very political thing.

Now there are quite some fundamentalists in the bitcoin space - some claims that Bitcoin was designed so that one should always be able to trust 0-conf as a mean of payment even for the gold coins, others says that a 0-conf should never be trusted, even for buying coffee. This is related to the fight for the maximum block size limit in Bitcoin. The first group of people wants to remove the capacity limit (hardcoded 1 MB block size limit) and think it's a great idea to use Bitcoin to purchase coffee - the other group of people think that Bitcoin should be used only as a "store of value" and not as a payment network, and that Visa is just great for buying coffee. The second group of people eventually won, hence we're still using credit cards for buying coffee. (The second group of people do have a solution "lightning" for the coffee payments, but it was not ready when the block size limit became a problem. Bitcoin as a payment option was starting to get traction around 2016/2017, but due to the infighting and inability to agree on good compromises on the block size limit, it quite much fizzled out, and sadly by today it's almost only criminals accepting bitcoins).

The "big blockers" considers it to be a defining property of Bitcoin that an unconfirmed transactions can be trusted, hence the very idea of the sender being able to cancel a transaction is pure evil, so they are very much against the concept of RBF. (Dependent on the wallet, it's possible to build new transactions on top of an unconfirmed transaction - hence a whole chain of unconfirmed transactions to fail if the fee of the first transaction is "bumped" through RBF).

The "small blocker" favors a "fee market" where the unconfirmed transaction fees should be considered as "bids" for storage space in the blockchain. RBF is paramount for a well-working "fee market" - a market where "too low" bids gets stuck forever together with a much bigger sum of money is just terrible, terrible. While one cannot cancel the "bid" itself through RBF, one can at least both increase the bid and (to some extent) cancel the transaction.

Let's get back to Changelly. I sent BTC from my Electrum wallet with the RBF checkbox checked, then later bumped the fee because it was "needed". Transaction got confirmed, Changelly got my bitcoins, but no Ethereum in return. Changelly support replied that I will have to wait for several days because I had "sent btc to a previously used address". So they registered the first transaction, registered that it got cancelled, cancelled the full deal and did not register the transaction with increased fee. It could be tempting to assume they are making life hard for RBF-users for political reasons. I assume no malice, I don't think they have explicitly decided to reject RBF, but there could be some hidden political bias here. To frame it positively, the Changelly team is definitively not in the "smallblock extremist camp", then they would surely have designed the transaction system to support transactions utilizing the RBF-flag for bumping the fee.

Sort:  

Dear @tobixen, we need your help!

The Hivebuzz proposal already got important support from the community. However, it lost its funding a few days ago and only needs a few more HP to get funded again.

May we ask you to support it so our team can continue its work this year?
You can do it on Peakd, ecency,

Hive.blog / https://wallet.hive.blog/proposals
or using HiveSigner.
https://peakd.com/me/proposals/199

Your support would be really helpful and you could make a difference.
Thank you!