July 12

Guide to Bitcoin RBF by Hashlight

This is a brief guide on Bitcoin RBF and specifically on using Hashlight RBF.

What it is, how it works, and how to start using Hashlight RBF.

Hashlight makes degen/blockchain software. If you are interested in RBF and other on-chain software, you can join us here on Twitter and Discord.

What is RBF?

RBF (Replace-By-Fee) is a mechanism in the Bitcoin network that allows you to replace a transaction before it is confirmed. To do this, you need to send a new transaction with a higher fee (fee and fee rate).

The easiest way to track such transactions is by using mempool.space. Here is what RBF looks like on it:

https://mempool.space/tx/f887d0b566e4afac116ec1ef5e574f7028ac10c4999833e3a98e68adf226dc58

There are 5 conditions for RBF:

  1. The new transaction must use at least one UTXO input from the previous transaction.
  2. The fee of the new transaction must be higher than that of the replaced transaction (and all its ancestors). The fee is the amount of BTC we pay to miners.
  3. The fee rate must be higher than that of the replaced transaction. The fee rate is [fee] / [virtual size].
  4. The transaction must be sent through a node that supports Full RBF. hashlight.xyz uses its own node.
  5. The miner must support Full RBF. Some miners will ignore newer transactions and only confirm the original one.

How make profit from using RBF?

Since Bitcoin blocks can take a long time to confirm (from a minute to an hour), the market can change, and the sent transaction can become more or less profitable.

Here are a few examples:

  • An Ordinals NFT was bought at floor price for 0.1 BTC, and after 10 minutes the collection was swept, and the floor price rose to 0.15 BTC.
  • A batch of runes was bought for 0.015 BTC, but the block took longer, and the market dropped to 0.01 BTC for the same batch.
  • A user made a typo and accidentally sold an NFT for 0.001 BTC instead of 0.01 BTC.
  • A user made a typo and accidentally sent 0.01 BTC instead of 0.001 BTC.

In all these cases, you can either make a profit or avoid losses by rewriting the transaction.

The first case might look like this:

Illustration from MagicEden for example

Seeing the purchases, one might assume that the collection will continue to be bought up at a price of 0.0155. Therefore, we can intercept the purchase at 0.01319 and try to sell for ~0.0155.

If our theory is confirmed, we will earn ~0.002 or $100 (including the fee).

Market examples

When a popular collection is released, the market fluctuates greatly, opening up many opportunities.

Very often, for example, users in a hurry might make a typo and list a token at 10 or 100 times less than its market value:

Screenshot from the Hashlight monitor
Screenshot from the Hashlight monitor

What Hashlight offers

After activating an account on hashlight.xyz, RBF becomes available, supporting Ordinals and Runes.

The easiest way to start is to go to the transactions page and wait for a favorable offer:

https://hashlight.xyz/pending

Next to each deal on the right, there is a "Snipe" button. It automatically takes you to the Tools page with pre-filled fields.

After that, you just need to specify the fee and the recipient.

Most fields can be auto-filled with a double click.
Example of Ordinals RBF

The same is available for runes:

Example of Rune RBF

Using RBF without a monitor

You can also perform RBF of any ordinals or runes directly if you know the parameters.

For Ordinals (NFT and BRC), the inscription ID is sufficient.

For Rune, you need to specify the previous UTXO of the rune and the sale price. You can also use the txid of the last purchase and the rune index, but this method works less often.

Other Hashlight features

By default, when activated, only the monitor, Ordinals/Rune RBF, and transaction cancellation are available.

Active Discord users can be granted other functions:

  • Litefee — saving on fees during RBF.
  • Batch — RBF of multiple assets in one transaction.
  • Auto-inscribe — the ability to inscribe BRC in the same block as its purchase.
  • Watcher — tracking a transaction in the mempool in real-time and automatically sending a new one if our transaction was displaced.

You can see activated features on the Settings page.

In the future, functionality will be improved and expanded.

Conclusion

If you are interested in RBF and other on-chain software, you can join Hashlight here: Twitter and Discord.

My personal Telegram channel is @MorphelayDev