Skip to content
LearnBitcoin

ResearchBitcoin Dev Archive lightning-dev list

High level fee mechanics

12 messages, Mar 18 to Apr 13, 2018. Started by Thomas Steenholdt.

ZmnSCPxj (5), Thomas Steenholdt (3), Benjamin Mord (3), Alejandro Ranchal Pedrosa

Permalink First message in the Wayback Machine

Thomas Steenholdt permalink original

Hi,

I've been trying to figure out the mechanics of Lightning fees, especially in the case of routed payments. Unfortunately, I haven't had any success in finding a high level description on the topic.

I'm hoping somebody is able to point me in the right direction?

Example:

A multi-hop routed payment where A needs to pay D through B and C. Established channels are A -> B -> C -> D.

What I'm looking for is a high level explanation of how fees are established, announced and ultimately claimed in a payment like this. Some of the questions that come to mind are:

- Does A know ahead of time the fees on B and C, or only when trying to set up the payment? And how?
- How does A know the amount of fees that need to be added to the payment to cover all fees?
- Is D aware of the full amount including fees or is that somehow hidden?
- How are the fees actually claimed (who ends up paying whom)?

Thanks in advance.

/Thomas

ZmnSCPxj in reply to Thomas Steenholdt permalink original

Good morning Thomas,

Sent with [ProtonMail](https://protonmail.com) Secure Email.

‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐ On March 19, 2018 6:24 AM, Thomas Steenholdt <TSteenholdt at cascadetechnologypartners.com> wrote:

Quoted text (5 lines)
> Hi,
>
> I've been trying to figure out the mechanics of Lightning fees, especially in the case of routed payments. Unfortunately, I haven't had any success in finding a high level description on the topic.
>
> I'm hoping somebody is able to point me in the right direction?

BOLT spec https://github.com/lightningnetwork/lightning-rfc contains everything, but is very detailed and contains the topic in multiple places.

Quoted text (7 lines)
> Example:
>
> A multi-hop routed payment where A needs to pay D through B and C. Established channels are A -> B -> C -> D.
>
> What I'm looking for is a high level explanation of how fees are established, announced and ultimately claimed in a payment like this. Some of the questions that come to mind are:
>
> - Does A know ahead of time the fees on B and C, or only when trying to set up the payment? And how?

Yes. Node gossip, the `channel_update` message in BOLT#7. This message, contains `fee_base_msat` and `fee_proportional_millionths`. For each channel, there are two `channel_update` messages, one from each direction. For example B<->C channel, B announces its fee for B->C transfers while C announnces its fee for C->B transfers.

The A may have obsolete information about fees (e.g. B or C change their fee but their `channel_update` has not propagated to A yet). In this case, payment routing will fail, but the `channel_update` will also be sent as part of the error message returned by payment routing failure.

Quoted text (1 line)
> - How does A know the amount of fees that need to be added to the payment to cover all fees?

It computes it. If D is to be given a payment with value `msatoshi` then it computes first the C->D fee, which is the C->D `fee_base_msat` + (C->D `fee_proportion_millionts` * `msatoshi` / 1,000,000). Add that to `msatoshi` and that is the payment that needs to reach C, so A computes the payment from B->C similarly, except the `msatoshi` is replaced with the payment that should reach C. Then A knows how much it has to give to B.

Quoted text (1 line)
> - Is D aware of the full amount including fees or is that somehow hidden?

No. D is only aware of how much C offers it.

Quoted text (1 line)
> - How are the fees actually claimed (who ends up paying whom)?

A offer B a value that is higher than what A instruct B to forward to C. The difference is the fee. Since the highest value is at the source A, A is the one, who ends up paying the entire fee.

Regards, ZmnSCPxj

Thomas Steenholdt in reply to ZmnSCPxj permalink original

Hi ZmnSCPxj,

Thank you so much - Exactly what I needed! 😊

/Thomas

________________________________ From: ZmnSCPxj <ZmnSCPxj at protonmail.com> Sent: Sunday, March 18, 2018 8:48:57 PM To: Thomas Steenholdt Cc: lightning-dev at lists.linuxfoundation.org Subject: Re: [Lightning-dev] High level fee mechanics

Good morning Thomas,

Sent with ProtonMail<https://protonmail.com> Secure Email.

‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐ On March 19, 2018 6:24 AM, Thomas Steenholdt <TSteenholdt at cascadetechnologypartners.com> wrote:

Hi,

I've been trying to figure out the mechanics of Lightning fees, especially in the case of routed payments. Unfortunately, I haven't had any success in finding a high level description on the topic.

I'm hoping somebody is able to point me in the right direction?

Quoted text (1 line, sent without quote marks)
BOLT spec https://github.com/lightningnetwork/lightning-rfc contains everything, but is very detailed and contains the topic in multiple places.

Example:

A multi-hop routed payment where A needs to pay D through B and C. Established channels are A -> B -> C -> D.

What I'm looking for is a high level explanation of how fees are established, announced and ultimately claimed in a payment like this. Some of the questions that come to mind are:

- Does A know ahead of time the fees on B and C, or only when trying to set up the payment? And how?
Quoted text (2 lines, sent without quote marks)
Yes.  Node gossip, the `channel_update` message in BOLT#7.  This message, contains `fee_base_msat` and `fee_proportional_millionths`.  For each channel, there are two `channel_update` messages, one from each direction.  For example B<->C channel, B announces its fee for B->C transfers while C announnces its fee for C->B transfers.

The A may have obsolete information about fees (e.g. B or C change their fee but their `channel_update` has not propagated to A yet).  In this case, payment routing will fail, but the `channel_update` will also be sent as part of the error message returned by payment routing failure.
- How does A know the amount of fees that need to be added to the payment to cover all fees?
Quoted text (1 line, sent without quote marks)
It computes it.  If D is to be given a payment with value `msatoshi` then it computes first the C->D fee, which is the C->D `fee_base_msat` +  (C->D `fee_proportion_millionts` * `msatoshi` / 1,000,000).  Add that to `msatoshi` and that is the payment that needs to reach C, so A computes the payment from B->C similarly, except the `msatoshi` is replaced with the payment that should reach C.  Then A knows how much it has to give to B.
- Is D aware of the full amount including fees or is that somehow hidden?
Quoted text (1 line, sent without quote marks)
No.  D is only aware of how much C offers it.
- How are the fees actually claimed (who ends up paying whom)?
Quoted text (3 lines, sent without quote marks)
A offer B a value that is higher than what A instruct B to forward to C.  The difference is the fee.  Since the highest value is at the source A, A is the one, who ends up paying the entire fee.

Regards,
ZmnSCPxj
Thomas Steenholdt in reply to ZmnSCPxj permalink original

Hi ZmnSCPxj,

I came up with a followup question...

Does node GOSSIP also reveal the funding/balance of channels, same way it does the fees?

I'm trying to understand how to make an informed payment routing decision as a sender, based on the fees (that you have already explained), but also the funding/balance of each channel, to select the cheapest route with the highest chance of success.

I have looked through the RFC and can't seem to find an explanation on whether or not the channel funding/balance information is available from GOSSIP or how else you'd handle this kind of thing?

I was hoping you might have a short explanation for this stuff as well? :-)

