|
| 1 | +``` |
| 2 | +bLIP: 33 |
| 3 | +Title: Commit fees channel flag |
| 4 | +Status: Active |
| 5 | +Author: Bastien Teinturier <[email protected]> |
| 6 | +Created: 2024-07-02 |
| 7 | +License: CC0 |
| 8 | +``` |
| 9 | + |
| 10 | +## Abstract |
| 11 | + |
| 12 | +Standard lightning channels require the channel opener to pay the mining fees |
| 13 | +for the commitment transaction and mutual close transaction. This requirement |
| 14 | +forces the channel opener to contribute to the funding transaction and makes |
| 15 | +it impossible to open channels by only purchasing inbound liquidity from a |
| 16 | +remote node. |
| 17 | + |
| 18 | +We want to allow nodes to opt into paying the commitment transaction fees even |
| 19 | +though they're not the channel opener. |
| 20 | + |
| 21 | +## Copyright |
| 22 | + |
| 23 | +This bLIP is licensed under the CC0 license. |
| 24 | + |
| 25 | +## Specification |
| 26 | + |
| 27 | +### `channel_flags` extension |
| 28 | + |
| 29 | +We extend the `channel_flags` field from `open_channel2`. The BOLTs only use |
| 30 | +the least-significant bit of that field, and require readers to ignore the |
| 31 | +remaining bits. We define the next bit to `non_initiator_pays_commit_fees`: if |
| 32 | +set, the acceptor will pay the mining fees of the commitment transaction, for |
| 33 | +the lifetime of the channel. |
| 34 | + |
| 35 | +### Requirements |
| 36 | + |
| 37 | +The channel opener: |
| 38 | + |
| 39 | +* MAY set `non_initiator_pays_commit_fees` when sending `open_channel2`. |
| 40 | +* If the receiver sends `accept_channel2`: |
| 41 | + * MUST deduce the commitment fees from the remote node's channel balance. |
| 42 | + * MUST NOT send `update_fee` for the lifetime of the channel. |
| 43 | + |
| 44 | +The channel acceptor: |
| 45 | + |
| 46 | +* If `non_initiator_pays_commit_fees` is set in `open_channel2`: |
| 47 | + * MUST fail the channel if it doesn't want to pay the commitment fees. |
| 48 | + * Otherwise: |
| 49 | + * MUST respond with `accept_channel2`. |
| 50 | + * MUST contribute to the funding transaction. |
| 51 | + * MUST deduce the commitment fees from its channel balance. |
| 52 | + * SHOULD send `update_fee` when it wants to update the feerate of the |
| 53 | + commitment transaction. |
| 54 | + |
| 55 | +When exchanging `shutdown` without `option_simple_close`: |
| 56 | + |
| 57 | +* If `non_initiator_pays_commit_fees` is set: |
| 58 | + * The node responsible for paying the commitment fees is also responsible |
| 59 | + for paying the mutual close fees. |
| 60 | + * The node responsible for paying the commitment fees sends `closing_signed` |
| 61 | + first. |
| 62 | + |
| 63 | +### Rationale |
| 64 | + |
| 65 | +We don't define a feature bit to signal support for receiving this new channel |
| 66 | +flag, because this feature doesn't make sense alone: protocols that need this |
| 67 | +channel flag must explicitly mention that they include support for receiving |
| 68 | +this flag. |
| 69 | + |
| 70 | +Some messages that should be sent first by the channel opener are instead sent |
| 71 | +first by the node paying the commitment fees wherever it makes sense. This is |
| 72 | +the case for `update_fee` (since the node paying that fee should decide on the |
| 73 | +feerate) and `closing_signed`. |
| 74 | + |
| 75 | +### Test vectors |
| 76 | + |
| 77 | +The following test vectors describe how the `channel_flags` byte should be |
| 78 | +encoded depending on the values set: |
| 79 | + |
| 80 | +```json |
| 81 | +[ |
| 82 | + { |
| 83 | + "channel_flags": { |
| 84 | + "announceChannel": false, |
| 85 | + "non_initiator_pays_commit_fees": false |
| 86 | + }, |
| 87 | + "encoded": "0x00" |
| 88 | + }, |
| 89 | + { |
| 90 | + "channel_flags": { |
| 91 | + "announceChannel": true, |
| 92 | + "non_initiator_pays_commit_fees": false |
| 93 | + }, |
| 94 | + "encoded": "0x01" |
| 95 | + }, |
| 96 | + { |
| 97 | + "channel_flags": { |
| 98 | + "announceChannel": false, |
| 99 | + "non_initiator_pays_commit_fees": true |
| 100 | + }, |
| 101 | + "encoded": "0x02" |
| 102 | + }, |
| 103 | + { |
| 104 | + "channel_flags": { |
| 105 | + "announceChannel": true, |
| 106 | + "non_initiator_pays_commit_fees": true |
| 107 | + }, |
| 108 | + "encoded": "0x03" |
| 109 | + } |
| 110 | +] |
| 111 | +``` |
| 112 | + |
| 113 | +## Motivation |
| 114 | + |
| 115 | +This feature would typically be used by mobile wallets purchasing liquidity |
| 116 | +from their service provider. This allows mobile wallet users to onboard the |
| 117 | +lightning network without requiring them to own and use a utxo. Since they |
| 118 | +are purchasing liquidity, the service provider is incentivized to accept the |
| 119 | +burden of paying the commitment fees. |
| 120 | + |
| 121 | +This BLIP won't be necessary anymore once commitment transactions start using |
| 122 | +[TRUC](https://github.com/bitcoin/bips/blob/master/bip-0431.mediawiki) |
| 123 | +transactions and don't need to include mining fees. |
0 commit comments