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
Merged

Conversation

@levonpetrosyan93
Copy link
Contributor

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
@reubenyap reubenyap added this to Needs review in Zcoin Core via automation 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 and others added 5 commits Sep 19, 2019
@qashban4

This comment has been minimized.

Copy link

qashban4 commented Sep 24, 2019

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

@riordant riordant force-pushed the mnemonic branch from 214a027 to de82923 Dec 5, 2019
@lgtm-com

This comment has been minimized.

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
@levonpetrosyan93 levonpetrosyan93 requested a review from riordant Dec 5, 2019
@lgtm-com

This comment has been minimized.

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
@lgtm-com

This comment has been minimized.

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 left a comment

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

@lgtm-com

This comment has been minimized.

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
@levonpetrosyan93 levonpetrosyan93 requested a review from psolstice Dec 9, 2019
@lgtm-com

This comment has been minimized.

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
@lgtm-com

This comment has been minimized.

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

This comment has been minimized.

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
Zcoin Core automation moved this from Needs review to Reviewer approved Dec 11, 2019
@riordant riordant merged commit ef6f16d into master Dec 11, 2019
4 checks passed
4 checks passed
LGTM analysis: JavaScript No code changes detected
Details
LGTM analysis: C/C++ 3 new alerts
Details
LGTM analysis: Python No new or fixed alerts
Details
continuous-integration/jenkins/pr-merge This commit looks good
Details
Zcoin Core automation moved this from Reviewer approved to Done Dec 11, 2019
@riordant riordant deleted the mnemonic branch Dec 11, 2019
@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
You can’t perform that action at this time.