Lightning Network Daemon
Go to file
Oliver Gugger 75ca574790
lnrpc+rpcperms: add middleware handler
With this commit we introduce the concept of RPC middleware: A mechanism
similar to the existing channel or HTLC interceptors but this time for
gRPC messages themselves.
An RPC middleware can register itself to the main RPC server to get
notified each time a new gRPC request comes in, a gRPC response is sent
back or a streaming RPC is connected. The middleware can
validate/inspect incoming requests and modify/overwrite outgoing
responses.

Since this also opens the door for malicious software to interfere with
lnd in a negative way, we bind everything to macaroons with custom
caveat conditions: A middleware declares upon registration which custom
caveat name it can handle. Only client requests that send a macaroon
with that custom caveat will then be given to the middleware for
inspection. The only exception is if the middleware instead registers
to use the read-only mode. In that mode it will be able to intercept
all requests/responses, even those not made with a special encumbered
macaroon. But the middleware won't be able to alter responses in the
read-only mode. Therefore requests with the default, unencumbered macaroons
can never be modified by any middleware.
2021-09-20 13:12:49 +02:00
.github docs: add release notes to PR checklist and contributor guidelines 2021-08-10 15:56:17 -07:00
aezeed aezeed: export wordlist and properties 2021-06-30 14:20:32 +02:00
amp
autopilot
batch
blockcache
brontide brontide: when decrypting re-use the allocated ciphertext buf 2021-08-27 16:57:12 -07:00
buffer lnwire: remove unused MaxMessagePayload const 2021-08-10 05:36:07 +08:00
build build: bump version to v0.13.99 2021-06-18 14:04:31 -07:00
cert
chainntnfs multi: add shutdown logs in subservers 2021-09-15 19:52:03 +08:00
chainreg multi: use kvdb.Backend for height hint DB 2021-08-04 14:55:51 +02:00
chanacceptor
chanbackup channeldb+routing: add tx parameter 2021-08-24 13:43:24 +02:00
chanfitness
channeldb payments: prefetch payment on hot paths 2021-09-14 13:12:23 +02:00
channelnotifier multi: add shutdown logs in subservers 2021-09-15 19:52:03 +08:00
clock
cluster cluster: fix kvdb unit test 2021-09-13 14:57:42 +02:00
cmd lncli: add custom caveats to bakemacaroon 2021-09-20 13:05:47 +02:00
contractcourt contractcourt+lnd: add debug log 2021-09-17 07:50:44 +08:00
contrib
discovery multi: add shutdown logs in subservers 2021-09-15 19:52:03 +08:00
docker docs: replace freenode with libera 2021-07-21 18:32:42 -07:00
docs Merge pull request #5640 from bhandras/kvdb-prefetch 2021-09-20 09:42:18 +02:00
feature lnwire: add new feature bits for explicit channel type negotiation 2021-08-30 19:17:24 -07:00
funding funding: add batch funding function 2021-09-02 12:13:42 +02:00
fuzz fuzz/lnwire: minor touch-ups, remove MaxPayloadLength 2021-08-11 16:59:16 -04:00
healthcheck healthcheck: stop checking when max attempts are reached 2021-09-15 19:52:03 +08:00
htlcswitch multi: add shutdown logs in subservers 2021-09-15 19:52:03 +08:00
input
invoices multi: add shutdown logs in subservers 2021-09-15 19:52:03 +08:00
keychain keychain+lnwallet: when fetching priv keys or signing try to use cache 2021-08-25 18:55:22 -07:00
kvdb Merge pull request #5640 from bhandras/kvdb-prefetch 2021-09-20 09:42:18 +02:00
labels
lncfg config+sample-lnd.conf+lncfg: add RPC middleware config 2021-09-20 13:05:47 +02:00
lnpeer
lnrpc lnrpc+rpcperms: add middleware handler 2021-09-20 13:12:49 +02:00
lntest multi: use safe copy for macaroons 2021-09-20 13:05:46 +02:00
lntypes
lnwallet keychain+lnwallet: when fetching priv keys or signing try to use cache 2021-08-25 18:55:22 -07:00
lnwire lnwire: extend RawFeatureVector with helper methods 2021-08-30 19:17:31 -07:00
macaroons multi: use safe copy for macaroons 2021-09-20 13:05:46 +02:00
make make+itest: add tranche index to test name 2021-08-04 14:55:57 +02:00
mobile docs+lnrpc: rename rpc.proto to lightning.proto 2021-07-27 12:59:56 +02:00
monitoring
multimutex
nat
netann multi: add shutdown logs in subservers 2021-09-15 19:52:03 +08:00
peer peer: return from pingHandler if error 2021-09-15 08:43:16 +02:00
peernotifier multi: add shutdown logs in subservers 2021-09-15 19:52:03 +08:00
pool
queue
record record: fix nil pointer in log string 2021-09-16 19:51:03 +02:00
routing routing: add wait.NoError to TestBlockDifferenceFix assertion 2021-09-17 17:02:03 -07:00
rpcperms lnrpc+rpcperms: add middleware handler 2021-09-20 13:12:49 +02:00
scripts make+scripts: fix rpc-check command 2021-07-27 12:59:54 +02:00
shachain
signal lnd+signal: implement systemd notify 2021-08-20 13:26:48 +02:00
subscribe
sweep multi: add shutdown logs in subservers 2021-09-15 19:52:03 +08:00
ticker
tlv
tor config+lnd+tor: Update naming 2021-08-01 14:28:32 +02:00
walletunlocker Merge pull request #5659 from guggero/unit-test-race-fix 2021-08-24 15:16:28 +02:00
watchtower wtwire: remove reference from lnwire 2021-08-10 05:36:08 +08:00
zpay32
.gitignore
.golangci.yml GitHub+lint: reduce linter memory usage 2021-07-27 13:09:59 +02:00
.travis.yml travis: fix ARM and Windows itest parallelism 2021-09-15 10:26:52 +02:00
breacharbiter_test.go multi: fix unit test for high CPU load envs 2021-08-24 13:03:21 +02:00
breacharbiter.go contractcourt+lnd: add debug log 2021-09-17 07:50:44 +08:00
channel_notifier.go channel_notifier: keep chan in SCB on local foce close 2021-08-09 13:55:33 +02:00
chanrestore.go
config.go config+sample-lnd.conf+lncfg: add RPC middleware config 2021-09-20 13:05:47 +02:00
dev.Dockerfile
doc.go
Dockerfile
go.mod Merge pull request #5737 from naveensrinivasan/naveen/feat/fix-jwt-osv 2021-09-17 16:30:06 -07:00
go.sum Merge pull request #5737 from naveensrinivasan/naveen/feat/fix-jwt-osv 2021-09-17 16:30:06 -07:00
LICENSE
lnd.go multi: use safe copy for macaroons 2021-09-20 13:05:46 +02:00
log.go log+rpcperms: add custom RPCP logger to rpcperms package 2021-09-20 13:05:47 +02:00
logo.png
Makefile GitHub+make: compile JSON/WASM stubs 2021-08-03 13:44:37 +02:00
nursery_store_test.go
nursery_store.go
pilot.go channeldb+routing: add tx parameter 2021-08-24 13:43:24 +02:00
README.md trivial: link from readme to builder's guide 2021-09-10 05:42:26 +08:00
rpcserver.go rpcserver+macaroons: extract RawMacaroonFromContext 2021-09-20 13:05:33 +02:00
sample-lnd.conf config+sample-lnd.conf+lncfg: add RPC middleware config 2021-09-20 13:05:47 +02:00
server_test.go server: extract bootstrap logic into new function w/ unit test 2021-08-04 18:30:20 -07:00
server.go Merge pull request #5722 from xanoni/dedupe-pubkey-log-output 2021-09-17 16:28:15 -07:00
subrpcserver_config.go multi: rename local and remote chan DBs 2021-08-04 14:55:50 +02:00
tools.go
utxonursery_test.go
utxonursery.go
witness_beacon.go

