The fee is implied by the difference in routed amounts across the channels in the payment route. The htlc amounts reflecting the payment amount will decrease from channel to channel.
n1 -> n2: Incoming amount
n2 -> n3: Incoming amount - fee_2 (n2
earns a fee_2)
n3 -> n4: Incoming amount - fee_2 - fee_3 (n3 earns
a fee of fee_3)
Each fee is earned by a single node which relays the payment from one of its payment channels to another. On balance, the peer receives an amount A, and forwards an amount A - fee to the channel it is connected to along the route.
Each peer can decide which fee it wishes to set when providing routing services. When the route is negotiated, the announced fees of each peer are taken into consideration to construct the optimal route.
Once peers agree to participate in forwarding a route, the payment amounts along the route are committed to the htlc outputs in each channel. Theses htlc amounts will decrease along the route, reflecting the forwarding fees charged by each peer.
Are you sure that the hop from n1 to n2 is without fee? Ist the inbound channel always charging and in that sense we would have 3 fees to be paid? – Rene Pickhardt – 2019-02-06T11:26:24.713