get10101 / 10101

10101 (Ten-Ten-One): Self-custodial derivative trading at your fingertips.
https://10101.finance
MIT License
124 stars 21 forks source link

Pay a Lightning invoice with the app #2616

Open luckysori opened 4 weeks ago

luckysori commented 4 weeks ago

MVP

In this first version, the app would trust the coordinator to make the payment.

Requirements:

Flow:

  1. User inputs Lightning invoice.
  2. [Optional] Coordinator verifies that payment can be made on Lightning (by sending a probe?).
  3. Update DLC channel.
  4. Coordinator pays invoice.

Point number 2 is important for this to be as close to atomic as possible (without actually being atomic yet).

With an open position

It's easier to do this with an open position, because you can just resize the user position to reduce their margin, sending their margin to the coordinator reserve.

Since the feature we are ultimately targeting is paying using USDp, it makes sense to limit this feature to short positions with leverage 1.

Without a position

It would still be nice to pay without a position, but this would require changes to rust-dlc. I would recommend to not tackle this now.