-
Notifications
You must be signed in to change notification settings - Fork 155
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow accounts to be individually encrypted and unlocked #1823
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I set the account passphrase and looks like it worked, but if I unlock the account and try sending from it, I get a wallet passphrase error:
vctt@vctt:~/projects/decred/dcrctl$ go build && ./dcrctl --testnet --wallet unlockaccount default 123
vctt@vctt:~/projects/decred/dcrctl$ go build && ./dcrctl --testnet --wallet sendfrom default TsfDLrRkk9ciUuwfp2b8PawwnukYD7yAjGd 1
-13: enter the wallet passphrase with walletpassphrase first
ff1b9fe
to
52516aa
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested and worked fine. LGTM.
One thing I noticed is that right now is not possible to know which accounts is locked or not, or an easy way to lock all accounts.
I think it would be nice to have it.
That's a good suggestion. Unfortunately the most sensible RPC to add this to (listaccounts) would need a breaking change to the response format to support something like this. |
the account properties (returned by w.Accounts) now includes if the account has a per-account passphrase set on it, and whether it is locked or unlocked, which should be useful for the grpc server since it does return this data directly (unlike jsonrpc). |
c203d20
to
9763fe4
Compare
3007699
to
82e422e
Compare
This commit introduces three new RPCs (setaccountpassphrase, unlockaccount, and lockaccount) which can be used to set a unique passphrase for and allow individual locking of particular accounts, separate from the global keys used to encrypt all other accounts. Argon2id is used as the KDF for individually encrypted accounts, and XChaCha20-Poly1305 is used for authenticated encryption of account xprivs. The new KDF parameters use the same memory difficulty (256M) as the scrypt parameters used for all other accounts.
0254399
to
88b3d61
Compare
This commit introduces three new RPCs (setaccountpassphrase,
unlockaccount, and lockaccount) which can be used to set a unique
passphrase for and allow individual locking of particular accounts,
separate from the global keys used to encrypt all other accounts.
Argon2id is used as the KDF for individually encrypted accounts, and
XChaCha20-Poly1305 is used for authenticated encryption of account
xprivs. The new KDF parameters use the same memory difficulty (256M)
as the scrypt parameters used for all other accounts.