CPFP and the Fee Market

Article length
5 min read
Published
Jun 23, 2023
Categories
Advanced features
CPFP and the Fee Market

Background

One of the most incredible aspects of the Bitcoin network is the fee market.

Bitcoin’s fee market is global. It doesn’t rest. It cannot be stopped. No one can put an artificial price floor or price ceiling on its good: scarce block space. The fee market is where the law of supply and demand runs supreme. Arguably, it is the freest market in the world. “Free” in the truest sense of the word.

Navigating this dynamic market — which has become increasingly volatile over the years —  can be challenging for new and experienced Bitcoin users alike. Long gone are the days where Bitcoin transactions reliably cost a cent or less. One day, a Bitcoin transaction can cost a few cents. The next day, ten dollars. How much should you pay? How much are you willing to pay?

If the transaction fees happen to be too low, your transactions might get stuck for hours, even days. This can be problematic when you are in a rush, or have certain deadline to meet. At the same time, you want to avoid overpaying as much as possible.

Fortunately, we have a couple of tools to deal with this volatility: Replace-by-fee (RBF) and Child-Pays-For-Parent (CPFP). Both allow you to “bump” the fees on your stuck transactions.

RBF and CPFP
So what are they?

RBF: a fee bumping technique that replaces an existing transaction with another transaction that has a higher fee rate. RBF only works if you are the sender. The new transaction needs to spend at least one or more of the same coins as the original transaction.

CPFP: a fee bumping technique that creates a child transaction whose fee is high enough to bump the combined fee rate (called the “effective package fee rate”) of the parent transaction and itself. CPFP can work for both sender and recipient. The child transaction needs to spend one or more of the unconfirmed coins resulted from the parent transaction.

To learn more about RBF, CPFP and fee bumping techniques in general, refer to this excellent article by Bitcoin Optech.


Support in Nunchuk

Nunchuk has had built-in support for RBF since day one: all outgoing transactions sent by the Nunchuk app automatically opt-in to RBF. Furthermore, unless specified otherwise, the app also automatically picks the most economical fee rate returned by the mempool.space algorithm.

This allows the user to try a lower fee by default, then gradually fee bump (several times if necessary) if the transaction takes longer than expected.

However, RBF doesn’t work in all scenarios. Particularly, it doesn’t allow one to fee bump as the recipient of a transaction.

Today, we are excited to roll out support for CPFP, a great complement to RBF.

Not only CPFP works for both sender and recipient, it also allows us to generally treat unconfirmed coins as if they are confirmed. This has a wonderful side effect: a much improved user experience.

We have carefully designed our CPFP feature so that it can work even without you noticing. Unconfirmed coins and confirmed coins are seamlessly combined in the wallet UI. You can perform coin selection and coin control on unconfirmed coins just the same as you do on confirmed coins. Lock them, label them with tags, put them in a collection, or spend them.
A second benefit of CPFP is that you can create multiple transactions in parallel, without waiting for a single one to confirm.

(For exchanging physical goods, it is still prudent to wait for a number of confirmations before carrying out the exchange.)


Batched transactions, which Nunchuk also supports, are much more efficient on fees if you were planning on sending bitcoins to multiple recipients ahead of time. But if your situation didn’t allow you to plan ahead, the ability to use CPFP to create multiple concurrent transactions gives you great flexibility. 

Summary
The volatility of Bitcoin’s fee market poses a difficult challenge for users: how much transaction fee should you pay so that your transaction doesn’t get stuck while avoiding overpaying?

The introduction of CPFP gives Nunchuk users another powerful method for fee bumping besides RBF, and a much improved wallet experience.

CPFP is now available in all Nunchuk apps. If you have any questions or feedback, please send us a message at [email protected].

Share

More from us

Join our newsletter

Subscribe to get our latest news, updates and special offers
Newsletter

Download our app

App Store DownloadPlay Store Download
Mac DownloadWindows DownloadLinux Download