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