/Thomas

________________________________ From: ZmnSCPxj <ZmnSCPxj at protonmail.com> Sent: Sunday, March 18, 2018 8:48:57 PM To: Thomas Steenholdt Cc: lightning-dev at lists.linuxfoundation.org Subject: Re: [Lightning-dev] High level fee mechanics

Good morning Thomas,

Sent with ProtonMail<https://protonmail.com> Secure Email.

‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐ On March 19, 2018 6:24 AM, Thomas Steenholdt <TSteenholdt at cascadetechnologypartners.com> wrote:

Hi,

I've been trying to figure out the mechanics of Lightning fees, especially in the case of routed payments. Unfortunately, I haven't had any success in finding a high level description on the topic.

I'm hoping somebody is able to point me in the right direction?

Quoted text (1 line, sent without quote marks)
BOLT spec https://github.com/lightningnetwork/lightning-rfc contains everything, but is very detailed and contains the topic in multiple places.

Example:

A multi-hop routed payment where A needs to pay D through B and C. Established channels are A -> B -> C -> D.

What I'm looking for is a high level explanation of how fees are established, announced and ultimately claimed in a payment like this. Some of the questions that come to mind are:

- Does A know ahead of time the fees on B and C, or only when trying to set up the payment? And how?
Quoted text (2 lines, sent without quote marks)
Yes.  Node gossip, the `channel_update` message in BOLT#7.  This message, contains `fee_base_msat` and `fee_proportional_millionths`.  For each channel, there are two `channel_update` messages, one from each direction.  For example B<->C channel, B announces its fee for B->C transfers while C announnces its fee for C->B transfers.

