Skip to content

Commit ed6f44e

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

File tree

2 files changed

+68
-0
lines changed

2 files changed

+68
-0
lines changed

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

+61
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
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
30+
* MUST either accept or reject the HTLC as if it had received `htlc_value + extra_fee`
31+
* MUST reject the HTLC if the extra fee taken is too high
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+
In the JIT channel context, MPP should be disallowed unless the receiver can communicate to the LSP
51+
when all MPP parts have been aggregated, because otherwise the LSP may be at risk of wastefully
52+
opening a new channel for each MPP part.
53+
54+
## Implementation notes
55+
If this feature is being used in the context of the penultimate hop opening a just-in-time channel
56+
to the receiver, MPP should be disabled in the invoice unless the recipient has a way to communicate
57+
to the penultimate hop when all MPP parts have been received. See
58+
<https://github.com/BitcoinAndLightningLayerSpecs/lsp/pull/22> "Invoice Generation" section.
59+
60+
## Reference Implementations
61+
LDK: <https://github.com/lightningdevkit/rust-lightning/pull/2319>

0 commit comments

Comments
 (0)