Xud: Support c-lightning as swap client

Created on 9 Oct 2019  Â·  5Comments  Â·  Source: ExchangeUnion/xud

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 https://github.com/ElementsProject/lightning/pull/2540. Opened a separate issue for c-lightning swap hold-invoice plugin: https://github.com/lightningd/plugins/issues/98
  3. make an experimental ltc/btc or even btc/btc swap work (with lnd)

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

P2 hackathon 牛逼 feat

Most helpful comment

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

All 5 comments

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

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

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 (https://github.com/ExchangeUnion/xud/issues/1281) and a hold invoice plugin tight to our use case (https://github.com/lightningd/plugins/issues/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

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? https://github.com/ElementsProject/lightning/commit/1a8978100efd55a8878cf6e79a3eb40c980c9c8d#diff-a59e947277b5a6f8696529091c84a49882df40952df323db08e34f11c181bf9d

Also curious of there is/was ny actual WIP on https://github.com/lightningd/plugins/issues/98 that one could pick up on?

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

Was this page helpful?
0 / 5 - 0 ratings

Related issues

kilrau picture kilrau  Â·  4Comments

kilrau picture kilrau  Â·  6Comments

kilrau picture kilrau  Â·  7Comments

kilrau picture kilrau  Â·  3Comments

kilrau picture kilrau  Â·  6Comments