Giter Club home page Giter Club logo

boltz-extension's Introduction

LNbits Extension for Boltz

Swap IN and OUT of the Lightning Network while remaining in full control of your bitcoin at all times.

Usage

This extension lets you swap in (chain -> lightning), swap out (lightning -> chain) and, in the case of failure, refund your bitcoin. Supported chains are liquid and the bitcoin mainchain.

Swap In (Onchain -> Lightning)

  1. Click on the "Swap (IN)" button to open the following dialog, select a wallet, choose an amount within the min-max range and choose an onchain address for your refund in case the swap fails after you already sent onchain bitcoin.

Create Swap

  1. After you confirmed, the following dialog with a QR code for the onchain transaction, onchain- address and amount, will pop up.

Pay Onchain TX

  1. After you sent the exact amount of onchain bitcoin to this address, Boltz will pay your lightning invoice and the sats will appear in your wallet.

Refund of Swap In (Onchain -> Lightning)

If a Swap In fails, you can refund your bitcoin after the timeout blockheight was reached. A swap can fail because Boltz, for instance, can't find a route to your lightning node or wallet. In case that happens, there is an info icon in the Swap (In) list which opens following dialog:


Refund

When the timeout blockheight was reached you can either press refund and lnbits will do the refunding to the address you specified when creating the swap OR you can download the refund file so you can manually refund your onchain bitcoin to a different address via the boltz.exchange website. If you need help or have questions you can contact us in the LNbits Telegram or the Boltz Team on Discord. In a recent update we added anl automated check; lnbits now checks every 15 minutes if it can refund your failed swap.

Swap Out (Lightning -> Onchain)

  1. Click on the "Swap (OUT)" button to open the following dialog, select a wallet, choose an amount within the min-max range and choose an onchain address to receive your funds on. Instant settlement: means that LNbits will create the onchain claim transaction if it sees Boltz's lockup transaction in the mempool, but it is not confirmed yet. For urgent swaps we advise to leave this enabled.

Reverse Swap

If a Swap Out fails, no further action is required, the lightning payment just "bounces back".

Development

manual testcases for boltz startup checks

A. normal swaps

  1. test: create -> kill -> start -> startup invoice listeners -> pay onchain funds -> should complete
  2. test: create -> kill -> pay onchain funds -> mine block -> start -> startup check -> should complete
  3. test: create -> kill -> mine blocks and hit timeout -> start -> should go timeout/failed
  4. test: create -> kill -> pay to less onchain funds -> mine blocks hit timeout -> start lnbits -> should be refunded

B. reverse swaps

  1. test: create instant -> kill -> boltz does lockup -> not confirmed -> start lnbits -> should claim/complete
  2. test: create -> kill -> boltz does lockup -> not confirmed -> start lnbits -> mine blocks -> should claim/complete
  3. test: create -> kill -> boltz does lockup -> confirmed -> start lnbits -> should claim/complete

boltz-extension's People

Contributors

dni avatar arcbtc avatar kilrau avatar

Stargazers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.