Bumping fee for lightning channel open

From lightningwiki.net
Jump to navigation Jump to search

When the mempool is full, you often end up waiting a long time for your channel open. But instead of waiting days or even weeks, you can choose to "Bump" the channel fee.

Determining a fee

One could look at the blocks being mined on https://mempool.space/ , and look what the fee is for inclusion in the next block(s). Please keep in mind that new transactions come in every few seconds.

Maybe you see that the average next block fee is 120 sat/vB. You could decide you want to pay 110 sat/vB. A channel open is often 300 bytes+, please keep that in mind.

Cannot bump fee, use CPFP

For a channel open, you _actually_ do not bump the fee. Fee bumping means replacing the old transaction with a new one with a higher fee. Since channel open renegotiation is not built in to the protocol, you will have to use the CPFP "trick", where you spend the bitcoin (change) from your unconfirmed (channel open) transaction.

Fee matters

It _seems_ that miners are quite smart. If your old channel open transaction had a fee of 1 sat/vB, and took 400 bytes, this will have to be mined, too, of course, with your new transaction. Miners will probably not _just_ look at your new transaction (with the high fee), but calculate their highest profits. This means that if you now pay 110 sat/vB, the actual reward of mining BOTH transactions is a bit lower for the miner, since they have to use some block space for your old tx as well. They will probably keep that in mind.

Steps (lnd)

  1. Find the transaction that opens your channel. This is the transaction you have been waiting for for a bit now. Look for your peer in lncli pendingchannels, and note the channel_point. The opening transaction ID is the part before the :.
  2. Easiest is to look up the channel_point in a block explorer like https://blockstream.info/ . You will see this transaction has two outputs. You will recognize the channel balance (for the channel you want to have opened) in one output. The other output is the change.
  3. Figure out what number the change output is. The Blockstram.info explorer will note #0 and #1. This number is important.
  4. We want to spend this change, with a nice high fee. The miners will want to mine this new high fee transaction, but to do so, they must also mine the "parent" of this new transaction, your "old" channel open!
  5. To spend this change with 110 sat fee per byte, use below command. Replace TXID by the old channel open transaction ID from step 1. Replace NUMBER by the number of the change from step 3.
lncli wallet bumpfee --sat_per_byte 110 TXID:NUMBER


Check if it worked

  1. In your explorer, click on the change (address).
  2. You should see a new transaction, that is spending this change. Now you just have to hope that gets confirmed!

What if it was not enough

Of course it could be that your new transaction wasn't even paying enough for quick inclusion. Repeat the steps. You can now bump the "new" transaction, again, too.