Hi ZmnSCPxj,

> Just to be clear: each time the vending node needs a new invoice, it
generates a new ephemeral key `k`?

Yes, the vending machine generates a new `k` for every invoice.

The same technique can be used for spontaneous payments as well and in this
case we can also provide additional information to the node about the
payment. For example, let's say I have my digitalocean account with some
user id. If I want to top-up my account with certain amount I could just
generate an invoice myself and pay it, and I could also include my ID (or
login) into the short channel id. The node would see this information and
top-up my account with the money I just sent.

Effectively this routing trick allows including a "payment purpose" by
misusing the short channel id. It is a workaround as it uses the data field
not according to the purpose and has a limit of 8 bytes, so I would prefer
to have some metadata field in the invoice that should be passed to the
payee in the onion packet instead, but this requires changes in the bolt 11
and as far as I understand something like that is already on the roadmap.

Stepan.
_______________________________________________
Lightning-dev mailing list
Lightning-dev@lists.linuxfoundation.org
https://lists.linuxfoundation.org/mailman/listinfo/lightning-dev

Reply via email to