-
Notifications
You must be signed in to change notification settings - Fork 725
[Wallet] HD Wallet - v2. #1327
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
[Wallet] HD Wallet - v2. #1327
Conversation
Fuzzbawls
left a comment
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.
Not an in-depth review, but a reminder of a previously discussed topic.
looks like init.cpp's help message was changed previously (and in error, at the time) to reflect a much smaller number of default keypairs. but now that keypairs are tied to a deterministic "seed", there is no real benefit in pre-generating 1000 keypairs.
18b3a6b to
3549d2a
Compare
random-zebra
left a comment
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.
Code ACK with few questions.
Fantastic job 🍻
Will give it some more live testing.
src/wallet/rpcdump.cpp
Outdated
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.
guess this can be else if too
|
This change is pretty important and user-facing so, imo, there should be a separate paragraph for it in the release notes (with indications for upgrade/backup best practice).
|
|
Updated following @random-zebra' comments 👌 . |
e45d2c2 to
ff77b5a
Compare
ff77b5a to
f9e929c
Compare
|
I skipped the last comment, sorry. Yeah @random-zebra, will write a separate release notes section for this. Agree that it's needed. |
Fuzzbawls
left a comment
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.
couple styling changes, and a question
Fuzzbawls
left a comment
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.
looks like some missing upgrade functionality
|
is there any method to extract the mnemonic via the rpc commands if any? |
|
@akshaynexus there is no mnemonic. BIP39 was not implemented. If you meant the seed, you can export it calling |
|
Oh ok |
50ee7cb to
ff2fefa
Compare
|
Upgrade wallet from non-HD to HD functional test included, PR details updated. All good, travis passing. |
… convention. [Test] bip32_tests key.SetSeed() changed to the new SetMaster refactor
ff2fefa to
5748d39
Compare
|
PR rebased, had conflicts after #1337 merge. |
random-zebra
left a comment
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.
Few nits here and there. Think this is pretty close to merge. Still missing release notes
random-zebra
left a comment
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.
Good opportunity to fix the paths in wallet_dump.py as well.
…her old comments cleanup.
29f040c to
1cccdea
Compare
|
PR updated with the release notes. Let me know about any typo or needed change there. |
|
Seems like there may have been some commits left out. Reading your changes to the release notes; i'm not seeing anything during running or code review that adds a new topbar icon or a GUI notification of running a non-HD wallet. There also isn't the |
|
@Fuzzbawls yes, working in another branch. I just cherry-picked the release notes change here to merge this PR and not continue making it bigger. |
random-zebra
left a comment
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.
sethdseed can't be used with arguments at the moment, as it doesn't interpret the first one as boolean.
Need to add {"sethdseed", 0} to vRPCConvertParams in rpc/client.cpp
|
@random-zebra done. |
|
Yes, this looks quite good by now. I think it can be merged and anything else can be addressed in successive pull requests. |
random-zebra
left a comment
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.
ACK 818dac7
Fuzzbawls
left a comment
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.
ACK 818dac7
0e969f1 [GUI] Launch upgrade wallet dialog at the wallet's startup. (furszy) 7c468ce [Trivial] Method brackets jump lines. (furszy) 42ed283 [GUI] Upgrade wallet to HD functionality connected. (furszy) c29d34e [GUI] isHDEnabled & upgradeWallet methods created. (furszy) Pull request description: This was built on top of PIVX-Project#1399. Essentially connecting the HD wallet upgrade to the GUI as it was defined in the release-notes in PIVX-Project#1327. ACKs for top commit: random-zebra: ACK 0e969f1 Fuzzbawls: ACK 0e969f1 Tree-SHA512: 8d6ee4a5c53b2bead2303b8fd241ef7404ee5cb62599118e3328073b7ce6b5b63d7555bb5d26e5d3b266514476d81d1deb3f42c738216ea788c87babc019cf88
HD Wallet implementation (BIP44 derivation path) streamlined to upstream flow and db object's serialization storage.
Summarizing few important changes of this work:
Restructured over latest upstream's architecture.
Meaning that this new wallet code organization will make easier most of the upcoming backports, having it as the base structure for every feature that we have and new ones that we will be implementing. Introducing the ScriptPubKeyMan (short for ScriptPubKeyManager) for managing scriptPubKeys and their associated scripts and keys, more information about the wallet class architecture can be found here and here.
Supporting pre and post HD wallet keys.
This means that old wallets that want to upgrade to HD wallet, can do it directly within the wallet. No need to move the balance to a fresh new wallet. Can import single private keys too, the wallet will continue storing and managing them in parallel of the hd seed derived keys.
Key Metadata Upgrade
The key metadata has been upgraded to support key origin (hd path) and the hd seed identifier.
HD Master Seed.
The master seed is being managed by the keystore, same as with new and old keys (Single flow for both of them).
Staking addresses derivation path.
The "change" level in the BIP44 definition has been extended to support staking addresses generation. We will have three different purposes:
A really short view of the HD classes structure:
Upgrade to HD wallet flow.
The automatic upgrade can be done starting the node with the flag
-upgradewalletor going to settings and pressing on the Upgrade Wallet button.RPC commands:
New commands:
sethdseedset a new HD wallet seed.getaddressinfoobtains the address information, including the key derivation path.Upgraded commands:
dumpwallet: HD wallet export included into the flow.Tests:
Most of the previous functional test has been upgraded to support and verify HD functionality.
New functional test created:
Next PRs
wallet.h/cppcleanup. Continue decoupling the keys/scripts management to the SPKM box. (This work will need several PRs more).