Research/Bitcoin Dev Archive / lightning-dev list
Revisiting Link-level payment splitting via intermediary rendezvous nodes
2 messages, Aug 7 to 10, 2021. Started by Gijs van Dam.
Gijs van Dam, ZmnSCPxj
Hi All,
I would like to revisit a topic that has been discussed earlier between ZmnSCPxj and Christian Decker. [1]
I think it's important to revisit it, because not only does ZmnSCPxj propose a cool trick, but it can also be used to mitigate certain attacks. (More on that later)
ZmnSCPxj wrote:
Quoted text (11 lines)
> consider this below graph: > > E<---D--->C<---B > ^ / > | / > |L > A > > In the above, B requests a route from B->C->D->E. > > However, C cannot send to D, since the channel direction is saturated in
favor of D.
Quoted text (2 lines)
> > Alternately, C can route to D via A instead. It holds the (encrypted)
route from D to E. It can take that sub-route and treat it as a partial route-to-payee under rendez-vous routing, as long as node A supports rendez-vous routing.
Quoted text (2 lines)
> > This can allow re-routing or payment splitting over multiple hops.
Christian replied by explaining this is not possible because "with this scheme it is not possible for C to find an ephemeral key that would end up identical to the one that D would require to decrypt the onion correctly."
Christian is correct but I think this problem can be solved with a simple change to the setup. Consider the same graph, but now it's not node A that supports rendezvous routing but it is node D.
To circumvent the saturated channel D-C, C creates the route C->A->D, where node D supports rendezvous routing. C can create a sub-route from D to E and treat it as a partial route-to-payee under rendezvous routing by using the hop payload found when unwrapping the onion of the original route B->C->D->E . Because every node in a route is able to create the ephemeral key for the next node by tweaking it with its own shared secret, C is also able to create the ephemeral key for D. C passes that ephemeral key into the payload of the rendezvous node D in the alternate route, signaling to D it needs to swap out the key. D, upon unwrapping its onion sees that it needs to swap ephemeral keys, does so, and goes on with the route to E.
Under these changed circumstances I don't think Christian's critique still holds, but I'd love to hear your feedback.
Now as to why I think this is useful:
1. ZmnSCPxj proposed this as kind of atomic JIT rebalancing. The rebalancing only happens if the payment happens. 2. It can be used to offload HTLC's to another channel, mitigating channel jamming. 3. It can be used to mitigate Balance Disclosure Attacks, because an attacker wouldn't necessarily be sure which channels are used for routing. I think Rusty calls this "sloppy routing".
Thanks for your attention,
Gijs van Dam
Good morning Gijs,
Quoted text (11 lines)
> To circumvent the saturated channel D-C, C creates the route C->A->D, > where node D supports rendezvous routing. C can create a sub-route > from D to E and treat it as a partial route-to-payee under rendezvous > routing by using the hop payload found when unwrapping the onion of > the original route B->C->D->E . Because every node in a route is able > to create the ephemeral key for the next node by tweaking it with its > own shared secret, C is also able to create the ephemeral key for D. > C passes that ephemeral key into the payload of the rendezvous node D > in the alternate route, signaling to D it needs to swap out the key. > D, upon unwrapping its onion sees that it needs to swap ephemeral > keys, does so, and goes on with the route to E.
I confess that I only have a very vague understanding of this bit (Christian understands the math involved better than me), but my vague understanding suggests this is correct.
However, a practical problem here is that the incoming HTLC B->C has some time limit. Presumably, the payer B allocates every time limit for the individual HTLCs D->E, C->D, and B->C so that the time limit is the minimum advertised by the receiver.
Thus, if C decides to route via C->A->D, it has to ask C->A and/or A->D to give a lower time limit, or else risk its own time limit (i.e. its outgoing C->A has a time limit that is too near to the incoming B->C time limit, or even possibly exceed its incoming time limit).
Thus:
* For JIT rebalancing, the risk is that the payment ends up failing at some later point, and C paid for a rebalance without actually benefiting from it. * For the link-level splitting, the risk is that C has to give a larger time limit for the reroute via A, risking its own time limit if something has to drop onchain.
The risks are more extreme with link-level splitting --- it is far less likely to occur (the risk only really happens if things have to drop onchain, but if things remain offchain and everyone just acts in good faith, then nothing bad happens) but the consequences are more dire (C potentially loses the entire payment amount, whereas with JIT rebalancing, C only risks the fee to rebalance).
If C has some special assurance with D and/or A that reduces its risk of dropping onchain (maybe some contract or agreement?) then it may be useful to continue this development, as it trades off one kind of risk for another.
Regards, ZmnSCPxj