Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extend multi-hop-locks with sender-controlled tweak? #12

Closed
t-bast opened this issue Oct 21, 2019 · 2 comments · Fixed by #19
Closed

Extend multi-hop-locks with sender-controlled tweak? #12

t-bast opened this issue Oct 21, 2019 · 2 comments · Fixed by #19

Comments

@t-bast
Copy link
Contributor

t-bast commented Oct 21, 2019

There was discussion about stuckless (cancellable) payments in Lightning recently (https://lists.linuxfoundation.org/pipermail/lightning-dev/2019-June/002029.html).
The high-level idea is that we add a second hash/preimage to the HTLC script that prevents the receiver from fulfilling the HTLC (the sender has one preimage and the receiver has the other). When the receiver receives the HTLC he communicates out-of-band (to be spec-ed) with the sender to receive the sender preimage and fulfill the HTLC. This lets the sender safely send the payment via redundant paths (for better latency and improved success rate) and then cancel redundant payments (by not releasing the sender-side preimage).

It seems to me that this mechanism is also possible with scriptless scripts multi-hop locks by letting the sender add another tweak and only reveal it once the receiver acks reception of the HTLC. @jonasnick does that sounds correct or am I missing something? I can try making a PR to add this useful feature if you want.

@jonasnick
Copy link
Collaborator

Sorry for the late reply ... post conference madness. I had missed the stuckless payment proposal and I think it would be very useful to add it here. The writeup is excellent by the way.

The high-level idea is that we add a second hash/preimage to the HTLC script that prevents the receiver from fulfilling the HTLC

This doesn't look to be the case according to the referenced proposal which delays sending y0+y1+y2 to the receiver. Anyway, adding another tweak and reveal it later is possible (that was in fact what was proposed by @cfromknecht at the first Lightning Hackday whose presentation originally got me interested in scriptless script Lightning - though I don't remember what the reasoning was back then).

I can try making a PR to add this useful feature if you want.

That would be awesome. Perhaps this should be an additional section to not complicate the original ideas? Also we should definitely add the post to the resources section.

@t-bast
Copy link
Contributor Author

t-bast commented Nov 8, 2019

Great, I'm adding that to my todo-list (sorry for the late reply, just came back from post-conference vacation).
I'll be quite busy the next couple of weeks but I'll eventually find time to do that ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants