Repository navigation
Answer the four questions people actually ask about fees - #12
Merged
Merged
Conversation
Four questions came in that the routing quest left implicit or unanswered: who receives the fees, does each hop add one, how do you know how many hops there will be, and does it matter. Three of them had no answer anywhere. A new stop takes all four in order, and the most interesting is the first: a routing node is never *sent* anything. It is offered slightly more on the channel a payment arrives on than it offers on the channel it forwards to, and when the preimage settles both HTLCs the difference simply stays on its side. Routing income is a gap between two numbers, not a transfer — which is why it arrives as channel balance and never as an on-chain payment. The hop-count answer has a pleasing asymmetry worth drawing out. The sender knows exactly, because the sender picks the route and builds the onion around it, so the total is settled before anything moves and there is no such thing as a surprise charge. Nobody on the route knows, because Quest #5's whole point is that a hop cannot learn the route's length or its own position. Both are true at once. Does it matter: less than people expect. A long cheap route beats a short expensive one and the wallet will take it; what matters is the total, and you see the total first. There is a ceiling of 20 hops, forced by the onion being a fixed 1,300 bytes, quoted from BOLT #4. All five questions are also in the question-first index, deep-linked to the stop that answers them, and the route finder now names who keeps each fee rather than just showing an amount. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Four questions came in that the routing quest left implicit or unanswered. Three had no answer anywhere.
The new stop takes them in order
Who receives them — and this is the one worth reading. A routing node is never sent anything. It's offered slightly more on the channel the payment arrives on than it offers on the channel it forwards to, and when the preimage settles both HTLCs, the difference simply stays on its side. Routing income is a gap between two numbers, not a transfer — which is why it arrives as channel balance and never as an on-chain payment.
Does each hop add a fee — every hop that forwards does. The sender doesn't (forwarding for nobody) and the payee doesn't (being paid), so N channels means N−1 fees.
How do you know how many hops — a pleasing asymmetry. You know exactly, because you pick the route and build the onion around it, so the total is settled before anything moves and there's no such thing as a surprise charge. Nobody on the route knows, because Quest #5's whole point is that a hop can't learn the route's length or its own position. Both true at once.
Does it matter — less than people expect. A long cheap route beats a short expensive one and the wallet takes it; what matters is the total, and you see the total first. There's a ceiling of 20 hops, forced by the onion being a fixed 1,300 bytes — quoted from BOLT #4.
Findability
All five questions are in the question-first index, deep-linked to the stop that answers them. Verified rendering.
The route finder now names who keeps each fee rather than showing a bare amount: "A charges nothing — it is the sender, forwarding for no one" / "B keeps 2,200 msat" / "1 fee across 2 channels."
147 tests green; lint, build, typecheck clean.
🤖 Generated with Claude Code