The A may have obsolete information about fees (e.g. B or C change their fee but their `channel_update` has not propagated to A yet).  In this case, payment routing will fail, but the `channel_update` will also be sent as part of the error message returned by payment routing failure.
- How does A know the amount of fees that need to be added to the payment to cover all fees?
Quoted text (1 line, sent without quote marks)
It computes it.  If D is to be given a payment with value `msatoshi` then it computes first the C->D fee, which is the C->D `fee_base_msat` +  (C->D `fee_proportion_millionts` * `msatoshi` / 1,000,000).  Add that to `msatoshi` and that is the payment that needs to reach C, so A computes the payment from B->C similarly, except the `msatoshi` is replaced with the payment that should reach C.  Then A knows how much it has to give to B.
- Is D aware of the full amount including fees or is that somehow hidden?
Quoted text (1 line, sent without quote marks)
No.  D is only aware of how much C offers it.
- How are the fees actually claimed (who ends up paying whom)?
Quoted text (3 lines, sent without quote marks)
A offer B a value that is higher than what A instruct B to forward to C.  The difference is the fee.  Since the highest value is at the source A, A is the one, who ends up paying the entire fee.

Regards,
ZmnSCPxj
ZmnSCPxj in reply to Thomas Steenholdt permalink original

Good morning Thomas,

Quoted text (5 lines)
> Does node GOSSIP also reveal the funding/balance of channels, same way it does the fees?
>
> I'm trying to understand how to make an informed payment routing decision as a sender, based on the fees (that you have already explained), but also the funding/balance of each channel, to select the cheapest route with the highest chance of success.
>
> I have looked through the RFC and can't seem to find an explanation on whether or not the channel funding/balance information is available from GOSSIP or how else you'd handle this kind of thing?

No, channel balance of each peer on the channel is not revealed on node gossip.

Logically, invert the question: do you want to report how much you spend/receive on each of your channels to the network? Do you want to report how much you own on Lightning to be reported to everyone on Lightning?

Since the balance on each peer is effectively the amount of money each peer owns on that channel, and each change to that balance represents a send/receive on that channel, you will not want to report your balance, and any changes in that balance, to the entire network.

Logically you can then expect not to receive such updates from anybody else, either.

How do real-life implementations like c-lightning get your payment routes then? By brute-force trial-and-error. If one channel on a route fails, we just mark it as temporarily unuseable and plot a new route that does not include that channel. If a channel on THAT route fails, we mark it and plot another route. And so on until we run out of possible routes because all possible channels to the destination are blocked.

Alejandro Ranchal Pedrosa in reply to ZmnSCPxj permalink original

Hi ZmnSCPxj,

Quoted text (18 lines)
> No, channel balance of each peer on the channel is not revealed on
> node gossip.
>
> Logically, invert the question: do you want to report how much you
> spend/receive on each of your channels to the network? Do you want to
> report how much you own on Lightning to be reported to everyone on
> Lightning?
>
> Since the balance on each peer is effectively the amount of money each
> peer owns on that channel, and each change to that balance represents
> a send/receive on that channel, you will not want to report your
> balance, and any changes in that balance, to the entire network.
>
> Logically you can then expect not to receive such updates from anybody
> else, either.
>
> How do real-life implementations like c-lightning get your payment
> routes then?  By brute-force trial-and-error

If payment routes are discovered by brute-force trial-and-error, and actually the sender can interrupt any payment by simply not revealing the secret, isn't it possible for any sender to simply start probing to discover the capacities in each path?

Best, Alejandro.

ZmnSCPxj in reply to Alejandro Ranchal Pedrosa permalink original

Good morning Alejandro,

Quoted text (12 lines)
>> No, channel balance of each peer on the channel is not revealed on node gossip.
>>
>> Logically, invert the question: do you want to report how much you spend/receive on each of your channels to the network? Do you want to report how much you own on Lightning to be reported to everyone on Lightning?
>>
>> Since the balance on each peer is effectively the amount of money each peer owns on that channel, and each change to that balance represents a send/receive on that channel, you will not want to report your balance, and any changes in that balance, to the entire network.
>>
>> Logically you can then expect not to receive such updates from anybody else, either.
>>
>> How do real-life implementations like c-lightning get your payment routes then?  By brute-force trial-and-error
>
> If payment routes are discovered by brute-force trial-and-error, and actually the sender can interrupt any payment by simply not revealing the secret, isn't it possible for any sender to simply start probing
> to discover the capacities in each path?

