Skip to content
LearnBitcoin

ResearchBitcoin Dev Archive lightning-dev list

Fee Ratecards (your gateway to negativity)

7 messages, Sep 13 to 25, 2022. Started by lisa neigut.

lisa neigut (2), David A. Harding (2), ZmnSCPxj, Anthony Towns, René Pickhardt

Permalink First message in the Wayback Machine

lisa neigut permalink original

Hi all,

I've been talking about them for a bit[^1], now[^2], but here's a more formal proposal for fee ratecards.

Spec PR + implementation to come.

## What is a fee ratecard?

A ratecard is a set of four values, positive or negative, that price different bands of available liquidity for a channel.

A ratecard replaces the current `fee_proportional_millionths` and `fee_base_msat` currently used to calculate the owed fees for forwarding a payment on the lightning network.

Instead, with ratecards, a channel operator may specify four different rates for a channel's liquidity, that will automatically be updated depending on the current channel capacity. The four capacity bands are fixed at 0-25%, 26-50%, 51-75%, and 76-100%.

Currently, all payments are priced equally. Fee ratecards update this such that payments can be priced differently, depending on the current available capacity in a channel. This allows node operators to dynamically price their liquidity, without needing to continually issue gossip updates as the balance changes (which may leak payment flow timing).

## Spec Changes + Implementation Notes

To the `channel_update` gossip message, we add a TLV with one defined type, `ratecard`. The ratecard contains 4 16-bit signed integers, one for each quarter of channel capacity. (0-25, 26-50, 51-75, 76-100%).

```
1. `tlv_stream`: `channel_update_tlvs`
2. types:
    1. type: 1 (`ratecard`)
    2. data:
        * [`s16`:`fee_basis_0_25`]
        * [`s16`:`fee_basis_26_50`]
        * [`s16`:`fee_basis_51_75`]
        * [`s16`:`fee_basis_76_100`]
```

If a node is advertising a `ratecard` in their `channel_update` for that channel, a routing node SHOULD pick the rate to pay based on their current guess of the channel's capacity as well as priority for the payment.

If a payment is high priority, it is recommended to pay at the highest feeband, to ensure delivery (if possible).

On payment failure, the response is the same (you return a copy of the `channel_update` in the onion). You MAY give an additional hint as to what the current acceptable feerate is for a payment.

If the feerate card entry is set, the rates there take precedence over the `fee_base_msat` and the `fee_proportional_millionths`.

The `feerate` card effectively removes the ability to set a `fee_base_msat`.

To minimize payment routing failure, it is recommended to set the `fee_proportional_millionths` to the same rate as the highest `ratecard` rate. (Most likely the `ratecard`.`fee_basis_0_25`).

Note that `ratecards` unit is in basis points, not millionths. As basis points are 1/10,000, they're 100x less than the same value expressed as millionths.

- A `basis_point` value of 5 is a fee of 5msat on a 10k msat payment. - A `fee_proportional_millionths` of 500 is a fee of 5msat on a 10k msat payment.

The current expected price for sats to be pushed to the other side of the channel is to be priced by the lowest ratecard capacity band that that payment will push the balance into.

