Skip to content

Commit 4cd2bb9

Browse files
committed
blip-0034: the recommended_feerates message
Many lightning messages include feerates for on-chain transactions. Nodes receiving those messages are supposed to reject them if they are considered too low or too high. However, there is no mechanism to let peers know which feerates we currently find acceptable, which leads to frequent failures, especially when the mempool feerates fluctuate quickly. We introduce an optional message to tell our peers the feerates we'd like to use.
1 parent e9edaa2 commit 4cd2bb9

File tree

3 files changed

+103
-8
lines changed

3 files changed

+103
-8
lines changed

README.md

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,12 @@ published here.
1717
For more detail on the process, please read [bLIP-0001](./blip-0001.md) and
1818
[bLIP-0002](./blip-0002.md).
1919

20-
| Number | Title | Author | Status |
21-
|--------------------------|---------------------------|-----------------------------|--------|
22-
| [1](./blip-0001.md) | bLIP Process | Ryan Gentry | Active |
23-
| [2](./blip-0002.md) | Reserved Values | Bastien Teinturier | Active |
24-
| [3](./blip-0003.md) | Keysend | Valentine Wallace | Active |
25-
| [10](./blip-0010.md) | Podcasting 2.0 | Satoshis Stream | Active |
26-
| [11](./blip-0011.md) | NameDesc | Hampus Sjöberg | Active |
27-
| [17](./blip-0017.md) | Hosted Channels | Anton Kumaigorodskiy | Active |
20+
| Number | Title | Author | Status |
21+
|--------------------------|------------------------------------|-----------------------------|--------|
22+
| [1](./blip-0001.md) | bLIP Process | Ryan Gentry | Active |
23+
| [2](./blip-0002.md) | Reserved Values | Bastien Teinturier | Active |
24+
| [3](./blip-0003.md) | Keysend | Valentine Wallace | Active |
25+
| [10](./blip-0010.md) | Podcasting 2.0 | Satoshis Stream | Active |
26+
| [11](./blip-0011.md) | NameDesc | Hampus Sjöberg | Active |
27+
| [17](./blip-0017.md) | Hosted Channels | Anton Kumaigorodskiy | Active |
28+
| [34](./blip-0034.md) | The `recommended_feerates` message | Bastien Teinturier | Active |

blip-0002.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ bLIPs may create new messages and reserve their type in the following table:
6161

6262
| Type | Name | Link |
6363
| ------- | ------------------------------- | -------------------------- |
64+
| 35025 | `recommended_feerates` | [bLIP 34](./blip-0034.md) |
6465
| 65535 | `invoke_hosted_channel` | [bLIP 17](./blip-0017.md) |
6566
| 65533 | `init_hosted_channel` | [bLIP 17](./blip-0017.md) |
6667
| 65531 | `last_cross_signed_state` | [bLIP 17](./blip-0017.md) |

blip-0034.md

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
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

Comments
 (0)