Research/Bitcoin Dev Archive / lightning-dev list
Proposal for Stuckless Payment
7 messages, Jun 25 to Sep 18, 2019. Started by Hiroki Gondo.
Hiroki Gondo (3), ZmnSCPxj (3), Bastien TEINTURIER
Problem
===============================
With the current BOLT 1.x, there exists a theoretical possibility that payments get stuck. In the actual network, this problem appears to be significantly improved due to the maturity of each implementation and the preventive ping-before-commitment_signed [1]. However, there is still a possibility that payments would get stuck due to an unstable communication environment, trouble and malice of intermediate nodes, etc., and we need to estimate the cost to deal with potential problems in advance.
Proposal Summary
===============================
The following proposal is intended to reduce payments getting stuck. Both the payee and the payer provide keys to settle the payment, so it is possible to safely retry in each phase that composes one payment. Also, the involvement of the intermediate nodes can be eliminated.
In other words, we can assure this problem involves only the parties (the payer and the payee). This proposal is not compatible with the BOLT 1.x, and it’s assumed to apply to future specifications.
How to deal with payments getting stuck at present?
===============================
If payments get stuck, we will need additional *trusted* operations by the final node’s implementation, the application or the service operator. For example, when a payer orders a cup of coffee and attempts to pay for the invoice, but the payment gets stuck, what must we do to correct the problem?
If an `update_add_htlc` gets stuck on an intermediate node (strictly, the absence of the `revoke_and_ack` for the `commitment_signed` for the message), the payer cannot ignore the issue. It may be fulfilled or failed, but in the worst case the payer must wait until the `cltv_expiry`. That is not realistic for UX.
There are obvious problems with retrying the payment by different routes using the same invoice. After a successful retry, if the previous stuck payment starts moving again and also succeeds, the payer will pay twice for the same invoice. The payer cannot obtain the information to prove he has paid twice (he has only a single preimage). Although the payee may fail the second arrival payment for the same invoice, that is a *trusted* operation dependent upon the final node implementation. Also, if an `update_fulfill_htlc` gets stuck on the return, there is no solution.
If the payer receives another invoice from the payee and pays again, and if the two payments are succeed, the payer must obtain a refund from the payee for the extra payment. This requires additional *trusted* operations dependent on the application or the service operator.
Key Provided by Payer
===============================
As I previously mentioned, if an `update_add_htlc` gets stuck, the payer cannot ignore that. Because the payee has the key (preimage) to unlock the HTLCs in BOLT 1.x, the HTLCs may be fulfilled in unintended timing for the payer.
What happens if the payer provides the key? For example, in the original AMP [2], the payer provides the preimage (this proposal may be useful for AMP, but in this example it is not meaningful to be *multi-path*, so please imagine a simple *single-path*). The preimage is sent in the onion of the `update_add_htlc`s. In other words, the HTLCs (locks) and the preimage (key) are sent together.
A --> B --> C --> D # update_add_htlc, preimage
A <-- B <-- C <-- D # update_fulfill_htlc
I would like to separate the process into two phases; "add HTLCs (locks)" and "provide a preimage (key)". After adding HTLCs along the route by `update_add_htlc`s not including the preimage, the payee returns the ACK to the payer. The payer will provide the preimage to the payee in the next phase. In this way, the payer simply forgets the payment if an `update_add_htlc` gets stuck and the ACK is not returned in a more realistic timeout (e.g. 1 min) than the `cltv_expiry`, and can retry the payment with another invoice without worrying about overpayment.
A --> B --> C --> D # update_add_htlc
A <-- B <-- C <-- D # ACK
A --> B --> C --> D # preimage
A <-- B <-- C <-- D # update_fulfill_htlc
However, this procedure does not yet solve the problem if `update_fulfill_htlc`s gets stuck.
Proof of Payment
===============================
If the payer provided the preimage, the payer cannot get the proof of payment (PoP).
PoP is important. It's important to bring it to the court, but it's also necessary if upper layer applications are willing to proceed to the next action based on the payment outcome. However, if we do not need to maintain compatibility with BOLT 1.x, it is possible to add PoP to the above case (HTLCs need two keys from both the payee and the payer, not only one key (preimage) from the payee).
I have another consideration regarding PoP. In BOLT1.x, a preimage is returned along the route. The payer receives the PoP when he receives the preimage by the `update_fulfill_htlc` directly from the peer. Thus, if an `update_fulfill_htlc`s gets stuck somewhere in the route, the payer cannot obtain the PoP.
A --> B --> C --> D # update_add_htlc
A B x-- C <-- D # update_fulfill_htlc (stuck)
However, the payee can provide the preimage to the payer earlier. If the `update_add_htlc` is irrevocably committed at the payee's own channel and there is no problem with the parameters, it is safe to send the preimage to the payer skipping the intermediate nodes or using an alternate route (if possible).
A --> B --> C --> D # update_add_htlc
A <----------------- D # preimage
A B x-- C <-- D # update_fulfill_htlc (stuck)
e.g. Modifications of “Multi-Hop Locks from Scriptless Scripts”
===============================
Based on the above considerations, I will describe the stuckless payment protocol. I will do the work from "Multi-Hop Locks from Scriptless Scripts".
Multi-Hop Locks from Scriptless Scripts
https://github.com/apoelstra/scriptless-scripts/blob/master/md/multi-hop-locks.md
(commit 94a4e2f961c839bd1b9ca8773abadbf0f198c34b)
I will modify the following sequence.
https://raw.githubusercontent.com/apoelstra/scriptless-scripts/master/md/images/multi-hop-locks.png
The modifications are as follows.
Setup: At the end of this phase, Do NOT send the key (`y0+y1+y2`) from A to D yet.
Update: At the end of this phase, D returns the ACK to A.
A <-- B <-- C <-- D # ACK
Pre-Settlement: Add this new phase after the Update phase. Any route can be used.
A --> * --> * --> D # key (`y0+y1+y2`)
A <-- * <-- * <-- D # PoP (`z`)
Settlement: No change.
Let's look at the details.
In the original sequence, *the payer* provides the key (`y0+y1+y2`) to unlock the HTLCs (like the original AMP). The sequence has also introduced the PoP (`z`) provided by *the payee*, which already meets, to some extent, the requirements of what I will describe.
Setup:
In the original sequence, the resistance to stuck payments is the same as in the BOLT 1.x. All we need to do is to separate the process sending the key (`y0+y1+y2`) from the Setup phase and bring it after the Update phase. This prevents the payee from immediately moving to the Settlement phase after the Update phase is complete. Therefore, if a stuck payment in the Update phase suddenly begins moving, the phase cannot automatically move to the Settlement phase against the will of the payer.
Update:
At the end of this phase, we require the payee return the ACK to the payer to notify the completion of this phase. It must be guaranteed that the payee himself returns it. This can be achieved by reversing the route and wrapping the ACK in the onion sequentially, as the `reason` field of the `update_fail_htlc` in BOLT 1.x.
If the payment gets stuck in this phase, the payer can create a new key and reuse the PoP (`z`) to start over from the Setup phase. Since the key of the previous stuck payment has not been sent to the payee, the stuck HTLCs can be left and they will be removed later.
Pre-Settlement:
The new Pre-Settlement phase is the actual settlement phase between the payer and the payee. When the payer receives the ACK at the end of the Update phase, he can send the key to the payee. Since this phase is just passing data between two points (unlike adding HTLCs), if it fails we can safely retry and (if possible) not have to use the same route or routing protocol as the Update phase.
After the payee receives and verifies the key from the payer, he can send the PoP (`z`) to the payer as the response. The payee can do this before the Settlement phase if he can verify that the received key is for his own incoming HTLC.
Settlement:
The Settlement phase is the same as that of the original sequence. Even if a message get stucks in this phase, the payment itself is not affected since the settlement between the payer and the payee has already been substantially completed in the Pre-Settlement phase.
These modifications add the cost of three new messages (ACK, key, PoP), but it is only three (unaccompanied by other messages). These may also reduce other preventive messages.
Conclusion
===============================
In this proposal, the probability that messages in each phase get stuck is at the same level as BOLT 1.x, but even if they get stuck, it is possible to safely retry each phase that composes one payment, and the number of payments completely stuck will be reduced.
In fact, the stuck problem will be limited to the Pre-Settlement phase between the two parties (the payer and the payee). This is the case where the payer sends the key to the payee, but the PoP (`z`) is not returned. I have already mentioned that the payer can safely retry this phase and does not have to use the same route or routing protocol as the Update phase.
Any remaining problems would be caused by the payee's own trouble or malice, which means that no intermediate node is involved in the stuck problem, and this problem becomes one involves only the parties (the payer and the payee). This improvement allows us to see the Lightning Network as more trustless.
Hiroki Gondo
[1] https://github.com/lightningnetwork/lightning-rfc/pull/508
Good morning Hiroki,
Thank you for this. It seems a good solution. And, it seems, yet another reason to move to payment point / scalar from payment hash / preimage.
As I understand it, the `y0+y1+...` sums are also the blinding tweaks used for payment decorrelation. My understanding, they will be sent in onion packet.
Quoted text (5 lines)
> Pre-Settlement: Add this new phase after the Update phase. Any route can be used. > > A --> * --> * --> D # key (`y0+y1+y2`) > > A <-- * <-- * <-- D # PoP (`z`)
My poor suggestion, to use same route ->B->C-> and <-B<-C<-. Currently, destination D does not know who is payer A. So my opinion, it is best to retain this property of "D does not know payer A".
Of course, in practice in many case, D knows A already, for example for delivery address of product. But anonymity should be preserved still. For example, perhaps I wish to deliver product to some other entity other than me, and wish to remain anonymous to do so.
However, I seem, the detail below, means we should use the same route:
Quoted text (2 lines)
> At the end of this phase, we require the payee return the ACK to the payer to notify the completion of this phase. It must be guaranteed that the payee himself returns it. This can be achieved by reversing the route and wrapping the ACK in the onion sequentially, as the `reason` field of the `update_fail_htlc` in BOLT 1.x. > These modifications add the cost of three new messages (ACK, key, PoP), but it is only three (unaccompanied by other messages). These may also reduce other preventive messages.
The added communication round may allow intermediate node to guess the payer.
Already in current network, intermediate node can guess the distance to payee. Distance to payee can be guessed from timelocks. Also, distance to payee can be guessed by time from `update_add_htlc` to time of `update_fulfill_htlc`/`update_fail_htlc`.
However, there is no information that intermediate node can use to guess distance to payer.
With addition of new ACK-key turnaround, intermediate node can measure time from send of ACK to receive of key, and guess its distance to payer.
I am uncertain how to weigh this. I believe, this idea is very good and stuckless is important feature. Getting some information about the payer may allow attempts at censorship, however. But maybe the information leaked is not significant enough in practice.
Another issue is the added latency of payments. Already, because of cooperative signing by use of MuSig, we know that latency of payment point / scalar is worsened. But use of ACK-key turnaround increases latency further. Of course, we should consider, most of latency is because of retries. With "stuckless" payment, we can (if we have enough money) make multiple tries in parallel. So possibly, this may reduce latency "in the large" at the cost of increasing latency "in the small".
Another thought, is that this may also solve the "American Call Option" problem. In this case, the key at the final step is the sum of the payer key and the exchange key (`y0 + y1 + y2 + z` where payer knows `y0 + y1 + y2` and exchange knows `z`). Then intermediate nodes are unaware that a cross-currency exchange is involved. This thought, I will need to consider further for correctness.
Regards, ZmnSCPxj
This is a very good proposal, thanks Hiroki for all those details it helped me learn a lot.
If I'm not mistaken, https://eprint.iacr.org/2018/472.pdf has shown that we MUST add another round of communication if we want to avoid the wormhole attacks (and thus decorrelate payments). While I agree that this degrades latency, if it provides a way to "cancel" stuck payments and retry I think it's worth it. And I really like the option to make multiple tries in parallel as you suggest, which would help with latency (if you have enough outbound capacity).
I agree with ZmnSCPxj that it would be good to keep payer anonymity, and I may have a solution to provide this. As ZmnSCPxj explains, the loss of payer anonymity is due to the ACK message traveling via the same route (D -> C -> B -> A).
However, there are two interesting things to note about the ACK message (unless I missed something):
1. It doesn't need any data from D 2. It isn't tied to channels and only A needs to receive it (not intermediate nodes) 3. It could use a smaller onion packet than the *add_htlc* onion (fixed size but smaller than 1300 bytes)
Given 1., the ACK onion packet can be constructed by A. Given 2., it can use a different route than the *add_htlc* onion packet.
A can select another route (e.g. D -> E -> F -> A) and can create the ACK onion packet during the setup phase. A can then embed this ACK packet inside the last hop payload of the *add_htlc* onion packet. When D receives it, it simply sends that onion to the indicated recipient (E) which will unwrap and forward. This way D doesn't learn anything about A, and intermediate nodes aren't included in the ACK route so they don't learn anything either.
Note that nodes in the ACK message route don't have an incentive to forward ACK messages (apart from participating honestly in the network). But even if a malicious node drops an ACK message, it just ends up being a stuck payment that you can safely retry since you haven't shared the keys yet.
And if A doesn't care about anonymity at all, A can provide its information in the onion to let D directly send it the ACK. I don't know if we want to provide that option or not, but at least that's possible to do.
Would that be a satisfactory solution to maintain the payer anonymity property?
Cheers, Bastien
Le mar. 25 juin 2019 à 12:16, ZmnSCPxj via Lightning-dev < lightning-dev at lists.linuxfoundation.org> a écrit :
Quoted text (91 lines)
> Good morning Hiroki, > > Thank you for this. > It seems a good solution. > And, it seems, yet another reason to move to payment point / scalar from > payment hash / preimage. > > As I understand it, the `y0+y1+...` sums are also the blinding tweaks used > for payment decorrelation. > My understanding, they will be sent in onion packet. > > > Pre-Settlement: Add this new phase after the Update phase. Any route can > be used. > > > > A --> * --> * --> D # key (`y0+y1+y2`) > > > > A <-- * <-- * <-- D # PoP (`z`) > > My poor suggestion, to use same route ->B->C-> and <-B<-C<-. > Currently, destination D does not know who is payer A. > So my opinion, it is best to retain this property of "D does not know > payer A". > > Of course, in practice in many case, D knows A already, for example for > delivery address of product. > But anonymity should be preserved still. > For example, perhaps I wish to deliver product to some other entity other > than me, and wish to remain anonymous to do so. > > However, I seem, the detail below, means we should use the same route: > > > At the end of this phase, we require the payee return the ACK to the > payer to notify the completion of this phase. It must be guaranteed that > the payee himself returns it. This can be achieved by reversing the route > and wrapping the ACK in the onion sequentially, as the `reason` field of > the `update_fail_htlc` in BOLT 1.x. > > > > > These modifications add the cost of three new messages (ACK, key, PoP), > but it is only three (unaccompanied by other messages). These may also > reduce other preventive messages. > > The added communication round may allow intermediate node to guess the > payer. > > Already in current network, intermediate node can guess the distance to > payee. > Distance to payee can be guessed from timelocks. > Also, distance to payee can be guessed by time from `update_add_htlc` to > time of `update_fulfill_htlc`/`update_fail_htlc`. > > However, there is no information that intermediate node can use to guess > distance to payer. > > With addition of new ACK-key turnaround, intermediate node can measure > time from send of ACK to receive of key, and guess its distance to payer. > > I am uncertain how to weigh this. > I believe, this idea is very good and stuckless is important feature. > Getting some information about the payer may allow attempts at censorship, > however. > But maybe the information leaked is not significant enough in practice. > > Another issue is the added latency of payments. > Already, because of cooperative signing by use of MuSig, we know that > latency of payment point / scalar is worsened. > But use of ACK-key turnaround increases latency further. > Of course, we should consider, most of latency is because of retries. > With "stuckless" payment, we can (if we have enough money) make multiple > tries in parallel. > So possibly, this may reduce latency "in the large" at the cost of > increasing latency "in the small". > > Another thought, is that this may also solve the "American Call Option" > problem. > In this case, the key at the final step is the sum of the payer key and > the exchange key (`y0 + y1 + y2 + z` where payer knows `y0 + y1 + y2` and > exchange knows `z`). > Then intermediate nodes are unaware that a cross-currency exchange is > involved. > This thought, I will need to consider further for correctness. > > > Regards, > ZmnSCPxj > _______________________________________________ > Lightning-dev mailing list > Lightning-dev at lists.linuxfoundation.org > https://www.learnbitcoin.com/archive/lists/lightning-dev >
Good morning list,
Quoted text (4 lines)
> Another thought, is that this may also solve the "American Call Option" problem. > In this case, the key at the final step is the sum of the payer key and the exchange key (`y0 + y1 + y2 + z` where payer knows `y0 + y1 + y2` and exchange knows `z`). > Then intermediate nodes are unaware that a cross-currency exchange is involved. > This thought, I will need to consider further for correctness.
I apologize for the noise, but after some thought, the free-premium American Call Option problem does not get helped by stuckless payments, at least by itself. The general solution is for the exchange to require that it get paid the premium immediately, with the premium encumbered only by the exchange.
Below is a basic sketch.
* Payer requests the exchange for a public key `Z` such that `Z = z * G` where `z` is known only by the exchange.
This should be done anonymously over Tor.
* Payer routes a payment via the exchange.
* Payer provides a proof (somehow) to the exchange that the payee has to claim `P + Z + (y0 + y1 + y2) * G`, where payee knows `p` such that `P = p * G`, payer knows `(y0 + y1 + y2)`.
* Invoice payment points must include a proof-of-knowledge (i.e. a signature using `P` must be included in the invoice, not just a payee signature attesting to the invoice details --- we do not want to give the invoice details and the payee pubkey to the exchange, lest it censor).
* Payer can provide a signature with `(y0 + y1 + y2) * G`.
* As signatures are involved, should we worry about key cancellation attacks on `Z`?
I am not a mathematician.
* Exchange should be able to identify the `Z` it released.
* Exchange validates, then performs the exchange.
* Payee sends `ACK` message.
* Payer pays the premium to the exchange, using `Z` as the payee key.
It can use stuckless protocol (or not).
* Exchange claims the premium, making the American Call Option have a premium and thus rational for the exchange to accept.
Payee learns `z`.
* Payer can now provide `key` message to payee, containing `(y0 + y1 + y2) + z`.
In effect, the proof-of-payment-of-premium is enough to let the exchange issue an American Call Option.
Payer and payee can still lock the exchange funds by not paying the option premium, but it is not an "option" since the payee cannot cause the cross-currency swap to push through without the exchange getting paid the premium. The exchange can force a timeout on the premium payment `Z`, such that if it is not paid, the exchange will permanently delete `z`. Alternately (and maybe better...) the exchange can force that the premium is paid *before* it performs the swap and propagates the payment onward.
(a detail, but I suspect the payer can also send a `cancel` message instead of `key` in response to `ACK`, for example if multiple parallel attempts are made and one of the other attempts has already completed; in which case if the exchange times out, an honest payee can just send thsi `cancel` message)
Regards, ZmnSCPxj
Hi ZmnSCPxj and Bastien,
When I was putting together this proposal, I thought it would be difficult for me to consider all the security and privacy issues. I am very glad that you raised the possible issues.
Quoted text (2 lines)
> So my opinion, it is best to retain this property of "D does not know payer A".
I agree with your opinion too. I thought there was no problem if the ACK and the PoP were responses of the HTLCs and the key respectively. But,
Quoted text (4 lines)
> The added communication round may allow intermediate node to guess the payer. > With addition of new ACK-key turnaround, intermediate node can measure time from send of ACK to receive of key, and guess its distance to payer.
Right.
Quoted text (9 lines)
> A can select another route (e.g. D -> E -> F -> A) and can create the ACK > onion packet during the setup phase. > A can then embed this ACK packet inside the last hop payload of the > *add_htlc* onion packet. > When D receives it, it simply sends that onion to the indicated recipient > (E) which will unwrap and forward. > This way D doesn't learn anything about A, and intermediate nodes aren't > included in the ACK route so > they don't learn anything either.
I think this is likely to be an improvement. This could also be generalized as a case where a packet we send goes back to us via a given node. I need to understand more precisely the limitations of the onion packet including new specs under development. In the process, I will also consider combination of this proposal with AMP and new routing algorithms (Trampoline, Rendezvous).
Regards, Hiroki
Hi all,
I explained Stuckless Payments on the basis of PTLCs before and some people understood that this is a proposal that can be accomplished after PTLCs are introduced. But this can also be accomplished using HTLC variants that are not compatible with BOLT 1.x HTLCs. For simplicity, I'd like to describe them in Miniscript policies (http://bitcoin.sipa.be/miniscript/).
# The BOLT #3 offered HTLC policy or(pk(key_revocation),and(pk(key_remote),or(pk(key_local),hash160(H)))) -> or(pk(key_revocation),and(pk(key_remote),or(pk(key_local),and(hash160(H),hash160(H)))))
# The BOLT #3 received HTLC policy or(pk(key_revocation),and(pk(key_remote),or(and(pk(key_local),hash160(H)),older(1008)))) -> or(pk(key_revocation),and(pk(key_remote),or(and(pk(key_local),and(hash160(H),hash160(H))),older(1008))))
In both cases, I just changed `hash160(H)` to `and(hash160(H), hash160(H))`. The notation seems to refer to the same `H`, but these are different. One is provided by payer and the other is provided by payee. So we don't necessarily have to wait for PTLCs.
Regards, Hiroki
2019年6月27日(木) 18:45 Hiroki Gondo <hiroki.gondo at nayuta.co>:
Quoted text (41 lines)
> Hi ZmnSCPxj and Bastien, > > When I was putting together this proposal, I thought it would be difficult > for me to consider all the security and privacy issues. I am very glad that > you raised the possible issues. > > > So my opinion, it is best to retain this property of "D does not know > payer A". > > I agree with your opinion too. I thought there was no problem if the ACK > and the PoP were responses of the HTLCs and the key respectively. But, > > > The added communication round may allow intermediate node to guess the > payer. > > > With addition of new ACK-key turnaround, intermediate node can measure > time from send of ACK to receive of key, and guess its distance to payer. > > Right. > > > A can select another route (e.g. D -> E -> F -> A) and can create the ACK > > onion packet during the setup phase. > > A can then embed this ACK packet inside the last hop payload of the > > *add_htlc* onion packet. > > When D receives it, it simply sends that onion to the indicated recipient > > (E) which will unwrap and forward. > > This way D doesn't learn anything about A, and intermediate nodes aren't > > included in the ACK route so > > they don't learn anything either. > > I think this is likely to be an improvement. This could also be > generalized as a case where a packet we send goes back to us via a given > node. I need to understand more precisely the limitations of the onion > packet including new specs under development. In the process, I will also > consider combination of this proposal with AMP and new routing algorithms > (Trampoline, Rendezvous). > > Regards, > Hiroki > >
Ohayou Hiroki-san,
I agree this possibility.
Of note is that this also helps support:
1. Cross-currency swaps without premium-free American Call Option. Exchanges will demand for a premium to be paid for revelation of the second preimage. 2. Non-custodial Escrow. The second preimage is shared between the escrow and the payer.
Both will also just as well be served by using points.
Regards, ZmnSCPxj
Quoted text (48 lines)
> > I explained Stuckless Payments on the basis of PTLCs before and some people understood that this is a proposal that can be accomplished after PTLCs are introduced. But this can also be accomplished using HTLC variants that are not compatible with BOLT 1.x HTLCs. For simplicity, I'd like to describe them in Miniscript policies (http://bitcoin.sipa.be/miniscript/). > > # The BOLT #3 offered HTLC policy > or(pk(key_revocation),and(pk(key_remote),or(pk(key_local),hash160(H)))) > -> > or(pk(key_revocation),and(pk(key_remote),or(pk(key_local),and(hash160(H),hash160(H))))) > > # The BOLT #3 received HTLC policy > or(pk(key_revocation),and(pk(key_remote),or(and(pk(key_local),hash160(H)),older(1008)))) > -> > or(pk(key_revocation),and(pk(key_remote),or(and(pk(key_local),and(hash160(H),hash160(H))),older(1008)))) > > In both cases, I just changed `hash160(H)` to `and(hash160(H), hash160(H))`. The notation seems to refer to the same `H`, but these are different. One is provided by payer and the other is provided by payee. So we don't necessarily have to wait for PTLCs. > > Regards, > Hiroki > > 2019年6月27日(木) 18:45 Hiroki Gondo <hiroki.gondo at nayuta.co>: > > > Hi ZmnSCPxj and Bastien, > > > > When I was putting together this proposal, I thought it would be difficult for me to consider all the security and privacy issues. I am very glad that you raised the possible issues. > > > > > So my opinion, it is best to retain this property of "D does not know payer A". > > > > I agree with your opinion too. I thought there was no problem if the ACK and the PoP were responses of the HTLCs and the key respectively. But, > > > > > The added communication round may allow intermediate node to guess the payer. > > > > > With addition of new ACK-key turnaround, intermediate node can measure time from send of ACK to receive of key, and guess its distance to payer. > > > > Right. > > > > > A can select another route (e.g. D -> E -> F -> A) and can create the ACK > > > onion packet during the setup phase. > > > A can then embed this ACK packet inside the last hop payload of the > > > *add_htlc* onion packet. > > > When D receives it, it simply sends that onion to the indicated recipient > > > (E) which will unwrap and forward. > > > This way D doesn't learn anything about A, and intermediate nodes aren't > > > included in the ACK route so > > > they don't learn anything either. > > > > I think this is likely to be an improvement. This could also be generalized as a case where a packet we send goes back to us via a given node. I need to understand more precisely the limitations of the onion packet including new specs under development. In the process, I will also consider combination of this proposal with AMP and new routing algorithms (Trampoline, Rendezvous). > > > > Regards, > > Hiroki