|
| 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