Lightning Network Daemon

Build Status MIT licensed Irc Godoc

The Lightning Network Daemon (lnd) - is a complete implementation of a Lightning Network node. lnd has several pluggable back-end chain services including btcd (a full-node), bitcoind, and neutrino (a new experimental light client). The project's codebase uses the btcsuite set of Bitcoin libraries, and also exports a large set of isolated re-usable Lightning Network related libraries within it. In the current state lnd is capable of:

  • Creating channels.
  • Closing channels.
  • Completely managing all channel states (including the exceptional ones!).
  • Maintaining a fully authenticated+validated channel graph.
  • Performing path finding within the network, passively forwarding incoming payments.
  • Sending outgoing onion-encrypted payments through the network.
  • Updating advertised fee schedules.
  • Automatic channel management (autopilot).

Lightning Network Specification Compliance

lnd fully conforms to the Lightning Network specification (BOLTs). BOLT stands for: Basis of Lightning Technology. The specifications are currently being drafted by several groups of implementers based around the world including the developers of lnd. The set of specification documents as well as our implementation of the specification are still a work-in-progress. With that said, the current status of lnd's BOLT compliance is:

  • BOLT 1: Base Protocol
  • BOLT 2: Peer Protocol for Channel Management
  • BOLT 3: Bitcoin Transaction and Script Formats
  • BOLT 4: Onion Routing Protocol
  • BOLT 5: Recommendations for On-chain Transaction Handling
  • BOLT 7: P2P Node and Channel Discovery
  • BOLT 8: Encrypted and Authenticated Transport
  • BOLT 9: Assigned Feature Flags
  • BOLT 10: DNS Bootstrap and Assisted Node Location
  • BOLT 11: Invoice Protocol for Lightning Payments

Developer Resources

The daemon has been designed to be as developer friendly as possible in order to facilitate application development on top of lnd. Two primary RPC interfaces are exported: an HTTP REST API, and a gRPC service. The exported API's are not yet stable, so be warned: they may change drastically in the near future.

An automatically generated set of documentation for the RPC APIs can be found at api.lightning.community. A set of developer resources including guides, articles, example applications and community resources can be found at: docs.lightning.engineering.

Finally, we also have an active Slack where protocol developers, application developers, testers and users gather to discuss various aspects of lnd and also Lightning in general.

Installation

In order to build from source, please see the installation instructions.

Docker

To run lnd from Docker, please see the main Docker instructions

IRC

  • irc.libera.chat
  • channel #lnd
  • webchat

Safety

When operating a mainnet lnd node, please refer to our operational safety guidelines. It is important to note that lnd is still beta software and that ignoring these operational guidelines can lead to loss of funds.

Security

The developers of lnd take security very seriously. The disclosure of security vulnerabilities helps us secure the health of lnd, privacy of our users, and also the health of the Lightning Network as a whole. If you find any issues regarding security or privacy, please disclose the information responsibly by sending an email to security at lightning dot engineering, preferably encrypted using our designated PGP key (91FE464CD75101DA6B6BAB60555C6465E5BCB3AF) which can be found here.

Further reading