Skip to content

Support c-lightning as swap client #2

@BitcoinOG

Description

@BitcoinOG

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

Metadata

Metadata

Assignees

Labels

P3low priorityenhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions