|
| 1 | +``` |
| 2 | +bLIP: xx |
| 3 | +Title: Zero-reserve channels |
| 4 | +Status: Active |
| 5 | +Author: Bastien Teinturier <[email protected]> |
| 6 | +Created: 2023-10-24 |
| 7 | +License: CC0 |
| 8 | +``` |
| 9 | + |
| 10 | +## Abstract |
| 11 | + |
| 12 | +Standard lightning channels require nodes to lock some of their channel funds |
| 13 | +into a channel reserve, which cannot be used for payments made on that channel. |
| 14 | +This guarantees that both nodes always have an output in the commitment |
| 15 | +transaction, which they will lose if they publish a revoked commitment. |
| 16 | + |
| 17 | +While this requirement is generally useful, it creates some inefficiencies |
| 18 | +since that liquidity can't be used to relay payments, and provides a bad user |
| 19 | +experience. In some settings, we may want to remove that channel reserve and |
| 20 | +allow nodes to use all of their channel funds. |
| 21 | + |
| 22 | +## Copyright |
| 23 | + |
| 24 | +This bLIP is licensed under the CC0 license. |
| 25 | + |
| 26 | +## Specification |
| 27 | + |
| 28 | +### TLV extensions |
| 29 | + |
| 30 | +Additional TLV fields for the `open_channel2` message: |
| 31 | + |
| 32 | +1. `tlv_stream`: `open_channel2_tlvs` |
| 33 | +2. types: |
| 34 | + 1. type: 32768 (`zero_reserve`) |
| 35 | + 2. data: |
| 36 | + * [`byte`:`use_zero_reserve`] |
| 37 | + |
| 38 | +Additional TLV fields for the `accept_channel2` message: |
| 39 | + |
| 40 | +1. `tlv_stream`: `accept_channel2_tlvs` |
| 41 | +2. types: |
| 42 | + 1. type: 32768 (`zero_reserve`) |
| 43 | + 2. data: |
| 44 | + * [`byte`:`use_zero_reserve`] |
| 45 | + |
| 46 | +### Requirements |
| 47 | + |
| 48 | +A node that wants to support zero-reserve channels: |
| 49 | + |
| 50 | +* MUST set the `zero_reserve` feature bit |
| 51 | + |
| 52 | +When sending `open_channel`: |
| 53 | + |
| 54 | +* If `zero_reserve` was negotiated: |
| 55 | + * MAY set `channel_reserve_satoshis` to `0` |
| 56 | + |
| 57 | +When receiving `open_channel`: |
| 58 | + |
| 59 | +* If `channel_reserve_satoshis` is set to `0`: |
| 60 | + * If it wants to use `zero_reserve`: |
| 61 | + * MUST set `channel_reserve_satoshis` to `0` in `accept_channel` |
| 62 | + * Otherwise: |
| 63 | + * MUST send an `error` and forget the channel |
| 64 | + |
| 65 | +When sending `open_channel2`: |
| 66 | + |
| 67 | +* If `zero_reserve` was negotiated: |
| 68 | + * MAY set the `zero_reserve` TLV field to `1` |
| 69 | + |
| 70 | +When receiving `open_channel2`: |
| 71 | + |
| 72 | +* If `zero_reserve` is set to `1`: |
| 73 | + * If it wants to use `zero_reserve`: |
| 74 | + * MUST set the `zero_reserve` TLV field to `1` in `accept_channel2` |
| 75 | + * Otherwise: |
| 76 | + * MUST send an `error` and forget the channel |
| 77 | + |
| 78 | +When sending or receiving `update_add_htlc`: |
| 79 | + |
| 80 | +* If `zero_reserve` has been negotiated: |
| 81 | + * MUST ignore any channel reserve standard requirement |
| 82 | + |
| 83 | +If the channel is not public, both nodes: |
| 84 | + |
| 85 | +* When the funding transaction confirms: |
| 86 | + * MUST send a `channel_update` using the final `short_channel_id` |
| 87 | + |
| 88 | +### Rationale |
| 89 | + |
| 90 | +The use of zero-reserve is symmetrical: it is either offered to both nodes or |
| 91 | +unused. |
| 92 | + |
| 93 | +### Fraud proofs |
| 94 | + |
| 95 | +If one of the nodes publishes a revoked commitment, the other node can create |
| 96 | +a fraud proof that shows which node tried to cheat. This proof may be shared |
| 97 | +publicly to harm the cheating node's reputation. |
| 98 | + |
| 99 | +That proof contains: |
| 100 | + |
| 101 | +1. the revoked commitment transaction |
| 102 | +2. a proof of knowledge of the revocation secret |
| 103 | +3. a proof of knowledge of the private key associated to the main output of the |
| 104 | + honest participant |
| 105 | +4. if the channel is public, its `channel_announcement` |
| 106 | +5. if the channel is not public, a `channel_update` from the malicious peer |
| 107 | + that uses the final `short_channel_id` |
| 108 | + |
| 109 | +The second and third items prove the identity of the honest user in that |
| 110 | +channel, while the last two items tie the identity of the malicious user to |
| 111 | +its public `node_id`. |
| 112 | + |
| 113 | +## Motivation |
| 114 | + |
| 115 | +In some cases, there may be some trust between nodes that the other node won't |
| 116 | +try to publish a revoked commitment: when that is the case, it is wasteful to |
| 117 | +enforce a channel reserve. |
| 118 | + |
| 119 | +In other cases, different incentives may be sufficient to remove the need for |
| 120 | +channel reserves. |
| 121 | + |
| 122 | +A mobile wallet using a service provider is a good candidate for removing the |
| 123 | +reserve requirements. The wallet user is regularly paying fees to the service |
| 124 | +provider: this incentivizes the service provider to offer zero-reserve, which |
| 125 | +provides a better user experience. The service provider isn't taking any risk |
| 126 | +here, as they should always be online and able to punish revoked transactions. |
| 127 | +It also makes sense for the wallet user to offer zero-reserve to the service |
| 128 | +provider: even on a mobile wallet, users should be able to react to revoked |
| 129 | +transactions. If the service provider publishes a revoked transaction, the |
| 130 | +wallet user can additionnally create a public proof that the service provider |
| 131 | +tried to cheat: this harms the service provider's reputation, which is another |
| 132 | +incentive for them to avoid cheating. |
0 commit comments