Conversation
The README documented only the three macaroons baked at startup and two constraints. Document the sub server macaroons and `--stateless_init`, add the missing `onchain:read` op to the invoice permission example, and rewrite the constraints section to cover the IP range and custom caveat constraints, how a constraint is applied and which checkers validate the conditions. Also drop the upgrade section for versions older than v0.9.0-beta. [skip ci]
9 tasks
Lrifton92
reviewed
Sep 21, 2026
Lrifton92
left a comment
There was a problem hiding this comment.
Nice cleanup — this fills a real gap, the old README only described the three default macaroons. I cross-checked the factual claims against the code and they hold up:
- Sub-server permissions all match:
routerrpc→offchain:read/offchain:write(router_server.go),signrpc→signer:generate/signer:read,walletrpc→address+onchainread/write,chainrpc→onchain:readonly (chain_server.go),invoicesrpc→invoices:read/invoices:write. - The
--macaroontimeoutdefault of 60s and the "applied to every call" anti-replay note matchcmd/commands/main.go(flag at :406, the 60s default is documented at :176-185). - The
IPRangeLockConstraintnote is accurate: only--macaroonipis wired up (main.go:413), there's no CLI flag for the range variant.
One optional nit: in the sub-server list, the phrase "every sub server that is compiled into the binary bakes a macaroon of its own on first startup" is true for the ones that declare macaroon permissions, but it may read as if every registered sub-server writes a file. Might be worth a half-sentence clarifying it's the sub-servers with their own permission set. Non-blocking — the content itself is correct.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Change Description
macaroons/README.mdhas drifted from the code. This refreshes it. No code changes, documentation only.Macaroons baked at startup. The README described only
admin.macaroon,invoice.macaroonandreadonly.macaroon. Every sub server compiled into the binary also bakes one of its own on first startup (router,signer,walletkit,chainnotifier,invoices), each with its own path flag. They are now listed with the permissions they carry, along with the note that no macaroon file is written to disk under--stateless_init.Permission example. The
invoice.macaroonexample was missingonchain:read. It now matchesinvoicePermissionsinrpcserver.go.Constraints. The section stated that "there are currently two constraints implemented" and covered
TimeoutConstraintandIPLockConstraintonly.IPRangeLockConstraintandCustomConstrainthave been around for several releases. The section now says what a constraint is (a first party caveat, which anyone holding the macaroon can append offline and which can only narrow what the macaroon allows), lists all four with the caveat condition each one encodes, and points atconfig_builder.go, where the checkers for thelndspecific conditions are registered.How constraints are applied. Adds examples for both
bakemacaroonandconstrainmacaroon, notes that--macaroontimeoutis applied to everylnclicall with a 60 second default as a basic anti-replay measure, and records thatIPRangeLockConstraintis currently reachable only from Go code, since neither command registers a flag for it ([bug]:lncli --ip_rangeis unreachable and its implementation calls the wrong constraint #11127).Obsolete section. Drops "Upgrading from v0.8.0-beta or earlier", which is about upgrades to a release that is now many years old.
Fixes
gPRCin passing.Steps to Test
Documentation only, so there is nothing to run. The claims can be checked against the code:
grep -rn "MacPath\|MacFilename" --include=*.go lnrpc/ | grep -v _testfor the sub server macaroon files and their path flags.grep -n -A 25 "invoicePermissions = " rpcserver.gofor the permission example.ls macaroons/constraints.goandgrep -n "func.*Constraint" macaroons/*.gofor the four constraints.grep -n "Checker" config_builder.gofor where the checkers are registered.Pull Request Checklist
The change is documentation only: no tests, no logging, no new
lnclicommands. Lines wrap at 80, and the commit carries[skip ci]instead of a release notes entry, as the template allows for small changes.