Yes. Although now the sender risks its funds: if a node along the route it selects stalls, then the sender risks having its money locked for some blocks.

Also, the sender only gets one bit of information to the question: Is the channel balance in this direction greater than X?

Finally, the exact failure TEMPORARY_CHANNEL_FAILURE can mean that the other node is currently down rather than the channel not having enough capacity in that direction, or if there are too many HTLCs in-flight on that channel, or so on (the most likely currently seems to be the node is currently down rather than the channel balance being insufficient, since it seems many people do not leave their nodes running 24/7).

So it is always less desirable than getting the exact channel balances at each balance update. You get degraded privacy, but not a full loss of privacy compared to broadcasting all balance updates.

(in particular, if the channel balance changes, you would have to re-query the channel again to learn this)

(your technique is flawed in the detail that the sender simply selects a destination randomly and a random payment hash, which has negligible probability of the randomly-selected destination knowing its preimage, but is otherwise sound in its broad strokes)

Regards, ZmnSCPxj

Benjamin Mord in reply to ZmnSCPxj permalink original

Do (should) channels have the option of publicizing their balances, so as to improve routing performance / scalability in a large network, and for competitive differentiation among competing routes? This would allow channel owners to balance privacy with efficiency, and where the incentive to publish would go up in proportion to network scalability requirements. Brute force trial & error seems expensive at scale, and also reduces privacy of the sender - so it seems a useful hedge to leave this decision to the market (if technically practical).

On Wed, Apr 11, 2018 at 5:17 AM, ZmnSCPxj via Lightning-dev < lightning-dev at lists.linuxfoundation.org> wrote:

Quoted text (64 lines)
> Good morning Alejandro,
>
>
> No, channel balance of each peer on the channel is not revealed on node
> gossip.
>
> Logically, invert the question: do you want to report how much you
> spend/receive on each of your channels to the network? Do you want to
> report how much you own on Lightning to be reported to everyone on
> Lightning?
>
> Since the balance on each peer is effectively the amount of money each
> peer owns on that channel, and each change to that balance represents a
> send/receive on that channel, you will not want to report your balance, and
> any changes in that balance, to the entire network.
>
> Logically you can then expect not to receive such updates from anybody
> else, either.
>
> How do real-life implementations like c-lightning get your payment routes
> then?  By brute-force trial-and-error
>
>
> If payment routes are discovered by brute-force trial-and-error, and
> actually the sender can interrupt any payment by simply not revealing the
> secret, isn't it possible for any sender to simply start probing
> to discover the capacities in each path?
>
>
> Yes.  Although now the sender risks its funds: if a node along the route
> it selects stalls, then the sender risks having its money locked for some
> blocks.
>
> Also, the sender only gets one bit of information to the question: Is the
> channel balance in this direction greater than X?
>
> Finally, the exact failure TEMPORARY_CHANNEL_FAILURE can mean that the
> other node is currently down rather than the channel not having enough
> capacity in that direction, or if there are too many HTLCs in-flight on
> that channel, or so on (the most likely currently seems to be the node is
> currently down rather than the channel balance being insufficient, since it
> seems many people do not leave their nodes running 24/7).
>
> So it is always less desirable than getting the exact channel balances at
> each balance update.  You get degraded privacy, but not a full loss of
> privacy compared to broadcasting all balance updates.
>
> (in particular, if the channel balance changes, you would have to re-query
> the channel again to learn this)
>
> (your technique is flawed in the detail that the sender simply selects a
> destination randomly and a random payment hash, which has negligible
> probability of the randomly-selected destination knowing its preimage, but
> is otherwise sound in its broad strokes)
>
> Regards,
> ZmnSCPxj
>
> _______________________________________________
> Lightning-dev mailing list
> Lightning-dev at lists.linuxfoundation.org
> https://www.learnbitcoin.com/archive/lists/lightning-dev
>
>
ZmnSCPxj in reply to Benjamin Mord permalink original

Good morning Benjamin,

Quoted text (1 line)
> Do (should) channels have the option of publicizing their balances, so as to improve routing performance / scalability in a large network, and for competitive differentiation among competing routes? This would allow channel owners to balance privacy with efficiency, and where the incentive to publish would go up in proportion to network scalability requirements. Brute force trial & error seems expensive at scale, and also reduces privacy of the sender - so it seems a useful hedge to leave this decision to the market (if technically practical).

