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 #1281

Open
kilrau opened this issue Oct 9, 2019 · 5 comments
Open

Support c-lightning as swap client #1281

kilrau opened this issue Oct 9, 2019 · 5 comments
Assignees
Labels
牛逼 feat hackathon Lightning HackSprint P2 mid priority

Comments

@kilrau
Copy link
Contributor

kilrau commented Oct 9, 2019

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. Opened a separate issue for c-lightning swap hold-invoice plugin: Hold invoice for swaps lightningd/plugins#98
  3. make an experimental ltc/btc or even btc/btc swap work (with lnd)

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

@kilrau kilrau added the P2 mid priority label Oct 9, 2019
@kilrau kilrau assigned ghost Oct 11, 2019
@kilrau kilrau changed the title LND on Liquid Experiment with c-lightning (Reason: Liquid Assets) Oct 31, 2019
@kilrau kilrau changed the title Experiment with c-lightning (Reason: Liquid Assets) Experimental c-lightning integration (Reason: Liquid Assets) Oct 31, 2019
@kilrau kilrau added P3 low priority and removed P2 mid priority labels Jan 15, 2020
@kilrau kilrau changed the title Experimental c-lightning integration (Reason: Liquid Assets) c-lightning as swap client integration (for Liquid Assets) Feb 28, 2020
@kilrau kilrau unassigned ghost Feb 28, 2020
@john-light
Copy link

Noting in case it's helpful that a BTC <> L-BTC swap is interesting to me, even before c-lightning supports Liquid Assets

@kilrau kilrau changed the title c-lightning as swap client integration (for Liquid Assets) c-lightning as swap client Apr 3, 2020
@kilrau kilrau changed the title c-lightning as swap client Support c-lightning as swap client Apr 3, 2020
@kilrau kilrau added hackathon Lightning HackSprint P2 mid priority and removed P3 low priority labels Apr 3, 2020
@kilrau
Copy link
Contributor Author

kilrau commented Apr 3, 2020

We just bumped the prio on this one :) @john-light

@sangaman sangaman self-assigned this Apr 3, 2020
@kilrau
Copy link
Contributor Author

kilrau commented Apr 6, 2020

Not sure if you are following our discussion in https://mm.fulmo.org/fulmo/channels/c-lightning, but looks like we need two things to support c-lightning with xud: c-lightning integration into xud (#1281) and a hold invoice plugin tight to our use case (lightningd/plugins#98)

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

Which one do you think is better? @sangaman @michael1011

@3nprob
Copy link

3nprob commented Feb 7, 2021

Justr curious to hear if there has been any progress here since the last post?

@kilrau While the pay command doesn't take cltv as an input , invoice now does. Would tha tbe sufficient? ElementsProject/lightning@1a89781#diff-a59e947277b5a6f8696529091c84a49882df40952df323db08e34f11c181bf9d

Also curious of there is/was ny actual WIP on lightningd/plugins#98 that one could pick up on?

@BitcoinOG
Copy link

Hi there! Active development moved to https://github.com/opendexnetwork/opendexd now, I already transferred this issue: opendexnetwork/opendexd#2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
牛逼 feat hackathon Lightning HackSprint P2 mid priority
Projects
None yet
Development

No branches or pull requests

5 participants