Skip to content
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

wid primary should be password-protected #236

Closed
chikeichan opened this issue Oct 17, 2020 · 1 comment
Closed

wid primary should be password-protected #236

chikeichan opened this issue Oct 17, 2020 · 1 comment

Comments

@chikeichan
Copy link
Contributor

chikeichan commented Oct 17, 2020

Related to multi-account #233

The wid primary is automatically created on start up by hsd and is an unencrypted wallet, meaning that user can "login" with any password.

We should not allow users to use this wallet. I think a simple way to handle it would be:

  • filter wallet ids by encrypted === true in wallet/service.js
  • disallow primary from frontend
  • default wid during onboarding to main

If we can remove wallet by id later, we can re-allow the primary wid by remove the existing primary before creating the primary wallet again

This was referenced Oct 19, 2020
@pinheadmz
Copy link
Contributor

You might have discovered already but hsd doesn't like to remove the primary wallet: https://github.com/handshake-org/hsd/blob/c85d9b4c743a9e1c9577d840e1bd20dee33473d3/lib/wallet/walletdb.js#L1001-L1002

I think for new users with a multiwallet Bob, just onboarding by getting a passphrase and encrypting primary is a good strategy. But for users who want to upgrade existing Bob wallets or import a phrase (from the airdrop for example) this will result in an unused primary wallet which may confuse users and so perhaps hiding that wallet makes sense. We just should make sure that users can't accidentally access that wallet, and ensure that Bob wont accidentally get a receive address from primary, etc. Because we know the user won't have the seed backed up.

I think bitcoin core recently disabled their version of the "primary" wallet and it might be worth looking in to a similar patch for hsd.

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

No branches or pull requests

2 participants