lightningdevkit / ldk-node

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

Resolve return behavior for BOLT12 Offers #321

Open slanesuke opened 2 months ago

slanesuke commented 2 months ago

While adding BIP21 URI support to ldk-node, I've faced some complexities when URIs include an offer in the lightning parameter.

During testing, I attempted to send a payment with an amount larger than what's available on the channel. Ideally, the lightning parameter with an offer or invoice should fail and move on to the on-chain payment.

When paying a BOLT11 invoice, the PaymentId is returned only if the payment is successful making it easy to handle and move on. However, with BOLT12, sending a payment returns a PaymentId whether the payment is successful or not. We should resolve the difference in behavior between BOLT11 and BOLT12.

When given an offer in the lightning parameter, it would be nice to handle whether the payment was a success or failure before moving on to the next payment option.

slanesuke commented 1 month ago

Manually handling an invoice request/invoice using an event has been added to LDK: https://github.com/lightningdevkit/rust-lightning/pull/3078. After the next LDK upgrade I think we could take care of this