Skip to content
This repository was archived by the owner on Aug 31, 2023. It is now read-only.
This repository was archived by the owner on Aug 31, 2023. It is now read-only.

Combine DLCs and Lightning Channels #8

@holzeis

Description

@holzeis

Goal

We want to build a wallet which speaks lightning and is able to do DLCs.

Possible approaches

Virtual channels

Probably the most complex solution is to have 2 virtual channels. One speaking lightning, the other one speaking DLCs.
E.g. something like this:

Diagram
flowchart LR
    A1((Alice))
    B1((Bob))
   

    txf[tx_fund]
    
    txc_outer[tx_commit]
    
    txs[tx_settle]
    
    txcis[tx_commit_itchysats]
    txcln[tx_commit_ln]
    or{or}
    and{and}


    A1 -- fund --> txf
    B1 -- fund --> txf
    txf --> or
    or --> txs
    or --> txc_outer
    txc_outer --> and
    and --> txcis
    and --> txcln
    
    subgraph ItchySats
      txcet_is[tx_cetN]
      txr_is[tx_refund]
      txp_is[tx_punish]
      or_is{or}
      
      txcis --> or_is
      or_is --> txp_is
      or_is --> txcet_is
      or_is --> txr_is
    end
    
    
    subgraph LN
      htlc1((htlc1))
      htlc2((htlc2))
      htlcN((htlcN))
      txp_ln[tx_punish]

      txcln --> txp_ln
      txcln --> htlc1
      txcln --> htlc2
      txcln --> htlcN

    end
Loading

Advantages:

  • we might be able to use ldk, this needs to be evaluated.
  • we might be able to use maia.
  • we should be able to receive standard LN payments from anyone in LN.

Disadvantage:

  • clearly complex
  • channels can only be opened to nodes running the same code because of the custom transaction structure. i.e. you can't open a channel to other LN nodes (LND or CLightning) with this.

Maia speak LN

We could implement the needed bolts into https://github.com/comit-network/maia/

Advantage:

  • full control over the code base. We can decide to only implement what we really need
  • we should be able to receive standard LN payments from anyone in LN.

Disadvantage:

  • complexity
  • only compatible with our own nodes, i.e. you can't open channels to other LN nodes (LND, Clightning) with this.

LN speak DLC

We could add the DLC feature to a lightning implementation (e.g. use LDK and extend it). The it's ok to be odd would allow us to add features to our client without breaking compatibility with other LN implementations.

Advantage:

  • we can open a channel with other LN nodes
  • we speak native lightning out of the box

Disadvantage:

  • Complexity
  • If we build on LDK we probably will need to fork the library to add what we need which could become a nightmare in pulling in upstream changes.

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions