ZmnSCPxj [ARCHIVE] on Nostr: ð
Original date posted:2021-09-21 ð Original message: Good morning Joost, > > > ...
ð
Original date posted:2021-09-21
ð Original message:
Good morning Joost,
> > > preimage = H(node_secret | payment_secret | payment_amount | encoded_order_details)
> > > invoice_hash = H(preimage)
> > >
> > > The sender sends an htlc locked to invoice_hash for payment_amount and passes along payment_secret and encoded_order_details in a custom tlv record.
> > >
> > > When the recipient receives the htlc, they reconstruct the preimage according to the formula above. At this point, all data is available to do so. When H(preimage) indeed matches the htlc hash, they can settle the payment knowing that this is an order that they committed to earlier. Settling could be implemented as a just-in-time inserted invoice to keep the diff small.
> > >
> > > The preimage is returned to the sender and serves as a proof of payment.
> >
> > Does this actually work?
> > How does the sender know the `invoice_hash` to lock the HTLC(s) to?
>
> > If the sender does not know the `node_secret` (from its name, I am guessing it is a secret known only by the recipient?) then it cannot compute `invoice_hash`, the `invoice_hash` has to be somehow learned by the sender from the recipient.
>
> So to be clear: this isn't a spontaneous payment protocol with proof-of-payment. The sender will still request an invoice from the recipient via an ordinary http request (think of a paywall with qr invoice that is presented when web-browsing to a paid article). That is also how the sender learns the invoice_hash. It is part of the bolt11 payment request as it always is.
>
> The goal of the scheme is to alleviate the recipient from storing the invoices that they generate.
Ah, thanks for the clarification.
This should probably work, then.
Regards,
ZmnSCPxj
Published at
2023-06-09 13:03:48Event JSON
{
"id": "5b952842f1df534b0733f960041652cd289732d2f06d9d4d24c3b8c229f2acf1",
"pubkey": "4505072744a9d3e490af9262bfe38e6ee5338a77177b565b6b37730b63a7b861",
"created_at": 1686315828,
"kind": 1,
"tags": [
[
"e",
"e4e7ab359e7c5557c58c3d4556f5e2b70b0dd56c221200159af6ed9115c412d1",
"",
"root"
],
[
"e",
"6c619088e8ccdc849d5f8a6614326bb15a08d8985ec5acce7633d09a75850034",
"",
"reply"
],
[
"p",
"ec3fb08b335b94aace30d13181f2ad0280df9bc34f1a99832c4e2da8fb125eb3"
]
],
"content": "ð
Original date posted:2021-09-21\nð Original message:\nGood morning Joost,\n\n\u003e \u003e \u003e preimage = H(node_secret | payment_secret | payment_amount | encoded_order_details)\n\u003e \u003e \u003e invoice_hash = H(preimage)\n\u003e \u003e \u003e\n\u003e \u003e \u003e The sender sends an htlc locked to invoice_hash for payment_amount and passes along payment_secret and encoded_order_details in a custom tlv record.\n\u003e \u003e \u003e\n\u003e \u003e \u003e When the recipient receives the htlc, they reconstruct the preimage according to the formula above. At this point, all data is available to do so. When H(preimage) indeed matches the htlc hash, they can settle the payment knowing that this is an order that they committed to earlier. Settling could be implemented as a just-in-time inserted invoice to keep the diff small.\n\u003e \u003e \u003e\n\u003e \u003e \u003e The preimage is returned to the sender and serves as a proof of payment.\n\u003e \u003e\n\u003e \u003e Does this actually work?\n\u003e \u003e How does the sender know the `invoice_hash` to lock the HTLC(s) to?\n\u003e\n\u003e \u003e If the sender does not know the `node_secret` (from its name, I am guessing it is a secret known only by the recipient?) then it cannot compute `invoice_hash`, the `invoice_hash` has to be somehow learned by the sender from the recipient.\n\u003e\n\u003e So to be clear: this isn't a spontaneous payment protocol with proof-of-payment. The sender will still request an invoice from the recipient via an ordinary http request (think of a paywall with qr invoice that is presented when web-browsing to a paid article). That is also how the sender learns the invoice_hash. It is part of the bolt11 payment request as it always is.\n\u003e\n\u003e The goal of the scheme is to alleviate the recipient from storing the invoices that they generate.\n\nAh, thanks for the clarification.\nThis should probably work, then.\n\nRegards,\nZmnSCPxj",
"sig": "f93a6ca04538db61c332bfc396168232088fca87dc719fc0fb27c7ba2b2fd48b114a64234890abafb18e2afe50b0b4ac388d45e260dfa7c337f2493bf4b00ebf"
}