For example, if a payment moves 50k through a 100k channel which is currently at a total available capacity of 75k sats (which means it'll move the capacity from 75k to 25k), that payment will be expected to pay a rate equal to the 0-25% band, as it'll push the available capacity into the 0-25% range.

Using this rule, HTLCs consuming significant portions of a channel's total capacity are more likely to pay higher fees.

### Motivation and Rationale At the last in-person spec meeting, it was noted that channel capacity is often of variable value depending on the amount of capacity currently available in that channel.

It was also noted that we'd like to allow node operators to experiment with negative fees.

You can't easily allow for negative feerates with our current gossip messages, as it would give gossip an economic value which may have an adverse impact on the ability of nodes to stay up to date with the current lightning channel topology; it also stands to greatly increase the volume of gossip updates issued by any one node, which should scale with payment volume, as nodes update their gossip to change their current fees on any one channel.

Note that some nodes already automatically update their channel fees based on the available capacity in a channel; fee ratecards should be a more succinct way for node operators to express more fine grained prices of their existing capacity, with a much reduced bandwidth burden.

### Feerate Cards, Frequently Asked Questions

#### Why four evenly spaced buckets? Why not X function?

1. Expressibility
	Fees are calculated by the node creating the route for a payment, using
	parameters set by the channel node operator. These paramters must be
	communicated via gossip to every node, and then used as inputs to the
	routing function.
	Parameters need to be uniform and well understood such that
	routing algorithm designers can make efficient use of them.
	Four buckets is wide enough such that payment should
	be able to find/pick a current channel capacity with good
	probability, yet hopefully expressive enough for routing
	operators to be able to price their available liquidity
	with sufficient granularity.
	Four evenly spaced buckets also make it much easier to
	reason about information leakage (binary search).
2. Predictability for payment success.
	Feerate cards don't introduce any new risk to payment failure,
	as the current fee rates of a channel may currently differ
	from a node's gossip information.
	Rather, feerate cards offer a way for your routing algorithm
	to dynamically decide on what level of capacity it estimates
	the channel to be at, and its tolerance for failures.

#### Won't this leak my channel balance?

At most, feerate buckets reduce the total number of payment attempts required to find an exact channel balance by 2.

It does, however, provide a much lower 'cost of capital' mechanism for discovering which band of payment is likely to succeed.

Currently, to discover if a 100k channel has capacity for a 75k sat payment, you'd need 75k sats of available liquidity in the node leading up to that channel (or 25k in the opposite direction) from your probe node, in order to discover if that bucket is available.

This ties up available liquidity along the entire probe route.

With feerate cards, you could do a 1k sat payment at each feerate card fee band, and discover the approximate bucket without tying up as much of your own own outband capital.

This makes probing more feasible for any node that wants to make a payment, while reducing the capital tied up to discern the same amount of information.

#### More data in the channel_update message! Just what we need, more gossip.

It's anticipated that feerate cards will greatly reduce the number of `channel_update`s issued by a node, by allowing node operators to dynamically price their liquidity by available capacity via a single, static `channel_update`.

This should reduce or remove the need to rebroadcast a `channel_update` when a channel's capacity changes.

#### How do negative fees work?

Astute readers may notice that the proposed feerate card bands can be expressed as negative numbers. This allows node operators to price the liquidity available in their channel at a discount.

Here's a good way to think about the impact a negative fee will have on your channel balances.

A feerate of 5 basis points means that, in order to push 10k sats from one of your channel balances to the peer, another of yours must push you 10,005 sats. This means you always need more inbound than outbound in order to route a payment (unless you're using zero fees, in which case you'd need an equal amount).

Negative fees reverse this. At -5 basis points, you'd only need to receive 9,995 on an inbound channel to cause you to push out 10k sats. This allows you to reallocate your inbound capacity at a slight discount to the party who's responsible for moving the capital.

#### What happened to payment base fees?

They're going away (they do not work with negative rates). Hopefully ratecards will give you enough expressivity to figure out good rates for your channel capacity without them.

### Credits

This proposal is a marriage of Clara Shikleman's push to start thinking about negative fees, and ZmnSCPxj's comments on the variability of value of a channel's liquidity based on current capacity.

~niftynei

[^1]: [Slides on liquidity + lightning](https://docs.google.com/presentation/d/1gK5_JvDl6aR8EqEKIxfdIHMR2vNIgHUS5tydP2kB_gA/edit?usp=sharing) [^2]: [Presentation of slides at btcpp in Austin](https://www.youtube.com/watch?v=voEbAeS_B5w)

David A. Harding in reply to lisa neigut permalink original

On 2022-09-13 11:15, lisa neigut wrote:

Quoted text (1 line)
> Hi all,

Hi Lisa,

Thank you for describing this idea in detail on the mailing list.

Quoted text (2 lines)
> A ratecard is a set of four values, positive or negative, that price
> different bands of available liquidity for a channel.

Am I understanding correctly that this implies spenders wanting to send an LN payment will either need to estimate the current division of funds for every hop along their projected path or will need to pay the highest ratecard for each hop? How are spenders supposed to make those estimates about the division of funds in distant channels?

If there's no easy and network-friendly way for spenders to gather that information, I would worry that will lead to the creation of services which do collect the info and which become central to LN's operation.

Quoted text (7 lines)
> For example, if a payment moves 50k through a 100k channel which is
> currently at a total available capacity of 75k sats (which means it'll
> move the
> capacity from 75k to 25k), that payment will be expected to pay a rate
> equal to
> the 0-25% band, as it'll push the available capacity into the 0-25%
> range.

Shouldn't this be pro rata? If it's not expected to be proportional at the protocol level, then spender Alice can still get almost proportional rates by sequentially sending Bob's forwarding node fifty 1k payments and have 24 of them pay the 51-75 rate, 25 pay the 26-50 rate, and only 1 pay the 0-25 rate. Since base fees are disallowed, this costs Alice nothing extra but reduces network capacity by consuming HTLC slots for her, Bob, and every other forwarding channel.

However, for Alice to pay proportional fees either way, she'd need a fairly precise estimate of the current division of funds in one of Bob's channels, which brings me back to my earlier question about how Alice is supposed to obtain that information in a way that's easy and friendly to the network (and therefore resistant to centralization).

Thanks,

-Dave

ZmnSCPxj in reply to David A. Harding permalink original

Good morning Dave,

Quoted text (22 lines)
> On 2022-09-13 11:15, lisa neigut wrote:
>
> > Hi all,
>
>
> Hi Lisa,
>
> Thank you for describing this idea in detail on the mailing list.
>
> > A ratecard is a set of four values, positive or negative, that price
> > different bands of available liquidity for a channel.
>
>
> Am I understanding correctly that this implies spenders wanting to send
> an LN payment will either need to estimate the current division of funds
> for every hop along their projected path or will need to pay the highest
> ratecard for each hop? How are spenders supposed to make those
> estimates about the division of funds in distant channels?
>
> If there's no easy and network-friendly way for spenders to gather that
> information, I would worry that will lead to the creation of services
> which do collect the info and which become central to LN's operation.

As I understand it, it is exactly the same way that is done currently: the sender optimistically tries a route with a particular feerate, and if that fails, tries another route.

Basically, you can model a rate card as four separate channels between the same two nodes, with different costs each. If the path at the lowest cost fails, you just try at another route that may have more hops but lower effective cost, or else try the same channel at a higher cost.

If your concern is valid, one wonders why it would not already exist now in the current network where try-and-try-again is the standard overall algorithm for payments.

Regards, ZmnSCPxj

David A. Harding in reply to ZmnSCPxj permalink original

On 2022-09-22 16:08, ZmnSCPxj wrote:

Quoted text (5 lines)
> Basically, you can model a rate card as four separate channels between
> the same two nodes, with different costs each.
> If the path at the lowest cost fails, you just try at another route
> that may have more hops but lower effective cost, or else try the same
> channel at a higher cost.

That's a very easy to understand explanation of how to use the system, thanks!

Quoted text (3 lines)
> If your concern is valid, one wonders why it would not already exist
> now in the current network where try-and-try-again is the standard
> overall algorithm for payments.

My concern is about pathfinding algorithms which depend on unscalable data collection (e.g. frequent whole network probing). If such an algorithm performs much better than those algorithms which depend on scalable data collection (e.g. receiving gossip), then the network may grow to depend on the centralized entities performing the data collection to the detriment of its robustness and its participants' independence.

Try-and-try-another-path is somewhat problematic in this regard since, even with no additional action like probing, entities which send many payments will likely perform significantly better than entities which send few payments owing to the high-frequency spenders gaining more knowledge about which channels and amounts recently worked or did not. It seems to me that a more idealized system would only rarely have forwarding failures so that high frequency spenders wouldn't receive much more information than low frequency spenders. To that regard, fee ratecards feels like a small step in the wrong direction because modeling one channel as four separate channels further normalizes failure and so further moves the system towards centralized dependency. That said, as you mentioned in a previous post[1], I agree ratecards is better than frequently issuing new channel updates with modified fees.

Thanks,

-Dave

[1] https://www.learnbitcoin.com/archive/lists/lightning-dev/t/2022/solving-the-price-of-anarchy-problem-or-cheap-and-reliable-payments-via#m-bb890f01

lisa neigut in reply to David A. Harding permalink original

Some interesting points here. Will try to respond to some of them.

Quoted text (1 line)
> pathfinding algorithms which depend on unscalable data collection

Failed payment attempts are indistinguishable from data collection probing. I don't think it's realistic to think that payments are going to stop failing in an environment where we continue to prioritize privacy of channel balances.

I think I pretty nicely illustrated the benefits of using payment bands in my original post wrt to a balance between "probe-ability" and some obfuscation of balance, along with a net reduction in the bandwidth consumption required to get this basically required information for payment success.

Rene Pickhardt has a less private, less costly, more granular, smaller scope proposal for sharing channel balances w/ directly connected peers; I think this is worth investigating independently of this proposal.

Quoted text (1 line)
> depend on the centralized entities performing the data collection

I like to think that the introduction of negative fees make channel balance data a competitive advantage and will actually cause node operators to more closely guard their balances / the balance data they've collected about peers, which should hopefully reduce the current trend of sharing this information with centralized parties.

Note that with the present protocol design, the network incentives are such that centralized efforts to collect exact balance data already exist. So moving to this design has the potential to reduce the incentive to participate in the data collection, at the very least it does not make it worse than current.

Quoted text (2 lines)
>  this costs Alice nothing extra but reduces network capacity by consuming
>  HTLC slots for her, Bob, and every other forwarding channel.

the network already limits the size of htlcs that are allowable with the htlc_maximum_msat, which I understand is typically set at a rate below 1/4 of channel capacity (citation needed). Which is to say that the large consumption of a channel in a single HTLC is currently relatively prohibited. It's likely this proposed change would actually encourage operators to set their htlc_maximum_msat higher, now that there's a direct financial cost tied to larger channel bandwidth consumption.

Great questions! Hope that gives a better picture of the current landscape.

Also h/t to ZmnSCPxj for the excellent "four parallel channels" analogy, this is a really elegant way to think about the proposal.

On Thu, Sep 22, 2022 at 11:39 PM David A. Harding <dave at dtrt.org> wrote:

Quoted text (44 lines)
> On 2022-09-22 16:08, ZmnSCPxj wrote:
> > Basically, you can model a rate card as four separate channels between
> > the same two nodes, with different costs each.
> > If the path at the lowest cost fails, you just try at another route
> > that may have more hops but lower effective cost, or else try the same
> > channel at a higher cost.
>
> That's a very easy to understand explanation of how to use the system,
> thanks!
>
> > If your concern is valid, one wonders why it would not already exist
> > now in the current network where try-and-try-again is the standard
> > overall algorithm for payments.
>
> My concern is about pathfinding algorithms which depend on unscalable
> data collection (e.g. frequent whole network probing).  If such an
> algorithm performs much better than those algorithms which depend on
> scalable data collection (e.g. receiving gossip), then the network may
> grow to depend on the centralized entities performing the data
> collection to the detriment of its robustness and its participants'
> independence.
>
> Try-and-try-another-path is somewhat problematic in this regard since,
> even with no additional action like probing, entities which send many
> payments will likely perform significantly better than entities which
> send few payments owing to the high-frequency spenders gaining more
> knowledge about which channels and amounts recently worked or did not.
> It seems to me that a more idealized system would only rarely have
> forwarding failures so that high frequency spenders wouldn't receive
> much more information than low frequency spenders.  To that regard, fee
> ratecards feels like a small step in the wrong direction because
> modeling one channel as four separate channels further normalizes
> failure and so further moves the system towards centralized dependency.
> That said, as you mentioned in a previous post[1], I agree ratecards is
> better than frequently issuing new channel updates with modified fees.
>
> Thanks,
>
> -Dave
>
> [1]
>
> https://www.learnbitcoin.com/archive/lists/lightning-dev/t/2022/solving-the-price-of-anarchy-problem-or-cheap-and-reliable-payments-via#m-bb890f01
>
Anthony Towns in reply to lisa neigut permalink original

On Fri, Sep 23, 2022 at 03:13:53PM -0500, lisa neigut wrote:

Quoted text (3 lines)
> Some interesting points here. Will try to respond to some of them.
> > pathfinding algorithms which depend on unscalable data collection
> Failed payment attempts are indistinguishable from data collection probing.

Even so, data collection probing is *preferable* -- it can happen out of band, and doesn't need to cause latency when you're trying to finish paying for your coffee so you can sit down and get back to doomscrolling.

In general: if you need to know channel capacities to efficiently make payments, doesn't that fundamentally mean that that information should be gossipped?

For instance, in a world where everyone's doing rate cards, maybe every channel is advertising fees at -0.05, +0.01, +0.1, +1.0 bps because that's just what turns out to be "best". But then when you're trying to find a route, it becomes critically important to know which channels are at which capacity quartile. If you're not gossipping that information, then someone making a payment needs to either probe every plausible path, or subscribe to an information provider that is regularly probing every channel.

I still think what I wrote in June applies; from [0], what you want to maintain is a balanced flow over time, not any particular channel balance -- so collecting less fees at 25% balance than at 75% balance is generally a false optimisation; and from [1], having fee rate cards that just depend on time of day/week is probably a much better method of optimising for what actually matters -- "these are the times my channel is in high demand in this direction, so fees are high; these are the times demand is low, so fees are low".

[0] https://www.learnbitcoin.com/archive/lists/lightning-dev/t/2022/solving-the-price-of-anarchy-problem-or-cheap-and-reliable-payments-via#m-ca83fbfd
[1] https://www.learnbitcoin.com/archive/lists/lightning-dev/t/2022/solving-the-price-of-anarchy-problem-or-cheap-and-reliable-payments-via#m-ed4a4cda
Quoted text (5 lines)
> I like to think that the introduction of negative fees make channel
> balance data a competitive advantage and will actually cause node
> operators to more closely guard their balances / the balance data
> they've collected about peers, which should hopefully reduce the current
> trend of sharing this information with centralized parties.

Having fees depend on the channel balance makes the data a competitive advantage to the people trying to use the channel; for the channel owner, the optimal situation is everyone knows the balance, so that more payments get routed over the channel (because people don't overestimate the fee rate). That encourages channel owners to broadcast the information, not keep it private. If they can't broadcast it, that just creates a market for centralised information brokers...

Cheers, aj

René Pickhardt in reply to lisa neigut permalink original

Dear Lisa and lightning developers,

thank you for your contribution and ideas to the problem of increasing reliability to the payment deliver process by having balanced channels and providing liquidity where necessary. This is at least how I understand your intentions of the proposal. I will just add a few notes and remarks.

1. I think negative fees are certainly an interesting idea that is worthwhile to investigate. Mathematically speaking it is kind of strange to cut the routing_costs at 0 and to restrict market participants from selecting / offering negative fees. In particular min cost flow solvers should not have any problems with negative fees. I also like the fact that we would have another reason to deprecate the base fee. However I am uncertain if negative fees may introduce other problems and unintended side effects in particular with strategic behavior of routing nodes. The biggest issue I see is if negative fees would produce a negative cost cycle. Obviously everyone would try to cancel such a cycle and earn some arbitrage by moving liquidity. While the first node may be successful I assume nodes will not directly update fees / propagate gossip which would basically create a lot of traffic requests to nodes in the negative cost cycle even though there is no liquidity in that fee band left.

2. I like the fact that fee rate cards would produce a piece wise linear cost function which should also be convex (assuming the rates increase in every band). Assuming we move forward with fee rate cards we should make it an explicit requirement that the fees in higher bands must not decrease, which seems like a very sane requirement. (Is it?) However I am not sure if the virtualization of the channel into 4 smaller channels as ZmnSCPxj suggested to think of it is beneficial for the network. Intuitively (I have no formal proof or simulation for this yet) I agree with the people who voiced their concern that this may just overall increase payment latency and decrease reliability (because selfish senders might start with the cheapest or cheaper bands). My concern might be mitigated if we started to share two bits of information about the liquidity in a channel (either network wide) or as I propose in PR 780 within the friend of the friend network [1]. In your other mail of this thread [2] you referred to PR 780 and noted that it may be worthwhile to investigate this. I agree and I invite you to help me doing so.

3. After having privately discussed my recent blog article [3] to set up valves via `htlc_maximum_msat` with a few node operators and having heard their thoughts I realized that the idea of fee rate cards might actually be even more powerful if not used to divide the channel capacity but rather have various fee rate cards for various `htlc_maximum_msat` values. The Idea is quite simple: If you have a certain drain on a channel and install a valve to do flow control you could still offer someone to break the valve open and get their large payment through and deplete your channel if they would pay premium for it. Again without formal proof or simulation it is my intuition that this is a more natural and less complicated design and would achieve two things which both seem beneficial for the network and its participants:

3a) Node operators would not loose out the opportunity to route large payments when setting up valves. The main concern I had from some node operators about setting up valves was that they know that some channels have not many forwarding requests but usually rather large ones. Setting up a valve may not be in their interest as it would be too restrictive. With various fee rates for various payment sizes they could still allow large payments (Similar to your proposal where payments that are larger than 25% of the capacity also cannot be in the first band of the fees)

3b) In contrast to your proposal the sending nodes would not have to have the doubt in which band the channel currently is and save on guessing. If the amount is small enough they would usually get the cheaper fee rate but if they want to move a lot of liquidity they have to offer a premium. I think this would also produce a convex cost function but reduce the guessing game and lower failed attempts and latency. It could still happen that especially for a larger amount that not enough liquidity would be in the channel and even a small payment could fail (as could happen these days). Both could happen within your proposal too.

So while I find your proposal interesting I would love to investigate a bit more how it interacts with other proposals and if we could make your and other proposals even stronger by combining some of the other ideas.

with kind Regards Rene

[1]: https://github.com/lightning/bolts/pull/780 [2]: https://www.learnbitcoin.com/archive/lists/lightning-dev/t/2022/fee-ratecards-your-gateway-to-negativity#m-27fa6522 [3]: https://www.learnbitcoin.com/archive/lists/lightning-dev/t/2022/htlc-maximum-msat-as-a-valve-for-flow-control-on-the-lightning-network#m-8eaa536b

On Tue, Sep 13, 2022 at 11:15 PM lisa neigut <niftynei at gmail.com> wrote:

Quoted text (204 lines)
> Hi all,
>
> I've been talking about them for a bit[^1], now[^2], but here's a more formal proposal for fee ratecards.
>
> Spec PR + implementation to come.
>
> ## What is a fee ratecard?
>
> A ratecard is a set of four values, positive or negative, that price different
> bands of available liquidity for a channel.
>
> A ratecard replaces the current `fee_proportional_millionths` and `fee_base_msat` currently used to calculate the owed fees for forwarding a payment on the
> lightning network.
>
> Instead, with ratecards, a channel operator may specify four different
> rates for a channel's liquidity, that will automatically be updated
> depending on the current channel capacity. The four capacity bands are fixed
> at 0-25%, 26-50%, 51-75%, and 76-100%.
>
> Currently, all payments are priced equally. Fee ratecards update this such that
> payments can be priced differently, depending on the current available
> capacity in a channel. This allows node operators to dynamically price
> their liquidity, without needing to continually issue gossip updates as
> the balance changes (which may leak payment flow timing).
>
> ## Spec Changes + Implementation Notes
>
> To the `channel_update` gossip message, we add a TLV with one defined type, `ratecard`. The ratecard contains 4 16-bit signed integers, one for each quarter of channel capacity. (0-25, 26-50, 51-75, 76-100%).
>
> ```
> 1. `tlv_stream`: `channel_update_tlvs`
> 2. types:
>     1. type: 1 (`ratecard`)
>     2. data:
>         * [`s16`:`fee_basis_0_25`]
>         * [`s16`:`fee_basis_26_50`]
>         * [`s16`:`fee_basis_51_75`]
>         * [`s16`:`fee_basis_76_100`]
> ```
>
> If a node is advertising a `ratecard` in their `channel_update` for that channel, a routing node SHOULD pick the rate to pay based on their current guess of the channel's capacity as well as priority for the payment.
>
> If a payment is high priority, it is recommended to pay at the highest feeband,
> to ensure delivery (if possible).
>
> On payment failure, the response is the same (you return a copy of the `channel_update` in the onion). You MAY give an additional hint as to what the current
> acceptable feerate is for a payment.
>
> If the feerate card entry is set, the rates there take precedence over the
> `fee_base_msat` and the `fee_proportional_millionths`.
>
> The `feerate` card effectively removes the ability to set a `fee_base_msat`.
>
> To minimize payment routing failure, it is recommended to set the
> `fee_proportional_millionths` to the same rate as the highest `ratecard`
> rate. (Most likely the `ratecard`.`fee_basis_0_25`).
>
> Note that `ratecards` unit is in basis points, not millionths. As basis points
> are 1/10,000, they're 100x less than the same value expressed as millionths.
>
> - A `basis_point` value of 5 is a fee of 5msat on a 10k msat payment.
> - A `fee_proportional_millionths` of 500 is a fee of 5msat on a 10k msat payment.
>
> The current expected price for sats to be pushed to the other side of the
> channel is to be priced by the lowest ratecard capacity band that that payment
> will push the balance into.
>
> For example, if a payment moves 50k through a 100k channel which is currently
> at a total available capacity of 75k sats (which means it'll move the capacity
> from 75k to 25k), that payment will be expected to pay a rate equal to the
> 0-25% band, as it'll push the available capacity into the 0-25% range.
>
> Using this rule, HTLCs consuming significant portions of a channel's
> total capacity are more likely to pay higher fees.
>
> ### Motivation and Rationale
> At the last in-person spec meeting, it was noted that channel capacity is
> often of variable value depending on the amount of capacity currently
> available in that channel.
>
> It was also noted that we'd like to allow node operators to experiment
> with negative fees.
>
> You can't easily allow for negative feerates with our current gossip messages,
> as it would give gossip an economic value which may have an adverse impact
> on the ability of nodes to stay up to date with the current lightning channel
> topology; it also stands to greatly increase the volume of gossip
> updates issued by any one node, which should scale with payment volume,
> as nodes update their gossip to change their current fees on any one channel.
>
> Note that some nodes already automatically update their channel fees based on
> the available capacity in a channel; fee ratecards should be a more succinct
> way for node operators to express more fine grained prices of their existing
> capacity, with a much reduced bandwidth burden.
>
> ### Feerate Cards, Frequently Asked Questions
>
> #### Why four evenly spaced buckets? Why not X function?
>
> 1. Expressibility
> 	Fees are calculated by the node creating the route for a payment, using
> 	parameters set by the channel node operator. These paramters must be
> 	communicated via gossip to every node, and then used as inputs to the
> 	routing function.
>
> 	Parameters need to be uniform and well understood such that
> 	routing algorithm designers can make efficient use of them.
>
> 	Four buckets is wide enough such that payment should
> 	be able to find/pick a current channel capacity with good
> 	probability, yet hopefully expressive enough for routing
> 	operators to be able to price their available liquidity
> 	with sufficient granularity.
>
> 	Four evenly spaced buckets also make it much easier to
> 	reason about information leakage (binary search).
>
> 2. Predictability for payment success.
> 	Feerate cards don't introduce any new risk to payment failure,
> 	as the current fee rates of a channel may currently differ
> 	from a node's gossip information.
>
> 	Rather, feerate cards offer a way for your routing algorithm
> 	to dynamically decide on what level of capacity it estimates
> 	the channel to be at, and its tolerance for failures.
>
>
> #### Won't this leak my channel balance?
>
> At most, feerate buckets reduce the total number of payment attempts
> required to find an exact channel balance by 2.
>
> It does, however, provide a much lower 'cost of capital' mechanism
> for discovering which band of payment is likely to succeed.
>
> Currently, to discover if a 100k channel has capacity for a 75k sat payment,
> you'd need 75k sats of available liquidity in the node leading up to
> that channel (or 25k in the opposite direction) from your probe node, in
> order to discover if that bucket is available.
>
> This ties up available liquidity along the entire probe route.
>
> With feerate cards, you could do a 1k sat payment at each feerate card
> fee band, and discover the approximate bucket without tying up
> as much of your own own outband capital.
>
> This makes probing more feasible for any node that wants to make a payment,
> while reducing the capital tied up to discern the same amount of information.
>
> #### More data in the channel_update message! Just what we need, more gossip.
>
> It's anticipated that feerate cards will greatly reduce the number of
> `channel_update`s issued by a node, by allowing node operators to dynamically
> price their liquidity by available capacity via a single, static
> `channel_update`.
>
> This should reduce or remove the need to rebroadcast a `channel_update` when a
> channel's capacity changes.
>
>
> #### How do negative fees work?
>
> Astute readers may notice that the proposed feerate card bands can be expressed
> as negative numbers. This allows node operators to price the liquidity
> available in their channel at a discount.
>
> Here's a good way to think about the impact a negative fee will
> have on your channel balances.
>
> A feerate of 5 basis points means that, in order to push 10k sats from
> one of your channel balances to the peer, another of yours must push
> you 10,005 sats. This means you always need more inbound than outbound
> in order to route a payment (unless you're using zero fees, in which case
> you'd need an equal amount).
>
> Negative fees reverse this. At -5 basis points, you'd only need to receive 9,995
> on an inbound channel to cause you to push out 10k sats. This allows you
> to reallocate your inbound capacity at a slight discount to the party
> who's responsible for moving the capital.
>
> #### What happened to payment base fees?
>
> They're going away (they do not work with negative rates).
> Hopefully ratecards will give you enough expressivity to figure out
> good rates for your channel capacity without them.
>
>
> ### Credits
>
> This proposal is a marriage of Clara Shikleman's push to start thinking
> about negative fees, and ZmnSCPxj's comments on the variability of
> value of a channel's liquidity based on current capacity.
>
>
> ~niftynei
>
> [^1]: [Slides on liquidity + lightning](https://docs.google.com/presentation/d/1gK5_JvDl6aR8EqEKIxfdIHMR2vNIgHUS5tydP2kB_gA/edit?usp=sharing)
> [^2]: [Presentation of slides at btcpp in Austin](https://www.youtube.com/watch?v=voEbAeS_B5w)
>
> _______________________________________________
> Lightning-dev mailing list
> Lightning-dev at lists.linuxfoundation.org
> https://www.learnbitcoin.com/archive/lists/lightning-dev
>