The lightning network is a layer 2 scaling solution for Bitcoin. As such, the infrastructure of the network is grounded in layer 1 where fees are critical to assuring transaction settlement. In this article we will explore the incentives around on-chain fees in Bitcoin’s Lightning Network.
Fees Encourage Use and Growth
The lightning network was created to solve some of Bitcoin’s scaling issues. I’ve written before about how on-chain fees work and methods to increase transaction speed after it’s been broadcasted. If the mempool is quite crowded, transactions on layer 1 will only confirm if they have included a high fee. For those transactions which require fast settlement, Lightning becomes an attractive alternative in a high-fee environment.
When on-chain fees are low, participants are incentivized to exploit the cheap fees to improve the payment channel infrastructure on Lightning. They do this by closing and opening channels on their lightning network nodes. Each channel open/close is an on-chain transaction that links the layer 2 to layer 1 BTC.
When on-chain fees rise, infrastructure improvement slows and usage of the existing infrastructure rises as people seek to avoid on-chain fees.
The Funding Transaction
The funding transaction is the on-chain transaction that creates a new payment channel. As with any on-chain transaction, the fee applied determines how quickly the transaction confirms when the network is congested. (The minimum fee of 1sat/vbyte will also confirm quickly if the mempools are not full).
If the channel funder chooses a low fee, it may take days or weeks for the transaction to confirm and the channel to open. If the fee is too high, then the channel will confirm quickly and the funder just overpaid.
It doesn’t matter if the funding transaction takes days or even weeks to confirm. Funds are not at risk. However, the payment channel is only created and announced on the Lightning Network once the funding transaction is confirmed.
The Commitment Transactions (and HTLCs)
After the channel is established between two peers, they can continue to transact with each other by exchanging broadcast-able commitment transactions that spend from the original funding transaction and effectively close the channel.
Likewise, the HTLCs used for routing can be redeemed on-chain as a fallback mechanism to ensure routing nodes get paid in the event a peer is uncooperative.
The funder of the channel is the one who pays the fee to close the channel. Since the channel can be closed by either party at any time, the two parties need to agree on an acceptable fee rate used to broadcast the channel close transaction.
If the channel close has a low fee, then both parties’ funds will be locked up until the closing transaction is confirmed. If the fee is too high, then an HTLC may become unspendable if the amounts settled are lower than the fee paid.
Therefore, nodes send a FEE_UPDATE message to one another to negotiate a reasonable fee at all times.