|
| 1 | +``` |
| 2 | +bLIP: 34 |
| 3 | +Title: The `recommended_feerates` message |
| 4 | +Status: Active |
| 5 | +Author: Bastien Teinturier <[email protected]> |
| 6 | +Created: 2024-07-02 |
| 7 | +License: CC0 |
| 8 | +``` |
| 9 | + |
| 10 | +## Abstract |
| 11 | + |
| 12 | +Many lightning messages include feerates for on-chain transactions. Nodes |
| 13 | +receiving those messages are supposed to reject them if they are considered |
| 14 | +too low or too high. However, there is no mechanism to let peers know which |
| 15 | +feerates we currently find acceptable, which leads to frequent failures, |
| 16 | +especially when the mempool feerates fluctuate quickly. |
| 17 | + |
| 18 | +We introduce an optional message to tell our peers the feerates we'd like to |
| 19 | +use. |
| 20 | + |
| 21 | +## Copyright |
| 22 | + |
| 23 | +This bLIP is licensed under the CC0 license. |
| 24 | + |
| 25 | +## Specification |
| 26 | + |
| 27 | +### The `recommended_feerates` message |
| 28 | + |
| 29 | +1. type: 35025 (`recommended_feerates`) |
| 30 | +2. data: |
| 31 | + * [`chain_hash`:`chain_hash`] |
| 32 | + * [`u32`:`funding_feerate_per_kw`] |
| 33 | + * [`u32`:`commitment_feerate_per_kw`] |
| 34 | + |
| 35 | +### Requirements |
| 36 | + |
| 37 | +The sender: |
| 38 | + |
| 39 | +* SHOULD frequently send `recommended_feerates` with feerates it currently |
| 40 | + accepts for lightning channel operations. |
| 41 | +* SHOULD set `funding_feerate_per_kw` to the feerate it uses for funding |
| 42 | + channels. |
| 43 | +* SHOULD set `commitment_feerate_per_kw` to the feerate it uses for |
| 44 | + commitment transactions. |
| 45 | +* SHOULD accept feerates that are close to the values it advertised. |
| 46 | + |
| 47 | +The receiver: |
| 48 | + |
| 49 | +* SHOULD not send lightning messages with feerates that are much higher or |
| 50 | + much lower than the received feerates (e.g. when sending `open_channel` |
| 51 | + or `update_fee`). |
| 52 | + |
| 53 | +### Rationale |
| 54 | + |
| 55 | +While it won't guarantee success every time, taking into account our peer's |
| 56 | +recommended feerates reduces the frequency of failures when funding channels. |
| 57 | + |
| 58 | +### Test vectors |
| 59 | + |
| 60 | +The following test vectors describe how the `recommended_feerates` message is |
| 61 | +encoded: |
| 62 | + |
| 63 | +```json |
| 64 | +[ |
| 65 | + { |
| 66 | + "recommended_feerates": { |
| 67 | + "chain": "testnet3", |
| 68 | + "funding_feerate_per_kw": "2500 sat/kw", |
| 69 | + "commitment_feerate_per_kw": "2500 sat/kw" |
| 70 | + }, |
| 71 | + "encoded": "88d1 43497fd7f826957108f4a30fd9cec3aeba79972084e90ead01ea330900000000 000009c4 000009c4" |
| 72 | + }, |
| 73 | + { |
| 74 | + "recommended_feerates": { |
| 75 | + "chain": "testnet3", |
| 76 | + "funding_feerate_per_kw": "5000 sat/kw", |
| 77 | + "commitment_feerate_per_kw": "253 sat/kw" |
| 78 | + }, |
| 79 | + "encoded": "88d1 43497fd7f826957108f4a30fd9cec3aeba79972084e90ead01ea330900000000 00001388 000000fd" |
| 80 | + } |
| 81 | +] |
| 82 | +``` |
| 83 | + |
| 84 | +## Motivation |
| 85 | + |
| 86 | +This feature is particularly useful when mobile wallets initiate channel |
| 87 | +operations with their service provider: in most cases, they should use what |
| 88 | +the service provider recommends since they don't have access to a full node |
| 89 | +and the service provider would reject unacceptable feerates anyway. |
| 90 | + |
| 91 | +## Reference Implementations |
| 92 | + |
| 93 | +* eclair: <https://github.com/ACINQ/eclair/pull/2860> |
0 commit comments