blip-0073: Path Queries#73
Conversation
Path queries are three optional peer messages (query_path, reply_path, reject_query_path) that let nodes cooperatively construct payment paths: a sender asks a peer for a path to a destination, and the responder answers from first-hand knowledge of its own channels. This reduces a sender's dependence on the gossiped graph, converts probing's involuntary balance extraction into voluntary, policy-governed disclosure, and lets routing nodes quote policy per query, free of gossip's currency and expressivity limits. This is the second version of the proposal, migrated from its original draft against lightning/bolts. Path queries are optional and pairwise — adoption can be partial and strategies are locally decided — so the proposal does not require universality and is better suited as a bLIP. The revision also reworks the wire format (TLV streams, MPP path parts, query_id correlation, required expiry_ms in both directions) and substantially expands the rationale, privacy, and DoS analyses. Reserves message types 32769/32771/32773 and feature bits 264/265 via bLIP 2. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
Some open design decisions that I'd like to cover in review discussion:
|
|
Isn't the old FoF balance (quantile) query somewhat more privacy-preserving than this? Isn't it preferable for the edge node with limited balances to query their LSP for information and then compute paths from that themselves rather than asking for a whole path? |
|
To my understanding, even though both are query-based and are intended to improve payment reliability, it's really comparing apples and oranges. Foaf is a liquidity management tool; nodes share balance information in their locale, so that they can rebalance with each other. Path queries are a path finding mechanism for payment senders and policy distribution for routing nodes. Regarding privacy, are you referring to the payment details (e.g a downstream node, amount)? If so, I'm curious what queries you have in mind, but generally yes, the more targeted the query, the more it reveals about itself. That said:
|
|
No, foaf balance information is exactly the useful information you want to do pathfinding better if your peers have more channels/liquidity than you do (which is common). |
|
My read of the PR is that foaf is designed to improve reliability by changing network state, rather than supplying payment senders with path knowledge. Perhaps you can point me to a more up-to-date document that describes payment senders using it to discover feasible paths? Either way, foaf replies are explicitly designed not to compose ("MUST NOT be gossiped and forwarded to other peers") and therefore do not have the same reach as path queries. Foaf messages also do not carry routing policy. If you think this deserves a section in |
|
You can use it for either, its just a general query. As for the question of asking a random node far away for a path, that's not gonna work as well as you think it will. The only reason to ask someone else for a path is (a) if they're also in your "neighborhood" and (b) (1) they send more payments/probes than you do, and thus have more up-to-date information or (2) they're your LSP and you just want to know the state of their channels. (a) means there's no real reason to send these too far, and (b)(2) is accomplished by foaf. (b)(1) means this isn't as useful as you think in general, I fear. |
|
Anonymous queries definitely require more thought, which is why I left them in the That said, I disagree on (a) and while both counts of (b) are true to an extent, I would add some context that leads me to a different conclusion: (a) one of the examples (referenced in the privacy section) is to partition a payment into sub-paths, so that no routing node sees both the source and destination of the full route. In this case, the downstream sub-path(s) is likely outside of your neighborhood. For example: i. Select a remote node with path query support (T2) (b) (1) Path queries are designed to bridge this information asymmetry between nodes. The queried node always has direct knowledge of its channels, which is always superior to inferred knowledge from payment results/probes. Beyond its own channels, the queried node can also query (i.e recursion). Yes, large nodes with more inferred knowledge still have an advantage, but cooperation gives nodes the ability to close the gap. (2) Definitely a valid use case, but more likely accomplished with a regular query. I'd also distinguish; your not asking for channel state, your asking for a pathfinding evaluation, which uses the channel state as input. Personally, my concerns with anonymous queries are:
|
|
If your goal is to partition a payment into subpaths you should use trampoline, not path queries. If your goal is to share knowledge, you should share that knowledge, not make a path query. A path query is a really lazy and bad way to share knowledge rather than just sharing the knowledge built up from probing/payments and letting the client do its own pathfinding with that data. |
As described in the
The goal is to send a payment. A payment needs a path. A path is the most targeted information a node can ask for, and the least information a responder must reveal to answer it.
If I'm following this logic correctly, you're saying nodes should share with their peers, not only their own channel balances, but also the balances they've discovered from others using probes. Feel free to correct. |
Because you want the trampoline hop to be able to retry for you.
Yes. Lightning nodes designed to operate for payers which don't send/probe a lot already have APIs for this (or use trampoline) - https://docs.rs/lightning/latest/lightning/routing/scoring/struct.CombinedScorer.html#method.merge |
Yes, that is an argument for trampoline that's explicitly stated in the proposal. I'm asking for critiques on the other side of the argument. Do fees not matter? Is HTLC duration not a cost? Or do path queries fail to deliver on either?
Interesting, I didn't know nodes were doing this. So, it seems we agree that liquidity knowledge is a gap for the payment sender. As for approach, while I can see some value here, merging two global views of the network to perform a single pathfinding operation strikes me as inefficient. Similar to asking Google Maps for the entire map of the US with real-time traffic data just to get directions to your grandma's house. Except in this case, the "real-time traffic data" is someone else's private balance. I'll also note |
Its a tiny file and a few milliseconds of CPU...No, it costs almost nothing.
Huh? It covers everything a node uses to route, ignoring fixed code. |
It may be small as a one time transfer, but staying accurate requires continuous syncing (i.e
I think we're answering different questions. You're right that merge plus gossip covers the inputs a node routes on today. My claim is about what gossip can express, not whether it's complete. |
Path queries are three optional peer messages (
query_path,reply_path,reject_query_path) that let nodes cooperatively construct payment paths. Responses apply a node's first-hand knowledge of its own channel balances. This reduces node dependence on the gossiped graph, provides an alternative to probing, and lets routing nodes price payment flows per query, free of gossip's currency and expressivity limits.This is the second version of the proposal, migrated from its original draft against lightning/bolts. Path queries are optional and pairwise. Since adoption can be partial and strategies are locally decided, the proposal does not require universality and is better suited as a bLIP. The revision also reworks the wire format (TLV streams, MPP path parts,
query_idcorrelation, requiredexpiry_msin both directions) and substantially expands the rationale, privacy, and DoS analyses.Reserves message types 32769/32771/32773 and feature bits 264/265 via bLIP 2.