Skip to content

Commit 38de574

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 advertise to our peers the feerates we'd like to use when funding new or existing channels.
1 parent 43d18b5 commit 38de574

File tree

3 files changed

+132
-10
lines changed

3 files changed

+132
-10
lines changed

Diff for: README.md

+11-10
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,14 @@ 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 |
28-
| [25](./blip-0025.md) | Forward less than onion value | Valentine Wallace | Active |
29-
| [32](./blip-0032.md) | Onion Message DNS Resolution | Matt Corallo | 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+
| [25](./blip-0025.md) | Forward less than onion value | Valentine Wallace | Active |
29+
| [32](./blip-0032.md) | Onion Message DNS Resolution | Matt Corallo | Active |
30+
| [34](./blip-0034.md) | The `recommended_feerates` message | Bastien Teinturier | Active |

Diff for: blip-0002.md

+1
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+
| 39409 | `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) |

Diff for: blip-0034.md

+120
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,120 @@
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 advertise to our peers the feerates we'd
19+
like to use when funding new or existing channels.
20+
21+
## Copyright
22+
23+
This bLIP is licensed under the CC0 license.
24+
25+
## Motivation
26+
27+
This feature is particularly useful when mobile wallets initiate channel
28+
operations with their service provider: in most cases, they should use what
29+
the service provider recommends since they don't have access to a full node
30+
and the service provider would reject unacceptable feerates anyway.
31+
32+
## Specification
33+
34+
### The `recommended_feerates` message
35+
36+
1. type: 39409 (`recommended_feerates`)
37+
2. data:
38+
* [`chain_hash`:`chain_hash`]
39+
* [`u32`:`funding_feerate_per_kw`]
40+
* [`u32`:`commitment_feerate_per_kw`]
41+
42+
1. `tlv_stream`: `recommended_feerates_tlvs`
43+
2. types:
44+
1. type: 1 (`funding_feerate_range`)
45+
2. data:
46+
* [`u32`:`min_funding_feerate_per_kw`]
47+
* [`u32`:`max_funding_feerate_per_kw`]
48+
1. type: 3 (`commitment_feerate_range`)
49+
2. data:
50+
* [`u32`:`min_commitment_feerate_per_kw`]
51+
* [`u32`:`max_commitment_feerate_per_kw`]
52+
53+
### Requirements
54+
55+
The sender:
56+
57+
* SHOULD frequently send `recommended_feerates` with feerates it currently
58+
accepts for channel funding operations.
59+
* SHOULD set `funding_feerate_per_kw` to the feerate it uses for funding
60+
channels.
61+
* SHOULD set `funding_feerate_range` to the range of acceptables feerates
62+
for funding channels.
63+
* SHOULD set `commitment_feerate_per_kw` to the feerate it uses for channel
64+
commitment transactions.
65+
* SHOULD set `commitment_feerate_range` to the range of acceptables feerates
66+
for channel commitment transactions.
67+
* SHOULD accept feerates that are inside the ranges it advertised.
68+
69+
The receiver:
70+
71+
* SHOULD not send `open_channel`, `open_channel2`, `splice_init`, `tx_init_rbf`
72+
or other channel funding messages using feerates that are outside of the
73+
advertised ranges.
74+
75+
### Rationale
76+
77+
While it won't guarantee success every time, taking into account our peer's
78+
recommended feerates reduces the frequency of failures when funding channels.
79+
80+
### Test vectors
81+
82+
The following test vectors describe how the `recommended_feerates` message is
83+
encoded:
84+
85+
```json
86+
[
87+
{
88+
"recommended_feerates": {
89+
"chain": "testnet3",
90+
"funding_feerate_per_kw": "2500 sat/kw",
91+
"commitment_feerate_per_kw": "2500 sat/kw"
92+
},
93+
"encoded": "99f1 43497fd7f826957108f4a30fd9cec3aeba79972084e90ead01ea330900000000 000009c4 000009c4"
94+
},
95+
{
96+
"recommended_feerates": {
97+
"chain": "testnet3",
98+
"funding_feerate_per_kw": "5000 sat/kw",
99+
"commitment_feerate_per_kw": "253 sat/kw"
100+
},
101+
"encoded": "99f1 43497fd7f826957108f4a30fd9cec3aeba79972084e90ead01ea330900000000 00001388 000000fd"
102+
},
103+
{
104+
"recommended_feerates": {
105+
"chain": "testnet3",
106+
"funding_feerate_per_kw": "10000 sat/kw",
107+
"min_funding_feerate_per_kw": "5000 sat/kw",
108+
"max_funding_feerate_per_kw": "15000 sat/kw",
109+
"commitment_feerate_per_kw": "1000 sat/kw",
110+
"min_commitment_feerate_per_kw": "253 sat/kw",
111+
"max_commitment_feerate_per_kw": "2000 sat/kw"
112+
},
113+
"encoded": "99f1 43497fd7f826957108f4a30fd9cec3aeba79972084e90ead01ea330900000000 00002710 000003e8 01080000138800003a98 0308000000fd000007d0"
114+
}
115+
]
116+
```
117+
118+
## Reference Implementations
119+
120+
* eclair: <https://github.com/ACINQ/eclair/pull/2860>

0 commit comments

Comments
 (0)