Giter VIP home page Giter VIP logo

zero-conf-lnd's Introduction

Zero Conf LND

This program runs as a daemon and connects to your own LND to accept zero conf channels from configured whitelisted nodes.

Running

Setup

In order for this to work, there's two flags that are needed in LND:

protocol.option-scid-alias=true
protocol.zero-conf=true

After setting this up, this program needs to run in order to accept channels in general (even non-zero-conf channels).

Start Program

To run this program, setup the config file and run with it:

./zero-conf-lnd config.yml

You may take a look at example.config.yml for how to set this up.

Development

First copy the example config and change the values to match your environment:

cp example.config.yml .local.config.yml

Now run with that config path as the first argument:

cargo run .local.config.yml

Dependencies

  • cmake

Zeroconf Probing

The plugin includes the responder side of an ad-hoc protocol based on custommsgs that a funder node can use to ask a fundee node whether or not it will accept zeroconf channels from the funder node.

This ad-hoc protocol is a JSON-RPC 2.0-like request-response protocol on top of custommsgs, whereby all the bytes following the 2-byte type prefix form a valid UTF-8 JSON encoding. Essentially:

message_bytes = <type>.to_bytes(2, 'big') + json.dumps(<payload>).encode('utf-8')

For a funder to probe whether a fundee accepts zeroconf channels from the funder

Note: this part is NOT included in the plugin

  1. Generate a uuid4 string (call it uuid)

  2. Send the peer a custommsg like this (encode into message_bytes using above):

    type(u16, 2-byte): 55443 payload:

    {
        "id": <uuid>,
        "method": "getzeroconfinfo"
    }

For a fundee to respond to the zeroconf probing request

Note: this part IS included in the plugin

  1. Get the request's uuid4 id (call it uuid)

  2. Send the requester a custommsg like this (encode into message_bytes using above):

    type(u16, 2-byte): 55445 payload:

    {
        "id": <uuid>,
        "result": {
            "allows_your_zeroconf": true  # or false if not allowed
        }
    }

zero-conf-lnd's People

Contributors

tony-voltage avatar dongcarl 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.