Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions 05-onchain.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Copy Markdown
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"?

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

This problem is most easily solved by only accepting preimages from

This comment was marked as abuse.

responses to corresponding outgoing HTLCs.

### Requirements

A local node:
- if it receives (or already possesses) a payment preimage for an unresolved
HTLC output that it has been offered AND for which it has committed to an
outgoing HTLC:
- if it has been offered an unresolved HTLC, AND it has offered a corresponding outgoing HTLC, for which it receives or has already received a payment preimage (by seeing it resolved via an onchain HTLC-success transaction, or via `update_fulfill_htlc`):
- MUST *resolve* the output by spending it, using the HTLC-success
transaction.
- MUST NOT reveal its own preimage when it's not the final recipient.<sup>[Preimage-Extraction](https://lists.linuxfoundation.org/pipermail/lightning-dev/2020-October/002857.html)</sup>
- MUST resolve the output of that HTLC-success transaction.
- otherwise:
- if the *remote node* is NOT irrevocably committed to the HTLC:
Expand Down