Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support c-lightning as swap client #2

Open
BitcoinOG opened this issue Feb 9, 2021 · 0 comments
Open

Support c-lightning as swap client #2

BitcoinOG opened this issue Feb 9, 2021 · 0 comments
Assignees
Labels
enhancement New feature or request P3 low priority

Comments

@BitcoinOG
Copy link
Contributor

Transferred from ExchangeUnion/xud#1281

Code base: https://github.com/ElementsProject/lightning
Docs: https://lightning.readthedocs.io/

Todo:

  1. implement ClightningClient as SwapClient
  2. there is no suitable hold invoice plugin to directly support our use case, but hold invoices are implemented by e.g. https://github.com/lightningd/plugins/blob/ea8e24eb5643db5c2693f4d24cb304a009533492/jitrebalance/jitrebalance.py & https://github.com/lightningd/plugins/blob/3290e4e45695393430dd9efe9ee767fa9f38e004/noise/noise.py (thanks @cdecker). Hold invoice hook is implemented since invoice hook ElementsProject/lightning#2540.
  3. make an experimental btc/btc swap work with lnd or l-btc/btc swap using both on both ends

Notes:
Two ways to enforce the payment locktimes in c-lightning:

  1. getroute + sendpay, basically the sendtoroute of lnd which we used before
  2. encode the last hop cltv into the invoice which is generated by our hold invoice plugin

There doesn't seem to be a good way to set a cltv with the regular pay call (https://lightning.readthedocs.io/lightning-pay.7.html) according to docs & @cdecker

Ignore for now: L-BTC/Liquid support, backups etc

@BitcoinOG BitcoinOG added the enhancement New feature or request label Feb 9, 2021
@BitcoinOG BitcoinOG self-assigned this Feb 9, 2021
@BitcoinOG BitcoinOG added the P3 low priority label Mar 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request P3 low priority
Projects
None yet
Development

No branches or pull requests

1 participant