lightningdevkit / ldk-node

A ready-to-go node implementation built using LDK.
Other
139 stars 71 forks source link

Make invoice storage optional #51

Open TheBlueMatt opened 1 year ago

TheBlueMatt commented 1 year ago

For someone implementing eg an lnurl server or some other server that generates invoices on demand, storing each invoice generated for receiving payments is potentially a large dos issue. Thus, storage should be optional, though storing them is generally useful to see payment status.

tnull commented 1 year ago

Btw, we're currently not storing the invoices, just tracking payment metadata by payment hash. However, maybe we should consider storing the invoice data for the user, which would allow them to retry failed payments without keeping the invoices around themselves.

TheBlueMatt commented 1 year ago

Right, I suppose should have phrased as inbound payment metadata. Really should have specified that this is all about inbound payments - for outbound payments I don't think it really needs to be optional, and there indeed its probably useful to store the invoices themselves, at least in part because its the other half of the proof of payment.