Stateless invoices with proof-of-payment



Summary:

Lightning invoices can be generated without needing to keep any state at all, according to a recent proposal. The conventional approach to generating invoices on a node and storing them together with order details in a database results in the need for protection against unbounded generation of payment requests, which can be achieved through rate limiting. Stateless invoices, on the other hand, do not require storage or memory and can be used for an unlimited amount of invoices. However, two problems arise when payment arrives: the recipient does not know whom or what the payment is for and the recipient does not know the preimage that is needed to settle the htlc(s). To solve these issues, additional custom tlv records can be attached to the htlc to specify additional data for that record in a bolt11 invoice, or an existing invoice description field can be used. An alternative solution is to use a deterministic preimage based on a secret, the payment secret, and other relevant properties. This allows the recipient to derive the same preimage twice: once when the lightning invoice is generated and again when a payment arrives.


Updated on: 2023-06-03T05:54:52.373252+00:00