Skip to content

cli: export_owner_key can use its own password (#401, #891) - #2165

Open
vsnation wants to merge 1 commit into
BeamMW:masterfrom
vsnation:fix/401-owner-key-password
Open

vsnation wants to merge 1 commit into
BeamMW:masterfrom
vsnation:fix/401-owner-key-password

Conversation

@vsnation

Copy link
Copy Markdown

Fix: beam-wallet export_owner_key --owner_key_pass=<pw> encrypts the exported owner (viewer) key with its own password, so the node that uses it doesn't need the wallet password (#401; option A of #891).

Why: the key was always encrypted with the wallet password, and beam-node --owner_key=… --pass=… needs that password to use it. Anyone running a node that watches their wallet (often a remote server, started by systemd) had to put the wallet password into the node's command line or config.

How to see the bug (master)

beam-wallet restore --pass=walletpw --wallet_path=w.db --seed_phrase="abandon;abandon;abandon;abandon;abandon;abandon;abandon;abandon;abandon;abandon;abandon;about;"
beam-wallet export_owner_key --pass=walletpw --wallet_path=w.db
beam-node --owner_key=<key> --pass=walletpw     # the wallet password has to go to the node
beam-wallet export_owner_key --pass=walletpw --wallet_path=w.db --owner_key_pass=nodepw
# master: "unrecognised option '--owner_key_pass'"

Improvement

master this PR
export_owner_key (no option) key encrypted with the wallet password the same key as master, plus a hint: "The key is encrypted with the wallet password. Use --owner_key_pass to encrypt it with a different password for the node"
export_owner_key --owner_key_pass=nodepw unrecognised option key encrypted with nodepw; "Give the node that password, not the wallet password."
beam-node --owner_key=<that key> --pass=nodepw – node starts and uses the key
beam-node --owner_key=<that key> --pass=walletpw – key import failed
--owner_key_pass "" – --owner_key_pass must not be empty

Nodes need no changes: they already take the key's password through --pass.

Testing: all rows above were run with master's and this branch's beam-wallet, and with this branch's beam-node. Fork CI (running): https://github.com/vsnation/beam/actions/runs/

Fixes #401

The exported owner (viewer) key was always encrypted with the wallet
password, so running a node that watches the wallet meant putting the
wallet password on the node (its --pass / config), often a remote
server. Add --owner_key_pass: when given, the key is encrypted with it
and the node is started with that password instead. Without it nothing
changes (same key as before); the output now says which password the
key is encrypted with.
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.

Add new password request when generating kew_owner

1 participant