Lightning Network Daemon
Go to file
Olaoluwa Osuntokun f1e23748c9
routing/testdata: ensure test channels have unique chan ID's
This commit fixes a bug in the test data that was uncovered due to the
recent bug fix within the AddChannelEdge method within the ChannelGraph
struct of channeldb.

The storage and assertion of unique channel ID’s wasn’t correct due to
bug in the channeldb which caused the defect in the test data to go
unnoticed.
2017-01-09 19:47:52 -08:00
brontide brontide: modify key rotation to match test vectors in spec 2017-01-09 19:12:48 -08:00
chainntnfs chainntnfs: exit notifyBlockEpochs upon shutdown 2017-01-07 19:39:01 -08:00
channeldb channeldb: fix typo in AddChannelEdge 2017-01-09 19:02:37 -08:00
cmd/lncli cmd/lncli: add support for new "Perm" field in connectpeer command 2017-01-09 19:12:42 -08:00
docker docker: revamp docker set up to allow for an LN test cluster 2016-08-29 15:18:04 -07:00
docs docs: minor fixes 2017-01-09 19:37:49 -08:00
elkrem multi: update btcsuite API's to latest upstream changes 2017-01-05 13:56:34 -08:00
lnrpc lnrpc: recompile protos 2017-01-09 19:01:10 -08:00
lnwallet lnwallet: add support for the push-during-funding workflow 2017-01-09 18:58:07 -08:00
lnwire lnwire: add new 'PushSatoshis' field to SingleFundingRequest 2017-01-09 17:24:32 -08:00
routing routing/testdata: ensure test channels have unique chan ID's 2017-01-09 19:47:52 -08:00
shachain multi: update btcsuite API's to latest upstream changes 2017-01-05 13:56:34 -08:00
zpay32 zpay32: create new package for encoding/decoding payment requests 2017-01-02 15:17:58 -08:00
.gitignore Add RPC to show current total available channel capacity #29 (#35) 2016-09-15 12:00:56 -07:00
.travis.yml build: update travis to build against go 1.7.3 2016-10-26 14:28:51 -07:00
breacharbiter.go multi: update btcsuite API's to latest upstream changes 2017-01-05 13:56:34 -08:00
config.go config+test: use default port for RPC server if one isn't specified 2017-01-05 13:18:26 -08:00
doc.go add some daemon related skeleton files 2015-12-26 00:09:17 -06:00
fundingmanager.go lnd: add support for pushing funds as part of channel funding 2017-01-09 19:05:36 -08:00
glide.lock build: update glide dependancies since roasbeef/btcsuite upstream merge 2017-01-05 14:08:43 -08:00
glide.yaml build: update glide dependancies since roasbeef/btcsuite upstream merge 2017-01-05 14:08:43 -08:00
htlcswitch.go peer+htlcswitch: add support for multi-hop HTLC error propagation 2017-01-07 21:22:17 -08:00
invoiceregistry.go multi: update btcsuite API's to latest upstream changes 2017-01-05 13:56:34 -08:00
LICENSE add copyright, license and discouragement in readme 2016-01-16 00:13:11 -08:00
lnd_test.go test: add ability to push funds during funding to OpenChannel 2017-01-09 19:34:28 -08:00
lnd.go config+test: use default port for RPC server if one isn't specified 2017-01-05 13:18:26 -08:00
log.go lnd: fix lingering connmgr import 2017-01-05 14:08:36 -08:00
networktest_test.go netharness: remove test for the node restart method 2016-11-16 12:46:45 -08:00
networktest.go test: add ability to push funds during funding to OpenChannel 2017-01-09 19:34:28 -08:00
params.go lnd: remove support for the now obsolete SegNet4 2017-01-05 13:08:15 -08:00
peer_test.go plasma: rough draft of peer struct 2015-12-20 15:16:38 -06:00
peer.go lnd: add new "perm" bit to the ConnectPeer RPC call 2017-01-09 19:09:03 -08:00
README.md README: fix some typos 2017-01-05 16:42:43 -08:00
rpcserver.go lnd: add new "perm" bit to the ConnectPeer RPC call 2017-01-09 19:09:03 -08:00
server.go lnd: add new "perm" bit to the ConnectPeer RPC call 2017-01-09 19:09:03 -08:00
signal.go create signal.go to handle SIGINT's 2016-03-22 18:42:01 -07:00
utxonursery_test.go multi: update btcsuite API's to latest upstream changes 2017-01-05 13:56:34 -08:00
utxonursery.go utxonursery: add additional comments to new sections 2017-01-07 21:22:05 -08:00
version.go create version.go file 2016-03-22 18:40:54 -07:00

lnd - Lightning Network Daemon

Build Status

