No description
Find a file
Nitesh Balusu 25f4fea9f7
docker: add docker and docker-compose support
add same docker support

modify sample docker compose file

include lndk-cli in the docker image

fix docker compose file

update dockerfile to use github and use slimmer image

lower grace period

use better lnd paths

add some lnd config
2025-01-13 20:51:40 -05:00
.cargo Ignore audit advisory for integration tests 2023-09-13 15:57:50 -05:00
.github release: update cargo-dist 2024-08-31 17:14:30 +02:00
docs docs: add bakemacaroon instructions for paying offers 2024-07-31 19:19:27 -05:00
lnd@d22b3937ea Bump LND to v0.18.2-beta. 2024-07-16 10:18:06 +09:00
proto multi: Configurable timeout for receiving invoice 2024-08-09 22:41:11 +02:00
src Merge pull request #154 from orbitalturtle/intro-announced-peers 2024-08-28 13:03:48 -05:00
tests offers: don't choose unadvertised node as introduction node 2024-08-28 12:55:41 -05:00
.gitignore add .vscode to .gitignore 2024-06-07 21:53:14 -05:00
.gitmodules tests: add lnd git submodule 2023-10-16 13:06:46 -05:00
ARCH.md Fix typos 2023-06-22 13:52:27 +03:00
build.rs multi: setup grpc server 2024-05-29 17:04:47 -05:00
Cargo.lock chore: Release lndk version 0.2.0 2024-09-02 11:31:36 -05:00
Cargo.toml chore: disable windows release support for now 2024-09-02 21:10:26 +02:00
CHANGELOG.md chore: Release lndk version 0.2.0 2024-09-02 11:31:36 -05:00
cliff.toml chore: Add release hook for CHANGELOG generation 2023-05-04 10:00:07 +02:00
code_of_conduct.md docs: add contributor covenant code of conduct v2.1 2023-04-04 14:46:12 +02:00
config_spec.toml multi: Configurable timeout for receiving invoice 2024-08-09 22:41:11 +02:00
CONTRIBUTING.md docs: update cargo fmt instructions for contributors 2024-06-07 21:52:09 -05:00
Dockerfile docker: add docker and docker-compose support 2025-01-13 20:51:40 -05:00
LICENSE Initial commit 2023-02-07 09:21:10 -05:00
MAINTAINERS.md chore: Update release process documentation & remove cosign key 2024-06-28 12:15:06 +02:00
Makefile Fix Makefile test typo 2024-03-06 15:20:58 -06:00
README.md Check LND has required version and build tags on start LNDK. 2024-07-16 09:55:06 +09:00
rust-toolchain.toml release: update cargo-dist 2024-08-31 17:14:30 +02:00
sample-docker-compose.yaml docker: add docker and docker-compose support 2025-01-13 20:51:40 -05:00
sample-lndk.conf multi: Configurable timeout for receiving invoice 2024-08-09 22:41:11 +02:00

LNDK

LNDK is a standalone daemon that connects to LND (via its grpc API) that aims to implement bolt 12 functionality externally to LND. LNDK leverages the lightning development kit to provide functionality, acting as a thin "shim" between LND's APIs and LDK's lightning library.

Project Milestones:

  • v0.1.0: Onion message forwarding for LND.
  • v0.2.0: Payment to offers with blinded paths.

Please note that this project is still experimental.

Resources

When you encounter a problem with LNDK, Feel free to file issues or start a discussion. If your question doesn't fit in either place, find us in the BOLT 12 Discord in the lndk channel.

Setting up LNDK

Compiling LND

To run LNDK, you will need a LND node running at least LND v0.18.0.

You will need to compile LND with the peersrpc, signerrpc, and walletrpc sub-servers enabled:

make install tags="peersrpc signrpc walletrpc"

Note that this guide assumes some familiarity with setting up LND. If you're looking to get up to speed, try this guide.

Running LND

Once you're ready to run LND, the binary must be run with --protocol.custom-message=513 to allow it to report onion messages to LNDK as well as --protocol.custom-nodeann=39 --protocol.custom-init=39 for advertising the onion message feature bits.

There are two ways you can do this:

  1. Pass these options directly to LND when running it:

lnd --protocol.custom-message=513 --protocol.custom-nodeann=39 --protocol.custom-init=39

  1. Adding these to the config file lnd.conf:
[protocol]
protocol.custom-message=513
protocol.custom-nodeann=39
protocol.custom-init=39

Two options for LNDK

Now that we have LND set up properly, there are two key things you can do with LNDK:

  1. Forward onion messages. By increasing the number of Lightning nodes out there that can forward onion messages, this increases the anonymity set and helps to bootstrap BOLT 12 for more private payments.
  2. Pay BOLT 12 offers, a more private standard for receiving payments over Lightning, which also allows for static invoices.

To accomplish #1, follow the instructions below to get the LNDK binary up and running. Once you have LNDK up and running, you can accomplish #2 here with either lndk-cli or setting up your own gRPC client.

Running LNDK

Now we need to set up LNDK. To start:

git clone https://github.com/lndk-org/lndk
cd lndk

In order for LNDK successfully connect to LND, we need to pass in the grpc address and authentication credentials.

As you can see in LNDK's config specifications file, there's two ways to pass in the credentials:

  1. By path with the cert-path and macaroon-path arguments.
  2. Directly, with the cert-pem and macaroon-hex arguments.

With that in mind, there are two ways to pass in the arguments to LNDK:

  1. These values can be passed in via the command line when running the LNDK program, like this:

cargo run --bin=lndk -- --address=<ADDRESS> --cert-path=<TLSPATH> --macaroon-path=<MACAROONPATH>

Or in a more concrete example:

cargo run --bin=lndk -- --address=https://localhost:10009 --cert-path=/home/<USERNAME>/.lnd/tls.cert --macaroon-path=/home/<USERNAME>/.lnd/data/chain/bitcoin/regtest/admin.macaroon

Remember that the grpc address must start with https:// for the program to work.

  1. Alternatively, you can use a configuration file to add the required arguments.
  • In the lndk directory, create file named lndk.conf.
  • Add the following lines to the file:
    • address="<ADDRESS"
    • cert-path="<TLSPATH>"
    • macaroon-path="<MACAROONPATH>"
  • Run cargo run --bin=lndk -- --conf lndk.conf
  • Use any of the commands with the --help option for more information about each argument.

Custom macaroon

Rather than use the admin.macaroon with unrestricted permission to an LND node, we can bake a macaroon using lncli with much more specific permissions for better security. With this command, generate a macaroon which will give LNDK only the specific grpc endpoints it's designed to hit:

lncli bakemacaroon --save_to=<FILEPATH>/lndk.macaroon uri:/lnrpc.Lightning/GetInfo uri:/lnrpc.Lightning/ListPeers uri:/lnrpc.Lightning/SubscribePeerEvents uri:/lnrpc.Lightning/SendCustomMessage uri:/lnrpc.Lightning/SubscribeCustomMessages uri:/peersrpc.Peers/UpdateNodeAnnouncement uri:/signrpc.Signer/DeriveSharedKey uri:/verrpc.Versioner/GetVersion

Security

NOTE: It is recommended to always use cargo-crev to verify the trustworthiness of each of your dependencies, including this one.