What is Nostr?
Joost Jager [ARCHIVE] /
npub1asl…fqmx
2023-06-09 13:03:49
in reply to nevent1q…m3z5

Joost Jager [ARCHIVE] on Nostr: 📅 Original date posted:2021-09-21 📝 Original message: On Tue, Sep 21, 2021 at ...

📅 Original date posted:2021-09-21
📝 Original message:
On Tue, Sep 21, 2021 at 2:05 PM fiatjaf <fiatjaf at gmail.com> wrote:

> What if instead of the payer generating the preimage the payee could
> generate stateless invoices? Basically just use some secret to compute the
> preimage upon receiving the HTLC, for example:
>

Maybe my explanation wasn't clear enough, but this is exactly what I am
proposing. The payee generates a stateless invoice and gives it to the
payer.


> 1. Payer requests an invoice.
> 2. Payee computes hash = sha256(hmac(local_secret, arbitrary_invoice_id)),
> then encodes arbitrary_invoice_id into the invoice somehow.
> 3. Payer sends payment with arbitrary_invoice_id as tlv_record_a.
> 4. Upon receiving the HTLC, payee computes preimage = hmac(local_secret,
> tlv_record_a) and resolves it.
>

One way to do this that I tried to describe in the initial post is via the
payment_secret. This is already an arbitrary invoice id that is already
sent as a tlv record.


> I've implemented such a scheme on @lntxbot, but it required low level code
> in a c-lightning plugin and a hack with route hints: since TLV payloads
> were not an option (as payers wouldn't know how to send them) I've used a
> "shadow" route hint to a private channel that didn't exist, so preimage was
> generated on the payee using preimage = hmac(local_secret,
> next_channel_scid).
>

Clever workaround.

Joost
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linuxfoundation.org/pipermail/lightning-dev/attachments/20210921/8f1a2a53/attachment.html>;
Author Public Key
npub1aslmpzentw224n3s6yccru4dq2qdlx7rfudfnqevfck637cjt6esswfqmx