I think brute-force scales well enough, but perhaps we should see the network in action more.

To an extent, it is possible to hint the suitability of a channel for routing in a particular direction, without completely leaking your balance in detail, by adjusting the on-Lightning `fee_base_msat` and `fee_proportional_millionths` of channels. If you have a high balance on a channel, you reduce your side of the fee for that channel (i.e. the direction where you are the source for payments on that channel) to encourage others to use it and hopefully pay you on a depleted channel. If you have a low balance, you increase your fee. These fees are already propagated using `channel_update`. No current node software implements this yet, however.

Regards, ZmnSCPxj

Benjamin Mord in reply to ZmnSCPxj permalink original

Thank you, ZmnSCPxj.

"... by adjusting the on-Lightning `fee_base_msat` and `fee_proportional_millionths` of channels."

Yes, I agree these prices are a critical signaling mechanism that can have substantial impact on expected channel lifetime and thus economic efficiency of lightning operation overall. (As you may recall, I believe we should allow negative prices - even if present day routing algorithms choose to treat negative fees as zero for temporary simplicity.) You make a good point it can also improve routing efficiency by hinting at capacity, but for now they are unfortunately linear.

The following paper did not account for the improved efficiency that price adjustment in response to channel state will likely enable, but one thing which may be relevant here is the underlying power law assumption of transaction size distribution (which is apparently drawn from actual data), and the more general approach to estimating channel lifespan. In lieu of advertising max capacity, perhaps we should instead permit a price exponent which may optionally be set to something larger than 1. The cost to channel operator of processing a transaction is largely the impact to expected channel lifespan, which in turn is nonlinear with respect to transaction size - and dramatically so as transaction size approaches (or exceeds) remaining capacity. https://arxiv.org/pdf/1712.10222.pdf

If we combine nonlinear pricing with your March 19 AMP proposal, I expect economic efficiency could be greatly improved.

Thanks again, Benjamin Mord

On Thu, Apr 12, 2018 at 12:49 AM, ZmnSCPxj <ZmnSCPxj at protonmail.com> wrote:

Quoted text (29 lines)
> Good morning Benjamin,
>
> Do (should) channels have the option of publicizing their balances, so as
> to improve routing performance / scalability in a large network, and for
> competitive differentiation among competing routes? This would allow
> channel owners to balance privacy with efficiency, and where the incentive
> to publish would go up in proportion to network scalability requirements.
> Brute force trial & error seems expensive at scale, and also reduces
> privacy of the sender - so it seems a useful hedge to leave this decision
> to the market (if technically practical).
>
>
> I think brute-force scales well enough, but perhaps we should see the
> network in action more.
>
> To an extent, it is possible to hint the suitability of a channel for
> routing in a particular direction, without completely leaking your balance
> in detail, by adjusting the on-Lightning `fee_base_msat` and
> `fee_proportional_millionths` of channels.  If you have a high balance on a
> channel, you reduce your side of the fee for that channel (i.e. the
> direction where you are the source for payments on that channel) to
> encourage others to use it and hopefully pay you on a depleted channel.  If
> you have a low balance, you increase your fee.  These fees are already
> propagated using `channel_update`.  No current node software implements
> this yet, however.
>
> Regards,
> ZmnSCPxj
>
ZmnSCPxj in reply to Benjamin Mord permalink original

Good morning Benjamin,

