Borehole · Project · free tier
lightningnetwork/lnd
Free reading: not for reliance
1a359d4 · 21,601 commits · 2,394 files
Read 2026-10-23

lightningnetwork/lnd: technical due diligence, read from its repository

What Borehole read in lightningnetwork/lnd's code and history at 1a359d4: its licence, security advisories, releases, review practice, tests, dependencies and operations. Every finding cites the file and line it rests on. The full report also covers the team and asks the questions the code cannot answer.

DimensionRating
Architecture & Codebase — including AI provenanceadequate
Engineering Process & SDLC Maturitystrong
Product & Engineering Maturitystrong
Security & Reliability Postureadequate
Observability & Operationsstrong
Fit with the Acquirernot assessable

What the repository says

  • Releases are cut from another branch than the one surveyed

Architecture & Codebase — including AI provenance

adequate
01.6

lnwallet/channel.go is 10,498 lines, 70× this codebase's median file

adequate

The median source file here is 149 lines. 59 files exceed 1,490 lines, the largest being 10,498. Size is not a defect on its own — some problems genuinely live in one place — but these are where merge conflicts, review fatigue and single-owner knowledge concentrate, and they are the first thing that slows an inheriting engineer down.

Evidence
lnwallet/channel.go:1 — 10,498 lines (70× median)
rpcserver.go:1 — 8,996 lines (60× median)
graph/db/sql_store.go:1 — 6,988 lines (46× median)
peer/brontide.go:1 — 6,577 lines (44× median)
tlv/tlv_types_generated.go:1 — 6,054 lines (40× median)
01.25

1 base image floats: no version, or `latest`

adequate

1 of 6 `FROM` lines in product Dockerfiles name an image without a version, or with `latest`. Each build pulls whatever the registry serves that day, so the image that ships can change without a commit, and last month's build cannot be reproduced. Pin a version, or a digest.

Evidence
Dockerfile:22 — base image without a version

Engineering Process & SDLC Maturity

strong

No finding.

Product & Engineering Maturity

strong
04.38

21 files still carry code deprecated more than two years ago

adequate

21 files were marked deprecated over two years ago and still are, the oldest since Apr 2020. A deprecation is a promise to remove. Ask what still depends on these, and whether removing them is scheduled.

Evidence
lnrpc/routerrpc/router.pb.go — deprecated since Apr 2020
lnrpc/signrpc/signer.pb.go — deprecated since Sep 2020
lnrpc/walletrpc/walletkit.pb.go — deprecated since Mar 2021
lnrpc/wtclientrpc/wtclient.pb.go — deprecated since Mar 2021
lnrpc/invoicesrpc/invoices.pb.go — deprecated since May 2021
04.62

Releases are cut from another branch than the one surveyed

adequate

The newest pre-release, v0.21.4-beta, is not on the branch this survey read; the newest release on it is v0.11. The shipped product may differ from what this report describes. Survey the release branch too.

Evidence
tag v0.21.4-beta

Security & Reliability Posture

adequate
05.6

4 Dockerfiles run the application as root

adequate

No USER instruction switches away from root, so the process runs with full privileges inside the container. It is a one-line fix and an ordinary expectation, which is why its absence is worth asking about: it usually says more about whether anyone has reviewed the deployment than about this container specifically.

Evidence
Dockerfile — runs as root
docker/bitcoind/Dockerfile — runs as root
docker/btcd/Dockerfile — runs as root
lnrpc/Dockerfile — runs as root
05.27

The build runs third-party code it does not pin

adequate

9 third-party CI actions are referenced by a tag or branch rather than a commit, so they run whatever that tag points to on the day. Tags have been moved to malicious commits in real supply-chain attacks, and a piped script is whatever the server returns that minute. Pinning to a commit is the fix, and it is small.

Evidence
.github/workflows/claude.yml:47 — action pinned by tag
.github/workflows/docker.yml:44 — action pinned by tag
05.20

24 SQL statements built from strings

adequate

24 places in product code build SQL by formatting or joining strings rather than passing parameters. In each, what the code shows going in is a table or column name, a constant, or something the line does not show, not a request's value. Ask whether any value reaches these strings, rather than a parameter.

Evidence
kvdb/postgres/fixture.go:172 — SQL built from a string
kvdb/sqlbase/migration_bulk_postgres.go:55 — SQL built from a string
kvdb/sqlbase/migration_bulk_postgres.go:179 — SQL built from a string
05.26

8 locked dependencies have published vulnerabilities, 1 high or critical in what ships

adequate

8 of 235 locked dependencies match 10 published advisories in OSV, 3 of them rated high or critical. A lockfile says which version is installed, not whether the flawed code is reachable from this product, so each needs a look. Most are fixed by an upgrade, and the advisory names the version. This lockfile pins development tools alongside what ships and does not say which is which, so some of these may never reach a user.

Evidence
go.mod — go.etcd.io/etcd/client/pkg/v3 v3.5.12: GO-2026-6107 (high), fixed in 3.5.33
go.mod — github.com/docker/docker v28.1.1+incompatible: GO-2026-4887 (high)
sqldb/v2/go.mod — github.com/docker/docker v28.3.3+incompatible: GO-2026-4887 (high)

Observability & Operations

strong
06.9

No error reporter is wired in

adequate

Nothing in the service initialises an error reporter (Sentry, Rollbar, Bugsnag, Honeybadger or an APM agent). An exception in production reaches a person only if someone is reading the logs, which usually means a customer reports it first.

Evidence
no error reporter initialised

Fit with the Acquirer

not assessable

Not rated: structurally not assessable from a repository.

Read more, or read your own

The full report on lightningnetwork/lnd: every dimension, the questions for the room, and the audit log.

Survey a repository: free on public repositories. Private code is read on your own machine by a collector whose source you can read first.