Skip to content

Commit 99b5fa1

Browse files
bLIP-0025: Allow forwarding HTLCs that underpay the onion encoded value
1 parent de30d99 commit 99b5fa1

File tree

3 files changed

+64
-0
lines changed

3 files changed

+64
-0
lines changed

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,4 @@ For more detail on the process, please read [bLIP-0001](./blip-0001.md) and
2525
| [10](./blip-0010.md) | Podcasting 2.0 | Satoshis Stream | Active |
2626
| [11](./blip-0011.md) | NameDesc | Hampus Sjöberg | Active |
2727
| [17](./blip-0017.md) | Hosted Channels | Anton Kumaigorodskiy | Active |
28+
| [25](./blip-0025.md) | Forward less than onion | Valentine Wallace | Active |

blip-0002.md

+7
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,13 @@ The following table contains extension tlv fields for the `payment_onion_payload
101101
| 7629169 | `podcasting_2_0` | [bLIP 10](./blip-0010.md) |
102102
| 5482373484 | `keysend_preimage` | [bLIP 3](./blip-0003.md) |
103103

104+
#### `update_add_htlc`
105+
106+
The following table contains extension tlv fields for the `update_add_htlc` message:
107+
108+
| Type | Name | Link |
109+
|-------|-----------------------------|--------------------------------|
110+
| 65537 | `extra_fee` | [bLIP 25](./blip-0025.md) |
104111

105112
#### `ping`
106113

blip-0025.md

+56
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
```
2+
bLIP: 25
3+
Title: Allow forwarding HTLCs with less value than the onion claims to pay
4+
Status: Draft
5+
Author: Valentine Wallace <[email protected]>
6+
Created: 2023-05-22
7+
License: CC0
8+
```
9+
10+
## Abstract
11+
12+
Penultimate hops in lightning payment paths may want to take an extra fee from the payee's final
13+
received value. To do so, they can simply forward less than the amount encoded in the onion by the
14+
sender, and specify the exact fee they took in a new `update_add_htlc` TLV for the receiver to
15+
verify.
16+
17+
## Copyright
18+
19+
This bLIP is licensed under the CC0 license.
20+
21+
## Specification
22+
23+
Penultimate hop on the path:
24+
* In their outbound `update_add_htlc` message, MUST include a TLV record keyed by type 65537 with a
25+
TLV value of `u64` containing the amount of extra fee they took from the receiver's final received
26+
value, in millisatoshis
27+
28+
Receiver:
29+
* MUST fail the HTLC if they did not expect an extra fee to be taken or if the extra fee taken is
30+
too high
31+
* MUST either accept or reject the HTLC as if it had received `htlc_value + extra_fee`
32+
33+
## Motivation
34+
35+
For context, it is expected that many lightning users will be connected to the lightning network via
36+
Lightning Service Providers (LSPs), who are responsible for managing channel liquidity on end users'
37+
behalf.
38+
39+
Often, users are onboarded to these services via a just-in-time inbound channel when they first
40+
receive a payment. However, this channel open costs money, and so liquidity providers may want to
41+
take an extra fee so that users can help bear the cost of this initial on-chain fee.
42+
43+
## Rationale
44+
45+
While it would be possible to avoid the extra TLV record if receivers could be trusted to calculate
46+
that the fee taken by the penultimate hop is as-expected, in practice this may be tricky to get
47+
right. If there were a bug in this logic, a sender could exploit it by forwarding less than the
48+
invoice's expected value, and receive proof-of-payment that they paid the full value.
49+
50+
## Implementation Notes
51+
See
52+
<https://github.com/BitcoinAndLightningLayerSpecs/lsp/tree/main/LSPS2#3--invoice-generation>
53+
for invoice requirements if this feature is being used in the JIT channel context.
54+
55+
## Reference Implementations
56+
LDK: <https://github.com/lightningdevkit/rust-lightning/pull/2319>

0 commit comments

Comments
 (0)