Skip to content

Commit

Permalink
Inbound routing fee discount
Browse files Browse the repository at this point in the history
  • Loading branch information
joostjager committed Aug 29, 2022
1 parent 0cd3f84 commit 50f6213
Show file tree
Hide file tree
Showing 2 changed files with 69 additions and 0 deletions.
8 changes: 8 additions & 0 deletions blip-0002.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,14 @@ The following table contains extension tlv fields for the `update_add_htlc` mess
|------------|-----------------------------|--------------------------------|
| 5482373484 | `keysend_preimage` | [bLIP 3](./blip-0003.md) |

#### `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.
61 changes: 61 additions & 0 deletions blip-0018.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
```
bLIP: 14
Title: Inbound routing fee discount
Status: Draft
Author: Joost Jager <[email protected]>
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.

0 comments on commit 50f6213

Please sign in to comment.