Skip to content

cmd: allow deterministic macaroon derivation with lncli#9172

Merged
guggero merged 4 commits into
lightningnetwork:masterfrom
guggero:initwallet-mac-root-key
Oct 15, 2024
Merged

cmd: allow deterministic macaroon derivation with lncli#9172
guggero merged 4 commits into
lightningnetwork:masterfrom
guggero:initwallet-mac-root-key

Conversation

@guggero
Copy link
Copy Markdown
Collaborator

@guggero guggero commented Oct 11, 2024

This PR adds a new --mac_root_key flag to the lncli create and lncli createwatchonly commands that allow the deterministic initialization of the macaroon root key store.

That allows macaroons to be baked (with a new --root_key flag of the lncli bakemacaroon command) before a node is even started.

This will be especially useful in combination with the new reverse remote signer setup in #8754.

Copy link
Copy Markdown
Collaborator

@ellemouton ellemouton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tACK, LGTM - very nice. Super useful 🚀

Comment thread cmd/commands/cmd_walletunlocker.go
Comment thread cmd/commands/cmd_macaroon.go
Comment thread docs/macaroons.md
Copy link
Copy Markdown
Collaborator

@ViktorT-11 ViktorT-11 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tACK LGTM, once the linting CI error has been addressed! Thanks a lot for this 🚀🔥!

I've tested this in combination with #8754, and can confirm that I've created a setup where the signer & watch-only node doesn't need to be restarted during the init 🚀! Thanks a lot :)

Comment thread macaroons/bake_test.go Outdated
This commit adds a new --mac_root_key flag to both the lncli create and
lncli createwatchonly commands that allows the user to specify the
macaroon root key that should be used when creating the macaroon
database on wallet initialization.
This allows for deterministic wallet initialization and baking of
macaroons before the wallet is initialized.
@guggero guggero force-pushed the initwallet-mac-root-key branch from b506902 to fcb21df Compare October 15, 2024 07:49
@guggero guggero merged commit 5f86e25 into lightningnetwork:master Oct 15, 2024
@guggero guggero deleted the initwallet-mac-root-key branch October 15, 2024 10:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants