Difference between revisions of "Bumping fee for lightning channel open"
(bump fee page)
Revision as of 14:17, 28 July 2020
Sometimes the mempool is full and you are waiting a very long time for a channel open. You could
- Wait for channel to open
- "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.
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 pat 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.
- 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 :.
- 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.
- Figure out what number the change output is. The Blockstram.info explorer will note #0 and #1. This number is important.
- 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!
- 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
- In your explorer, click on the change (address).
- You should see a new transaction, that is spending this change. Now you just have to hope that gets confirmed!