LND
Welcome to the API reference documentation for LND, the Lightning Network Daemon.
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
).
Usage
Learn how to install, configure, and use LND by viewing the documentation in the Builder's Guide.
Summary
This site features the API documentation for lncli
(CLI), Python,
and JavaScript in
order to communicate with a local lnd
instance through gRPC and REST. It is intended
for those who already understand how to work with LND. If this is your first
time or you need a refresher, you may consider perusing our LND developer site
featuring a tutorial, resources and guides at dev.lightning.community.
gRPC
The code samples assume that the there is a local lnd
instance
running and listening for gRPC connections on port 10009
. LND_DIR
will be used
as a placeholder to denote the base directory of the lnd
instance. By default,
this is ~/.lnd
on Linux and ~/Library/Application Support/Lnd
on macOS.
At the time of writing this documentation, two things are needed in order to
make a gRPC request to an lnd
instance: a TLS/SSL connection and a macaroon
used for RPC authentication. The code samples will show how these can
be used in order to make a successful, secure, and authenticated gRPC request.
The original *.proto
files from which the gRPC documentation was generated
can be found here:
autopilotrpc/autopilot.proto
chainrpc/chainkit.proto
chainrpc/chainnotifier.proto
devrpc/dev.proto
invoicesrpc/invoices.proto
lightning.proto
lnclipb/lncli.proto
neutrinorpc/neutrino.proto
peersrpc/peers.proto
routerrpc/router.proto
signrpc/signer.proto
stateservice.proto
verrpc/verrpc.proto
walletrpc/walletkit.proto
walletunlocker.proto
watchtowerrpc/watchtower.proto
wtclientrpc/wtclient.proto
REST
View a listing of all REST URLs on the REST Endpoints page.
The code samples assume that the there is a local lnd
instance
running and listening for REST connections on port 8080
. LND_DIR
will be used
as a placeholder to denote the base directory of the lnd
instance. By default,
this is ~/.lnd
on Linux and ~/Library/Application Support/Lnd
on macOS.
At the time of writing this documentation, two things are needed in order to
make an HTTP request to an lnd
instance: a TLS/SSL connection and a macaroon
used for RPC authentication. The code samples will show how these can
be used in order to make a successful, secure, and authenticated HTTP request.
The original *.swagger.json
files from which the gRPC documentation was generated
can be found here:
autopilotrpc/autopilot.swagger.json
chainrpc/chainkit.swagger.json
chainrpc/chainnotifier.swagger.json
devrpc/dev.swagger.json
invoicesrpc/invoices.swagger.json
lightning.swagger.json
lnclipb/lncli.swagger.json
neutrinorpc/neutrino.swagger.json
peersrpc/peers.swagger.json
routerrpc/router.swagger.json
signrpc/signer.swagger.json
stateservice.swagger.json
verrpc/verrpc.swagger.json
walletrpc/walletkit.swagger.json
walletunlocker.swagger.json
watchtowerrpc/watchtower.swagger.json
wtclientrpc/wtclient.swagger.json
REST Encoding
NOTE: The byte
field type must be set as the base64 encoded string
representation of a raw byte array. Also, any time this must be used in a URL path
(ie. /v1/abc/xyz/{payment_hash}
) the base64 string must be encoded using a
URL and Filename Safe Alphabet. This means you must replace +
with -
,
/
with _
, and keep the trailing =
as is. Url encoding (ie. %2F
) will not work.
This documentation was
generated automatically against commit
c03de26dcc391a6ce22da1f6f262e9b912e72ae6
.
The following RPCs/services are currently considered to be experimental. This means they are subject to change in the future. They also need to be enabled with a compile-time flag to be active (they are active in the official release binaries).
- Service Autopilot (file:
autopilotrpc/autopilot.proto
) - Service ChainKit (file:
chainrpc/chainkit.proto
) - Service ChainNotifier (file:
chainrpc/chainnotifier.proto
) - Service Invoices (file:
invoicesrpc/invoices.proto
) - Service NeutrinoKit (file:
neutrinorpc/neutrino.proto
) - Service Peers (file:
peersrpc/peers.proto
) - Service Signer (file:
signrpc/signer.proto
) - Service WalletKit (file:
walletrpc/walletkit.proto
) - Service Watchtower (file:
watchtowerrpc/watchtower.proto
)