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

BOLT 5: fix up opposing MUST & MUST NOT statements. #848

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

rustyrussell
Copy link
Collaborator

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

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]>
Copy link
Collaborator

@TheBlueMatt TheBlueMatt left a 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
Copy link
Collaborator

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"?

Copy link

@ariard ariard left a 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
Copy link

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.

Comment on lines +308 to +311
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>.
Copy link
Collaborator

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).

Suggested change
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>.

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 this pull request may close these issues.

4 participants