renepickhardt / c-lightning-plugin-collection

A collection of c-lightning plugins which are ready to use for your lightning network node.
17 stars 5 forks source link

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

Open fiatjaf opened 5 years ago

fiatjaf commented 5 years ago

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.

billygarrison commented 5 years ago

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

fiatjaf commented 5 years ago

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

billygarrison commented 5 years ago

Would you want something like:

if senderID == recipientID:
    deleteInvoice
    return "Payment successful."
else:
    pay(bolt11)
fiatjaf commented 5 years ago

Yes.

renepickhardt commented 5 years ago

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