Sent with [ProtonMail](https://protonmail.com) Secure Email.

‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐ On April 13, 2018 4:37 AM, Benjamin Mord <ben at mord.io> wrote:

Quoted text (8 lines)
> Thank you, ZmnSCPxj.
>
> "... by adjusting the on-Lightning `fee_base_msat` and `fee_proportional_millionths` of channels."
>
> Yes, I agree these prices are a critical signaling mechanism that can have substantial impact on expected channel lifetime and thus economic efficiency of lightning operation overall. (As you may recall, I believe we should allow negative prices - even if present day routing algorithms choose to treat negative fees as zero for temporary simplicity.) You make a good point it can also improve routing efficiency by hinting at capacity, but for now they are unfortunately linear.
>
> The following paper did not account for the improved efficiency that price adjustment in response to channel state will likely enable, but one thing which may be relevant here is the underlying power law assumption of transaction size distribution (which is apparently drawn from actual data), and the more general approach to estimating channel lifespan. In lieu of advertising max capacity, perhaps we should instead permit a price exponent which may optionally be set to something larger than 1. The cost to channel operator of processing a transaction is largely the impact to expected channel lifespan, which in turn is nonlinear with respect to transaction size - and dramatically so as transaction size approaches (or exceeds) remaining capacity.
> https://arxiv.org/pdf/1712.10222.pdf

Larger payments also have a much lower chance of successfully propagating through the network, as every channel in its route needs to have the requisite capacity, so I think it somewhat balances out (maybe).

Adding a nonlinear component would be difficult to add on to the protocol currently, as I think there is no provision for it in the protocol. But maybe I am incorrect..?

Quoted text (1 line)
> If we combine nonlinear pricing with your March 19 AMP proposal, I expect economic efficiency could be greatly improved.

My AMP proposal cannot work soon. It requires at minimum for Bellare-Neven/MuSig/Schnorr (I get confused, which is the proper name for this) signatures to be added to Bitcoin to get HD+SS. Then we need to switch over all implementations to using scriptless script contingent payments rather than hashlocked contingent payments (and convince all network node operators to upgrade); we will be unable to use an intermediate node that does not understand SS contingent payments for my style of AMP.

The earlier AMP proposal by roasbeef is back-compatible (uses the same hashlocked contingent payments we already use now), but does not support a proof-of-payment compatible with ZKCP protocols (although possibly I am wrong, I think roasbeef has mentioned before that it is ZKCP compatible).

Regards, ZmnSCPxj

Quoted text (15 lines)
> Thanks again,
> Benjamin Mord
>
> On Thu, Apr 12, 2018 at 12:49 AM, ZmnSCPxj <ZmnSCPxj at protonmail.com> wrote:
>
>> Good morning Benjamin,
>>
>>> Do (should) channels have the option of publicizing their balances, so as to improve routing performance / scalability in a large network, and for competitive differentiation among competing routes? This would allow channel owners to balance privacy with efficiency, and where the incentive to publish would go up in proportion to network scalability requirements. Brute force trial & error seems expensive at scale, and also reduces privacy of the sender - so it seems a useful hedge to leave this decision to the market (if technically practical).
>>
>> I think brute-force scales well enough, but perhaps we should see the network in action more.
>>
>> To an extent, it is possible to hint the suitability of a channel for routing in a particular direction, without completely leaking your balance in detail, by adjusting the on-Lightning `fee_base_msat` and `fee_proportional_millionths` of channels.  If you have a high balance on a channel, you reduce your side of the fee for that channel (i.e. the direction where you are the source for payments on that channel) to encourage others to use it and hopefully pay you on a depleted channel.  If you have a low balance, you increase your fee.  These fees are already propagated using `channel_update`.  No current node software implements this yet, however.
>>
>> Regards,
>> ZmnSCPxj
Benjamin Mord in reply to ZmnSCPxj permalink original

Good morning ZmnSCPxj,

As a skeptic of discrete logarithm's long-term security, I view scriptless scripts as dangerously seductive. (But wow, are they cool! Almost cool enough to wish we could uninvent quantum computing. I wonder if R-LWE can be used instead as foundation? Not that I expect R-LWE to hold long-term either...) But I digress.

As I listen to all the work starting up in the legacy financial markets to mitigate the likely future failure of LIBOR, given how little thought went into that possibility in the writing of currently-traded derivative contracts, I'm reminded of how important and also how possible it is to think about short and long-term goals simultaneously as we build systems. It is far easier now than it will soon be to add expressiveness into the core protocol, such as negative fees and optional exponential component. Just because we pragmatically ignore negative fees and exponents in routing decisions today, does not mean we will not feel enormous need for them in the future - and having the ability to express such fee structures now will enable efficiency improvements in the future, as simple implementation (rather than protocol) upgrades.

I recognize AMP (at least as you proposed) is a long way out, but it seems like something we'll inevitably want and will surely add. It is therefore worth assuming now, as we think strategically about how fee dynamics will improve efficiency over time. Who knows, my skepticism of discrete logarithm hardness may prove misplaced, or else we'll find other ways to achieve AMP. (I have not read roasbeef's proposal, but I shall.) The protocol does not presently allow an exponential component, but it would be trivial to add (even if, at first, defaulted to 1).

Thanks, Ben

On Fri, Apr 13, 2018 at 9:26 AM, ZmnSCPxj <ZmnSCPxj at protonmail.com> wrote:

Quoted text (104 lines)
> Good morning Benjamin,
>
>
>
>
> Sent with ProtonMail <https://protonmail.com> Secure Email.
>
> ‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐
> On April 13, 2018 4:37 AM, Benjamin Mord <ben at mord.io> wrote:
>
> Thank you, ZmnSCPxj.
>
> "... by adjusting the on-Lightning `fee_base_msat` and
> `fee_proportional_millionths` of channels."
>
> Yes, I agree these prices are a critical signaling mechanism that can have
> substantial impact on expected channel lifetime and thus economic
> efficiency of lightning operation overall. (As you may recall, I believe we
> should allow negative prices - even if present day routing algorithms
> choose to treat negative fees as zero for temporary simplicity.) You make
> a good point it can also improve routing efficiency by hinting at capacity,
> but for now they are unfortunately linear.
>
> The following paper did not account for the improved efficiency that price
> adjustment in response to channel state will likely enable, but one thing
> which may be relevant here is the underlying power law assumption of
> transaction size distribution (which is apparently drawn from actual data),
> and the more general approach to estimating channel lifespan. In lieu of
> advertising max capacity, perhaps we should instead permit a price exponent
> which may optionally be set to something larger than 1. The cost to channel
> operator of processing a transaction is largely the impact to expected
> channel lifespan, which in turn is nonlinear with respect to transaction
> size - and dramatically so as transaction size approaches (or exceeds)
> remaining capacity.
> https://arxiv.org/pdf/1712.10222.pdf
>
>
> Larger payments also have a much lower chance of successfully propagating
> through the network, as every channel in its route needs to have the
> requisite capacity, so I think it somewhat balances out (maybe).
>
> Adding a nonlinear component would be difficult to add on to the protocol
> currently, as I think there is no provision for it in the protocol.  But
> maybe I am incorrect..?
>
> If we combine nonlinear pricing with your March 19 AMP proposal, I expect
> economic efficiency could be greatly improved.
>
>
> My AMP proposal cannot work soon.  It requires at minimum for
> Bellare-Neven/MuSig/Schnorr (I get confused, which is the proper name for
> this) signatures to be added to Bitcoin to get HD+SS.  Then we need to
> switch over all implementations to using scriptless script contingent
> payments rather than hashlocked contingent payments (and convince all
> network node operators to upgrade); we will be unable to use an
> intermediate node that does not understand SS contingent payments for my
> style of AMP.
>
> The earlier AMP proposal by roasbeef is back-compatible (uses the same
> hashlocked contingent payments we already use now), but does not support a
> proof-of-payment compatible with ZKCP protocols (although possibly I am
> wrong, I think roasbeef has mentioned before that it is ZKCP compatible).
>
> Regards,
> ZmnSCPxj
>
> Thanks again,
> Benjamin Mord
>
>
> On Thu, Apr 12, 2018 at 12:49 AM, ZmnSCPxj <ZmnSCPxj at protonmail.com>
> wrote:
>
>> Good morning Benjamin,
>>
>> Do (should) channels have the option of publicizing their balances, so as
>> to improve routing performance / scalability in a large network, and for
>> competitive differentiation among competing routes? This would allow
>> channel owners to balance privacy with efficiency, and where the incentive
>> to publish would go up in proportion to network scalability requirements.
>> Brute force trial & error seems expensive at scale, and also reduces
>> privacy of the sender - so it seems a useful hedge to leave this decision
>> to the market (if technically practical).
>>
>>
>> I think brute-force scales well enough, but perhaps we should see the
>> network in action more.
>>
>> To an extent, it is possible to hint the suitability of a channel for
>> routing in a particular direction, without completely leaking your balance
>> in detail, by adjusting the on-Lightning `fee_base_msat` and
>> `fee_proportional_millionths` of channels.  If you have a high balance on a
>> channel, you reduce your side of the fee for that channel (i.e. the
>> direction where you are the source for payments on that channel) to
>> encourage others to use it and hopefully pay you on a depleted channel.  If
>> you have a low balance, you increase your fee.  These fees are already
>> propagated using `channel_update`.  No current node software implements
>> this yet, however.
>>
>> Regards,
>> ZmnSCPxj
>>
>
>