<oembed><type>rich</type><version>1.0</version><author_name>npub1aslmpzentw224n3s6yccru4dq2qdlx7rfudfnqevfck637cjt6esswfqmx</author_name><author_url>https://nostr.ae/npub1aslmpzentw224n3s6yccru4dq2qdlx7rfudfnqevfck637cjt6esswfqmx</author_url><provider_name>njump</provider_name><provider_url>https://nostr.ae</provider_url><html>📅 Original date posted:2021-09-21&#xA;📝 Original message:&#xA;&gt;&#xA;&gt; &gt; preimage = H(node_secret | payment_secret | payment_amount |&#xA;&gt; encoded_order_details)&#xA;&gt; &gt; invoice_hash = H(preimage)&#xA;&gt; &gt;&#xA;&gt; &gt; The sender sends an htlc locked to invoice_hash for payment_amount and&#xA;&gt; passes along payment_secret and encoded_order_details in a custom tlv&#xA;&gt; record.&#xA;&gt; &gt;&#xA;&gt; &gt; When the recipient receives the htlc, they reconstruct the preimage&#xA;&gt; according to the formula above. At this point, all data is available to do&#xA;&gt; so. When H(preimage) indeed matches the htlc hash, they can settle the&#xA;&gt; payment knowing that this is an order that they committed to earlier.&#xA;&gt; Settling could be implemented as a just-in-time inserted invoice to keep&#xA;&gt; the diff small.&#xA;&gt; &gt;&#xA;&gt; &gt; The preimage is returned to the sender and serves as a proof of payment.&#xA;&gt;&#xA;&gt; Does this actually work?&#xA;&gt; How does the sender know the `invoice_hash` to lock the HTLC(s) to?&#xA;&#xA;&#xA;&gt; If the sender does not know the `node_secret` (from its name, I am&#xA;&gt; guessing it is a secret known only by the recipient?) then it cannot&#xA;&gt; compute `invoice_hash`, the `invoice_hash` has to be somehow learned by the&#xA;&gt; sender from the recipient.&#xA;&gt;&#xA;&#xA;So to be clear: this isn&#39;t a spontaneous payment protocol with&#xA;proof-of-payment. The sender will still request an invoice from the&#xA;recipient via an ordinary http request (think of a paywall with qr invoice&#xA;that is presented when web-browsing to a paid article). That is also how&#xA;the sender learns the invoice_hash. It is part of the bolt11 payment&#xA;request as it always is.&#xA;&#xA;The goal of the scheme is to alleviate the recipient from storing the&#xA;invoices that they generate.&#xA;&#xA;Joost&#xA;-------------- next part --------------&#xA;An HTML attachment was scrubbed...&#xA;URL: &lt;http://lists.linuxfoundation.org/pipermail/lightning-dev/attachments/20210921/e9fbb17f/attachment.html&gt;</html></oembed>