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

Implement BIP39 (Mnemonic code for generating deterministic keys) #641

Merged
merged 59 commits into from
Dec 11, 2019

Conversation

levonpetrosyan93
Copy link
Contributor

@levonpetrosyan93 levonpetrosyan93 commented Aug 26, 2019

Fixes #732
Implementation of #559

https://github.com/bitcoin/bips/blob/master/bip-0039.mediawiki

High level summary:

  • 12 and 24 words supported

  • passphrase supported but optional.

  • By default, new wallets will be created with mnemonic. Users can choose to disable a mnemonic wallet with usemnemonic=0.

  • In zcoind a 24 word mnemonic with no passphrase is created by default. This is also the default setting at the Qt screen

  • Qt users are shown the mnemonic page on startup, if:

    • new wallet being created
    • usemnemonic=1 (default. meaning the page is not shown if usemnemonic=0 passed)
  • importwallet and importprivkey block with a mnemonic enabled wallet. A suggestion is given to create a non-mnemonic wallet if import is need. The purpose of this is to have a single mnemonic backup that is not complicated by other imports. (The keys would still import into the wallet if this check was removed, but presumably whoever was to do this would be aware of the repercussions).

  • conf setting interactions are handled

  • This PR also removes the code that creates a new Master key following encryption, either for a mnemonic wallet or older BIP32/44 wallets. This feature was introduced by us when Zcoin launched (ie. it was not a feature of Bitcoin 0.13 or any other version ); it provides no extra security benefit and only complicates the wallet code. Warning messages have been updated to reflect this change.

@reubenyap reubenyap added this to the v0.13.8.5 milestone Aug 26, 2019
src/wallet/wallet.cpp Outdated Show resolved Hide resolved
src/wallet/hdchain.cpp Outdated Show resolved Hide resolved
src/wallet/hdchain.cpp Outdated Show resolved Hide resolved
src/wallet/wallet.cpp Show resolved Hide resolved
src/wallet/wallet.cpp Outdated Show resolved Hide resolved
src/wallet/rpcdump.cpp Outdated Show resolved Hide resolved
src/wallet/wallet.cpp Outdated Show resolved Hide resolved
src/wallet/rpcwallet.cpp Outdated Show resolved Hide resolved
riordant
riordant previously approved these changes Sep 24, 2019
@qashban4
Copy link

qashban4 commented Sep 24, 2019

@levonpetrosyan93 changes delivered as per Peter request?
@ultimaweapon can you review

@lgtm-com
Copy link

lgtm-com bot commented Dec 5, 2019

This pull request introduces 3 alerts when merging 214a027 into beb6440 - view on LGTM.com

new alerts:

  • 1 for Commented-out code
  • 1 for For loop variable changed in body
  • 1 for Sign check of bitwise operation

@lgtm-com
Copy link

lgtm-com bot commented Dec 5, 2019

This pull request introduces 3 alerts when merging de82923 into 955e971 - view on LGTM.com

new alerts:

  • 1 for Commented-out code
  • 1 for For loop variable changed in body
  • 1 for Sign check of bitwise operation

@lgtm-com
Copy link

lgtm-com bot commented Dec 5, 2019

This pull request introduces 3 alerts when merging 3e4f166 into 955e971 - view on LGTM.com

new alerts:

  • 1 for Commented-out code
  • 1 for For loop variable changed in body
  • 1 for Sign check of bitwise operation

riordant
riordant previously approved these changes Dec 6, 2019
@lgtm-com
Copy link

lgtm-com bot commented Dec 6, 2019

This pull request introduces 3 alerts when merging 2fb4062 into 955e971 - view on LGTM.com

new alerts:

  • 1 for Commented-out code
  • 1 for For loop variable changed in body
  • 1 for Sign check of bitwise operation

Copy link
Contributor

@psolstice psolstice left a comment

Choose a reason for hiding this comment

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

GUI still have problems, mnemonic confirmation screen feels like it's mandatory although it's not

@lgtm-com
Copy link

lgtm-com bot commented Dec 7, 2019

This pull request introduces 3 alerts when merging 0ec3fe6 into 955e971 - view on LGTM.com

new alerts:

  • 1 for Commented-out code
  • 1 for For loop variable changed in body
  • 1 for Sign check of bitwise operation

@lgtm-com
Copy link

lgtm-com bot commented Dec 10, 2019

This pull request introduces 3 alerts when merging b0f6cb4 into 0398e70 - view on LGTM.com

new alerts:

  • 1 for Commented-out code
  • 1 for For loop variable changed in body
  • 1 for Sign check of bitwise operation

riordant
riordant previously approved these changes Dec 10, 2019
@lgtm-com
Copy link

lgtm-com bot commented Dec 10, 2019

This pull request introduces 3 alerts when merging 7f9f1c4 into 0398e70 - view on LGTM.com

new alerts:

  • 1 for Commented-out code
  • 1 for For loop variable changed in body
  • 1 for Sign check of bitwise operation

@lgtm-com
Copy link

lgtm-com bot commented Dec 11, 2019

This pull request introduces 3 alerts when merging 424dfa4 into 0398e70 - view on LGTM.com

new alerts:

  • 1 for Commented-out code
  • 1 for For loop variable changed in body
  • 1 for Sign check of bitwise operation

@riordant riordant merged commit ef6f16d into master Dec 11, 2019
@riordant riordant deleted the mnemonic branch December 11, 2019 09:52
@reubenyap reubenyap modified the milestones: v0.13.8.6, 13.8.10 Dec 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Ensure that the wallet does not change its hd masterkey upon encryption
9 participants