Giter Club home page Giter Club logo

lspd's Introduction

lspd simple server

lspd is a simple deamon that provides LSP services to Breez clients.

This is a simple example of an lspd that works with an lnd node.

Installation

  1. git clone https://github.com/breez/lspd (or fork)
  2. Compile lspd using go build .
  3. Create a random token (for instance using the command openssl rand -base64 48)
  4. Define the environment variables as described in sample.env. If CERTMAGIC_DOMAIN is defined, certificate for this domain is automatically obtained and renewed from Let's Encrypt. In this case, the port needs to be 443. If CERTMAGIC_DOMAIN is not defined, lspd needs to run behind a reverse proxy like treafik or nginx.
  5. Run lspd
  6. Share with Breez the TOKEN and the LISTEN_ADDRESS you've defined (send to [email protected])

Implement your own lspd

You can create your own lsdp by implementing the grpc methods described here.

Use a smaller channel reserve

You can apply the PR from lightningnetwork/lnd#2708 to be able to create channels with a channel reserve smaller than 1% of the channel capacity. Then add the field RemoteChanReserveSat in the lnrpc.OpenChannelRequest struct when opening a channel.

In order to be able to let clients have a zero channel reserve, you can apply the commit from https://github.com/breez/lnd/commit/03a7a0b6b4c8fa92ad94e9f449135e0738702643

Flow for creating channels

When Alice wants Bob to pay her an amount and Alice doesn't have a channel with sufficient capacity, she calls the lspd function RegisterPayment() and sending the paymentHash, paymentSecret (for mpp payments), destination (Alice pubkey), and two amounts. The first amount (incoming from the lsp point of view) is the amount BOB will pay. The second amount (outgoing from the lsp point of view) is the amount Alice will receive. The difference between these two amounts is the fees for the lsp. In order to open the channel on the fly, the lsp is connecting to lnd using the interceptor api.

Probing support

The lsp supports probing non-mpp payments if the payment hash for probing is sha256('probing-01:' || payment_hash) when payment_hash is the hash of the real payment.

lspd's People

Contributors

kingonly avatar nayuta-ueno avatar yaslama 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.