From 5066574aba9727280cbe543bb903af86ff985bd5 Mon Sep 17 00:00:00 2001 From: Joost Jager Date: Mon, 29 Aug 2022 16:42:03 +0200 Subject: [PATCH] Inbound routing fee discount --- blip-0002.md | 8 +++++++ blip-0018.md | 61 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 69 insertions(+) create mode 100644 blip-0018.md diff --git a/blip-0002.md b/blip-0002.md index c8e8a48..32afe1b 100644 --- a/blip-0002.md +++ b/blip-0002.md @@ -97,6 +97,14 @@ The following table contains extension tlv fields for the `ping` message: |-------|-----------------------------|--------------------------------| | 65536 | `tlv_field_name` | Link to the corresponding bLIP | +#### `channel_update` + +The following table contains extension tlv fields for the `channel_update` message: + +| Type | Name | Link | +|------------|-----------------------------|--------------------------------| +| 32769 | `inbound_discount` | [bLIP 18](./blip-0018.md) | + ## Copyright This bLIP is licensed under the CC0 license. diff --git a/blip-0018.md b/blip-0018.md new file mode 100644 index 0000000..719199e --- /dev/null +++ b/blip-0018.md @@ -0,0 +1,61 @@ +``` +bLIP: 14 +Title: Inbound routing fee discount +Status: Draft +Author: Joost Jager +Created: 2022-08-29 +License: CC0 +``` + +## Abstract + +The Lightning BOLTs define a routing fee that is based on the policy of the +_outgoing_ channel. This makes it impossible for routing node operators to +differentiate in fees between incoming channels. + +Incoming traffic from some peers may be more desired than from others, for +example because it balances out traffic in the opposite direction. + +This bLIP defines an optional `channel_update` message field to express an +inbound fee discount. Senders who are able to read this field can benefit from +lower routing fees using those channels. + +## Copyright + +This bLIP is licensed under the CC0 license. + +## Specification + +Origin node: + +* MAY include a `channel_update` optional TLV record keyed by type `32769` with + the following value: + + * [i32:inbound_fee_base_msat] + * [i32:inbound_fee_proportional_millionths] + + These fields SHOULD be negative numbers that define the inbound discount for + that channel. + +Receiving node: + +* MAY pay each routing node the sum of its advertised inbound and outbound fee +for the incoming and outgoing channel that is used. This should amount to a +lower value than just the outbound fee. + + `outbound_fee(amt_to_fwd) + inbound_fee(amt_to_fwd + outbound_fee(amt_to_fwd))` + +Note that the inbound fee is calculated over the total balance shift of the +incoming channel. This includes the outbound fee. + +* For the final node, the inbound discount does not apply. + +## Universality + +This feature is defined as a BLIP because it's optional. + +## Backwards Compatibility + +By defining the inbound fee as a negative number, senders who don't understand +the new field will still be able to make payments. Routing nodes will accept +overpayment on fees. \ No newline at end of file