skills/lnd/SKILL.md
Run and interact with lnd Lightning Network daemon in Docker. Use for Lightning development, testing payment channels on regtest, managing lnd containers, and calling lnd RPC endpoints (getinfo, connect, open/close channels, pay/receive). Supports bitcoind, btcd, and neutrino backends.
npx skillsauth add roasbeef/claude-files lndInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
LND (Lightning Network Daemon) is a complete implementation of a Lightning Network node. This skill helps you run lnd in Docker for development and testing, with support for multiple backends.
gh CLI for building from GitHub PRsStart the full regtest stack (Bitcoin Core + LND):
cd ~/.claude/skills/lnd/templates
docker-compose up -d --build # First time: builds lnd from source (~3-5 min)
docker-compose up -d # Subsequent runs: uses cached image
This starts:
lnd-bitcoind: Bitcoin Core 30 in regtest mode with ZMQlnd: LND built from local sourceNotes:
/users/roasbeef/gocode/src/github.com/lightningnetwork/lnd--noseedbackup for testing (no wallet seed required)Check status:
~/.claude/skills/lnd/scripts/lncli.sh getinfo
LND supports three backend options:
| Backend | Description | Best For | |---------|-------------|----------| | bitcoind | Bitcoin Core | Production, regtest development, interop testing | | btcd | btcd (Go implementation) | Simnet testing, fast iteration | | neutrino | Light client (BIP 157/158) | Testnet, mobile simulation |
cd ~/.claude/skills/lnd/templates
docker-compose up -d
# First start eclair's stack
cd ~/.claude/skills/eclair/templates
docker-compose up -d
# Then start lnd using eclair's bitcoind
cd ~/.claude/skills/lnd/templates
docker-compose -f docker-compose-shared.yml up -d
cd ~/.claude/skills/lnd/templates
docker-compose -f docker-compose-btcd.yml up -d
cd ~/.claude/skills/lnd/templates
docker-compose -f docker-compose-neutrino.yml up -d
# Or with signet
NETWORK=signet docker-compose -f docker-compose-neutrino.yml up -d
# Build from current source
~/.claude/skills/lnd/scripts/docker-build.sh
# Build from a specific branch
~/.claude/skills/lnd/scripts/docker-build.sh --branch simple-taproot-chans
# Build from a GitHub PR
~/.claude/skills/lnd/scripts/docker-build.sh --pr 1234
# Build from a specific commit
~/.claude/skills/lnd/scripts/docker-build.sh --commit abc123
# Quick PR build (convenience wrapper)
~/.claude/skills/lnd/scripts/build-pr.sh 1234
# Start standalone stack (bitcoind + lnd)
~/.claude/skills/lnd/scripts/docker-start.sh
# Start in shared mode (uses external bitcoind)
~/.claude/skills/lnd/scripts/docker-start.sh --shared
# Start with btcd backend
~/.claude/skills/lnd/scripts/docker-start.sh --btcd
# Start in neutrino mode
~/.claude/skills/lnd/scripts/docker-start.sh --neutrino
# Rebuild before starting
~/.claude/skills/lnd/scripts/docker-start.sh --build
# Stop containers (preserve data)
~/.claude/skills/lnd/scripts/docker-stop.sh
# Stop and remove volumes (clean state)
~/.claude/skills/lnd/scripts/docker-stop.sh --clean
docker logs -f lnd
docker logs -f lnd-bitcoind
All commands use lncli.sh wrapper which auto-detects the lnd container.
# Get node info
~/.claude/skills/lnd/scripts/lncli.sh getinfo
# Get wallet balance (on-chain)
~/.claude/skills/lnd/scripts/lncli.sh walletbalance
# Get channel balance (Lightning)
~/.claude/skills/lnd/scripts/lncli.sh channelbalance
# Get new address (native SegWit)
~/.claude/skills/lnd/scripts/lncli.sh newaddress p2wkh
# Get new address (nested SegWit)
~/.claude/skills/lnd/scripts/lncli.sh newaddress np2wkh
# Get new Taproot address
~/.claude/skills/lnd/scripts/lncli.sh newaddress p2tr
# Send on-chain
~/.claude/skills/lnd/scripts/lncli.sh sendcoins --addr=<address> --amt=<satoshis>
# Connect by URI
~/.claude/skills/lnd/scripts/lncli.sh connect <pubkey>@<host>:9735
# List connected peers
~/.claude/skills/lnd/scripts/lncli.sh listpeers
# Disconnect
~/.claude/skills/lnd/scripts/lncli.sh disconnect <pubkey>
# Open channel
~/.claude/skills/lnd/scripts/lncli.sh openchannel --node_key=<pubkey> --local_amt=1000000
# List channels
~/.claude/skills/lnd/scripts/lncli.sh listchannels
# Get channel balance
~/.claude/skills/lnd/scripts/lncli.sh channelbalance
# Close channel cooperatively
~/.claude/skills/lnd/scripts/lncli.sh closechannel --funding_txid=<txid> --output_index=<n>
# Force close channel
~/.claude/skills/lnd/scripts/lncli.sh closechannel --funding_txid=<txid> --output_index=<n> --force
# Create invoice
~/.claude/skills/lnd/scripts/lncli.sh addinvoice --amt=<satoshis> --memo="test payment"
# Decode invoice
~/.claude/skills/lnd/scripts/lncli.sh decodepayreq <bolt11_invoice>
# Pay invoice
~/.claude/skills/lnd/scripts/lncli.sh sendpayment --pay_req=<bolt11_invoice>
# List payments
~/.claude/skills/lnd/scripts/lncli.sh listpayments
# List invoices
~/.claude/skills/lnd/scripts/lncli.sh listinvoices
cd ~/.claude/skills/lnd/templates
docker-compose up -d
# Automated setup: mines blocks, funds lnd wallet
~/.claude/skills/lnd/scripts/regtest-setup.sh
Or manually:
# Mine blocks for coinbase maturity
~/.claude/skills/lnd/scripts/mine.sh 101
# Get lnd address
LND_ADDR=$(~/.claude/skills/lnd/scripts/lncli.sh newaddress p2wkh | jq -r '.address')
# Send funds to lnd
~/.claude/skills/lnd/scripts/bitcoin-cli.sh sendtoaddress $LND_ADDR 10
# Confirm transaction
~/.claude/skills/lnd/scripts/mine.sh 1
# Check balance
~/.claude/skills/lnd/scripts/lncli.sh walletbalance
# Connect to peer
~/.claude/skills/lnd/scripts/lncli.sh connect <nodeId>@<host>:9735
# Open 1M sat channel
~/.claude/skills/lnd/scripts/lncli.sh openchannel --node_key=<nodeId> --local_amt=1000000
# Mine blocks to confirm channel
~/.claude/skills/lnd/scripts/mine.sh 6
# Check channel status
~/.claude/skills/lnd/scripts/lncli.sh listchannels
# On receiving node: create invoice
INVOICE=$( lncli addinvoice --amt=50000 --memo="test" | jq -r '.payment_request')
# On sending node: pay invoice
~/.claude/skills/lnd/scripts/lncli.sh sendpayment --pay_req=$INVOICE
Run multiple lnd nodes for peer-to-peer testing:
# Start alice and bob nodes
~/.claude/skills/lnd/scripts/docker-start.sh --multi --build
# Or with docker-compose directly
cd ~/.claude/skills/lnd/templates
docker-compose -f docker-compose-multi.yml up -d --build
# Full setup: fund wallets and open channel between alice and bob
~/.claude/skills/lnd/scripts/multi-node-setup.sh
# Or without channel
~/.claude/skills/lnd/scripts/multi-node-setup.sh --no-channel
# Use --node flag to specify which node
~/.claude/skills/lnd/scripts/lncli.sh --node alice getinfo
~/.claude/skills/lnd/scripts/lncli.sh --node bob getinfo
# Get pubkeys
ALICE_PUBKEY=$(~/.claude/skills/lnd/scripts/lncli.sh --node alice getinfo | jq -r '.identity_pubkey')
BOB_PUBKEY=$(~/.claude/skills/lnd/scripts/lncli.sh --node bob getinfo | jq -r '.identity_pubkey')
# Connect nodes
~/.claude/skills/lnd/scripts/lncli.sh --node alice connect ${BOB_PUBKEY}@lnd-bob:9735
# Open channel
~/.claude/skills/lnd/scripts/lncli.sh --node alice openchannel --node_key=$BOB_PUBKEY --local_amt=1000000
# Send payment from alice to bob
INVOICE=$(~/.claude/skills/lnd/scripts/lncli.sh --node bob addinvoice --amt=10000 | jq -r '.payment_request')
~/.claude/skills/lnd/scripts/lncli.sh --node alice sendpayment --pay_req=$INVOICE
| Node | P2P Port | gRPC Port | REST Port | |------|----------|-----------|-----------| | alice | 9735 | 10009 | 8080 | | bob | 9736 | 10010 | 8081 | | charlie | 9737 | 10011 | 8082 |
Test channel operations between lnd and eclair:
# Terminal 1: Start eclair stack
cd ~/.claude/skills/eclair/templates
docker-compose up -d
~/.claude/skills/eclair/scripts/regtest-setup.sh
# Terminal 2: Start lnd with shared bitcoind
cd ~/.claude/skills/lnd/templates
docker-compose -f docker-compose-shared.yml up -d --build
# Wait for lnd to sync, then run setup
sleep 10
~/.claude/skills/lnd/scripts/regtest-setup.sh --quick
# Get eclair's pubkey
ECLAIR_PUBKEY=$(docker exec eclair eclair-cli -p devpassword getinfo | jq -r '.nodeId')
echo "Eclair pubkey: $ECLAIR_PUBKEY"
# Connect lnd to eclair
~/.claude/skills/lnd/scripts/lncli.sh connect ${ECLAIR_PUBKEY}@eclair:9735
# Open channel from lnd to eclair
~/.claude/skills/lnd/scripts/lncli.sh openchannel --node_key=$ECLAIR_PUBKEY --local_amt=1000000
# Mine to confirm
~/.claude/skills/eclair/scripts/mine.sh 6
# Check channels on both sides
~/.claude/skills/lnd/scripts/lncli.sh listchannels
docker exec eclair eclair-cli -p devpassword channels
Pass extra arguments to lnd via LND_EXTRA_ARGS:
# Enable REST API on different port
LND_EXTRA_ARGS="--restlisten=0.0.0.0:8081" docker-compose up -d
# Enable debug logging for specific subsystems
LND_EXTRA_ARGS="--debuglevel=HSWC=trace,PEER=debug" docker-compose up -d
# Multiple extra args
LND_EXTRA_ARGS="--protocol.wumbo-channels --maxchansize=500000000" docker-compose up -d
LND supports various build tags for optional features:
| Tag | Description |
|-----|-------------|
| signrpc | Signing RPC service |
| walletrpc | Wallet RPC service |
| chainrpc | Chain RPC service |
| invoicesrpc | Invoices RPC service |
| routerrpc | Router RPC service |
| peersrpc | Peers RPC service |
| neutrinorpc | Neutrino RPC service |
| watchtowerrpc | Watchtower RPC service |
| kvdb_sqlite | SQLite database backend |
| kvdb_postgres | PostgreSQL database backend |
| dev | Development features |
Build with custom tags:
~/.claude/skills/lnd/scripts/docker-build.sh --tags "signrpc walletrpc routerrpc dev"
| Script | Description |
|--------|-------------|
| docker-build.sh | Build lnd image with branch/PR/commit support |
| docker-start.sh | Start containers with mode selection |
| docker-stop.sh | Stop containers, optionally clean volumes |
| lncli.sh | Wrapper for lncli with container and node auto-detection |
| bitcoin-cli.sh | Wrapper for bitcoin-cli |
| mine.sh | Mine regtest blocks |
| regtest-setup.sh | Initialize regtest with funded wallet |
| multi-node-setup.sh | Initialize multi-node with funded wallets and channels |
| build-pr.sh | Quick PR build convenience wrapper |
| Variable | Description | Default |
|----------|-------------|---------|
| LND_SOURCE | Path to lnd source directory | /users/roasbeef/gocode/src/github.com/lightningnetwork/lnd |
| LND_IMAGE | Docker image tag | lnd:local |
| LND_DEBUG | Log level | debug |
| LND_EXTRA_ARGS | Additional lnd arguments | (empty) |
| NETWORK | Bitcoin network | regtest |
| BACKEND | Backend: bitcoind, btcd, neutrino | bitcoind |
| Port | Service | Description | |------|---------|-------------| | 9735 | Lightning | Peer-to-peer Lightning protocol | | 10009 | gRPC | LND RPC (for lncli) | | 8080 | REST | REST API | | 18443 | Bitcoin RPC | Bitcoin Core RPC (regtest) | | 28332 | ZMQ | Block notifications | | 28333 | ZMQ | Transaction notifications |
docker logs lndlncli.sh listchannels to see local/remote balances~/.claude/skills/lnd/scripts/mine.sh 6lncli.sh walletbalancelncli.sh getinfo and look at synced_to_chain--prod flag for production Dockerfiledevelopment
Adversarial review→triage→fix loop until a cold verifier signs off. Fans out lens-specific reviewer subagents, verifies every finding against the code (killing false positives), auto-applies confirmed fixes as fixup commits, and repeats until a fresh verifier approves. Prefers a deterministic dynamic workflow when available; falls back to in-instance Task dispatch. Use when the user types /review-loop or asks to adversarially review-and-fix a change set, branch, or commit range until clean.
development
Run GitHub Actions CI locally with Agent CI to validate changes before pushing. Use when testing, running checks, or validating code changes.
development
Clear-writing guide distilled from Steven Pinker's "The Sense of Style." Use when writing or revising prose that must be clear to a reader — documentation, design docs, specs, explanations, essays, emails, reports, RFCs, release notes — or when asked to make writing clearer, tighter, less academic, or less jargon-laden. Activate for "make this clearer", "tighten this", "why is this hard to read", "edit this for clarity", or any prose-quality pass.
development
Interactively debug Go programs in a single context using Delve (dlv) driven through tmux. Use when a bug requires runtime inspection — stepping through code, examining variables, walking goroutines, attaching to a live process, or debugging a hanging integration test — rather than just reading the source. Triggers include "step through this", "set a breakpoint", "attach to the running server", "why is this goroutine stuck", "debug this failing test".