This repo is preliminary work on a lightning network peer-to-peer node and wallet.

It's currently being tested on Segnet4, where malleability has been solved with segwit.

This version of Lnd is not yet fully-operational, but a proof of concept on Segnet4 will likely exist soon. The projection is it will be operational before the necessary malleability soft-forks are into bitcoin mainnet (may be significantly before if there are any delays in mainnet malleability fix).

Don't try to port it to mainnet or an altcoin and use it today! No really. Lightning transactions will be fast, but for now, please wait just a little bit.

Installation

  • In order to build form source, the following build dependencies are required:
    • Go 1.5 or 1.6

      Installation instructions can be found here: http://golang.org/doc/install. It is recommended to add $GOPATH/bin to your PATH at this point. Note: If you are building with Go 1.5, then you'll need to enable the vendor experiment by setting the GO15VENDOREXPERIMENT environment variable to 1. If you're using Go 1.6 or later, then it is safe to skip this step.

    • Glide

      This project uses Glide to manage dependencies as well as to provide reproducible builds. To install Glide, execute the following command (assumes you already have Go properly installed):

      $ go get -u github.com/Masterminds/glide

    • btcd

      This project currently requires btcd with segwit support, which is not merged yet. To install, please see the installation instructions.

With the preliminary steps completed, to install lnd, lncli, and all related dependencies run the following commands:

$ git clone https://github.com/lightningnetwork/lnd $GOPATH/src/github.com/lightningnetwork/lnd
$ cd $GOPATH/src/github.com/lightningnetwork/lnd
$ glide install
$ go install . ./cmd/...

Updating

To update your version of lnd to the latest version run the following commands:

$ cd $GOPATH/src/github.com/lightningnetwork/lnd
$ git pull && glide install
$ go install . ./cmd/...

Packages and Utilities

chainntfs

A package centered around a generic interface for receiving transaction/confirmation based notifications concerning the blockchain. Such notifications are required in order for pending payment channels to be notified once the funding transaction gains a specified number of confirmations, and in order to catch a counter-party attempting a non-cooperative close using a past commitment transaction to steal funds.

At the moment, it only has a single concrete implementation: using btcd's websockets notifications. However, more implementations of the interface are planned, such as electrum, polling via JSON-RPC, Bitcoin Core's ZeroMQ notifications, and more.

channeldb

lnd's primary datastore. It uses a generic interface defined in walletdb allowing for usage of any storage backend which adheres to the interface. The current concrete implementation used is driven by bolt. channeldb is responsible for storing state such as meta-data concerning the current open channels, closed channels, past routes we used, fee schedules within the network, and information about remote peers (ID, uptime, reputation, etc).

cmd / lncli

A command line to query and control a running lnd. Similar to bitcoin-cli

cmd / lnshell

Interactive shell for commands to direct the lnd node. Will probably be merged into lnd soon as a command line option.

elkrem

Library to send and receive a tree structure of hashes which can be sequentially revealed. If you want to send N secrets, you only need to send N secrets (no penalty there) but the receiver only needs to store log2(N) hashes, and can quickly compute any previous secret from those.

This is useful for the hashed secrets in LN payment channels.

lndc

Library for authenticated encrypted communication between LN nodes. It uses chacha20_poly1305 for the symmetric cipher, and the secp256k1 curve used in bitcoin for public keys. No signing is used, only two ECDH calculations: first with ephemeral key pairs and second with persistent identifying public keys.

lnrpc

lnd's RPC interface. Currently gRPC, a high-performance RPC framework is used. gRPC provides features such as a stub-based client interface in several languages, streaming RPCs, payload agnostic request/response handling, and more. In addition to gRPC, lnd will also offer a basic REST-based http RPC interface. For now, connections are not encrypted, or authenticated. For authentication, macaroons will likely be integrated due to their simplicity, flexibility, and expressiveness.

lnstate

In-progress update which improves current implementation of channel state machine to allow for higher throughput.

lnwallet

An application specific, yet general Bitcoin wallet which understands all the fancy script, and transaction formats needed to transact on the Lightning Network. The interface, and interaction with the core wallet logic has been designed independent of any peer-to-peer communication. The goal is to make lnwallet self-contained, and easily embeddable within future projects interacting with the Lightning Network. The current state machine for channel updates is blocking, only allowing one pending update at a time. This will soon be replaced in favor of the highly concurrent, non-blocking state machine within lnstate.

lnwire

Library of messages for Lightning Network node to node communications. Messages for opening and closing channels, as well as updating and revoking channel states are described here.

shachain

An implementation of Rusty Russell's 64-dimensional shachain.

uspv

Wallet library to connect to bitcoin nodes and build a local SPV and wallet transaction state.