-
Notifications
You must be signed in to change notification settings - Fork 491
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
BOLT 5: fix up opposing MUST & MUST NOT statements. #848
base: master
Are you sure you want to change the base?
BOLT 5: fix up opposing MUST & MUST NOT statements. #848
Conversation
We can't say "MUST spend via HTLC-success" and "MUST NOT reveal preimage", since the HTLC-success does exactly that! Let's simplify it. If you get the preimage from the outgoing HTLC, you need to spend the incoming. Signed-off-by: Rusty Russell <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
one nit, but looks good.
@@ -305,16 +305,19 @@ There are several possible cases for an offered HTLC: | |||
HTLC. In this case, the recipient must use the preimage, once it receives it | |||
from the outgoing HTLC; otherwise, it will lose funds by sending an outgoing | |||
payment without redeeming the incoming payment. | |||
4. The HTLC is forwarded as above, but the recipient also happens to be the | |||
final destination for the payment. In this case, it knows the preimage but |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This feels awkward - maybe "final destination for the payment, and it knows the preimage bug it has not received the full payment. In this case, it must not reveal it"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for clarifying this, a small nit
final destination for the payment. In this case, it knows the preimage but | ||
as it has not received the full payment, it must not reveal | ||
it.<sup>[Preimage-Extraction](https://lists.linuxfoundation.org/pipermail/lightning-dev/2020-October/002857.html)</sup>. | ||
This problem is most easily solved by only accepting preimages from |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think "accepting" is unclear, if the preimages you're mentioning here are effectively the ones received for outgoing HTLCs, maybe it's better to say "relay preimages from".
Note the current MUST NOT says "its own preimage" to dissociate from relayed preimages, but I concede it's confusing.
4. The HTLC is forwarded as above, but the recipient also happens to be the | ||
final destination for the payment. In this case, it knows the preimage but | ||
as it has not received the full payment, it must not reveal | ||
it.<sup>[Preimage-Extraction](https://lists.linuxfoundation.org/pipermail/lightning-dev/2020-October/002857.html)</sup>. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure what I offer is better, but the current wording is a bit hard to understand (at least for me).
4. The HTLC is forwarded as above, but the recipient also happens to be the | |
final destination for the payment. In this case, it knows the preimage but | |
as it has not received the full payment, it must not reveal | |
it.<sup>[Preimage-Extraction](https://lists.linuxfoundation.org/pipermail/lightning-dev/2020-October/002857.html)</sup>. | |
4. The HTLC is forwarded as above, but the recipient also happens to be the | |
final destination for the payment. In this case, it knows the preimage but | |
until the corresponding outgoing HTLC is settled, it must not reveal | |
it.<sup>[Preimage-Extraction](https://lists.linuxfoundation.org/pipermail/lightning-dev/2020-October/002857.html)</sup>. |
We can't say "MUST spend via HTLC-success" and "MUST NOT reveal preimage",
since the HTLC-success does exactly that!
Let's simplify it. If you get the preimage from the outgoing HTLC,
you need to spend the incoming.
Signed-off-by: Rusty Russell [email protected]
See: dcf6b0f