High level fee mechanics



Summary:

The message is a query about Lightning fees in routed payments. The BOLT spec contains detailed information on the topic, but it can be difficult to navigate. In the case of a multi-hop routed payment where A needs to pay D through B and C, established channels are A->B->C->D. A high-level explanation of how fees are established, announced and ultimately claimed in such a payment is sought. Node gossip, the `channel_update` message in BOLT#7, is used to announce fees. For each channel, there are two `channel_update` messages, one from each direction. If A has obsolete information about fees, routing will fail, but the `channel_update` will also be sent as part of the error message returned by payment routing failure. A computes the amount of fees that need to be added to the payment to cover all fees. If D is to be given a payment with value `msatoshi`, then it computes first the C->D fee and adds that to `msatoshi`. The payment that needs to reach C is computed similarly, except the `msatoshi` is replaced with the payment that should reach C. A knows how much it has to give to B. D is only aware of how much C offers it. A offer B a value that is higher than what A instructs B to forward to C. The difference is the fee. Since the highest value is at the source A, A ends up paying the entire fee.


Updated on: 2023-05-24T22:05:59.860181+00:00