lightning-kmp icon indicating copy to clipboard operation
lightning-kmp copied to clipboard

Add custom offers

Open thomash-acinq opened this issue 1 year ago • 2 comments

Allow creating more offers with customizable amount and description.

thomash-acinq avatar Jul 04 '24 08:07 thomash-acinq

The catch here is that the invoice is not persisted and would need to be recreated after startup though IIUC.

pm47 avatar Jul 04 '24 09:07 pm47

Correct

thomash-acinq avatar Jul 04 '24 09:07 thomash-acinq

I need this for a feature I'm working on in Phoenix (PR #665)

Here's the use case:

  • A merchant scans a Bolt Card (v2) with Phoenix app
  • The card outputs:
    • encrypted data (for card holder's wallet to decrypt)
    • a method to contact the card holder's wallet directly over the lightning network
  • Next the merchant generates a temporary offer (with an amount)
  • And then he sends an onion message to the card holder's wallet (which contains his offer, and the card's encrypted data)

So Peer.createOffer is exactly what I need. And for my use case, it doesn't matter if the offer is not persisted.

robbiehanson avatar Feb 28 '25 20:02 robbiehanson

Hi @robbiehanson I wrote a PR that should be doing this exactly and also working on persistence in https://github.com/ACINQ/lightning-kmp/pull/743

Let me know if I need to do something on it that it is not right with the work hat you are doing

vincenzopalazzo avatar Mar 02 '25 16:03 vincenzopalazzo

Superseded by https://github.com/ACINQ/lightning-kmp/pull/774

thomash-acinq avatar Apr 03 '25 14:04 thomash-acinq