c-lightning-plugin-collection icon indicating copy to clipboard operation
c-lightning-plugin-collection copied to clipboard

Plugin request: a 'pay' command that acknowledges internal invoices

Open fiatjaf opened this issue 6 years ago • 5 comments

I'm just leaving this here so maybe someone will find it and create the plugin later, because I don't want to.

Say you generate an invoice, then you later try to pay that invoice on the same node. This pay command should succeed with zero fees and that's it.

This is useful for services that hold other people's money and allow then to generate invoices and pay invoices, so they them can pay each other in the same service without requiring complicated code.

fiatjaf avatar Jan 28 '19 11:01 fiatjaf

I don't think you can pay your own invoice in c-lightning, at least not currently.

billygarrison avatar Feb 04 '19 23:02 billygarrison

That's what the plugin would do: just exclude the invoice and reply with a success message to the pay command.

fiatjaf avatar Feb 05 '19 00:02 fiatjaf

Would you want something like:

if senderID == recipientID:
    deleteInvoice
    return "Payment successful."
else:
    pay(bolt11)

billygarrison avatar Feb 05 '19 00:02 billygarrison

Yes.

fiatjaf avatar Feb 05 '19 01:02 fiatjaf

I crated some code for my custodial wallet experiments that was able to pay onself. Can be combined with channel rebalancing

renepickhardt avatar Mar 06 '19 16:03 renepickhardt