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

[release-v0.4] dex/keygen: use ChildBIP32Std for extended key derivation #1350

Merged
merged 1 commit into from Dec 17, 2021

Conversation

chappjc
Copy link
Member

@chappjc chappjc commented Dec 14, 2021

This is #1341 for the release-v0.4 branch.
Requires #1349, which updates the go.mods first.

Updates the github.com/decred/dcrd/hdkeychain/v3 require to v3.1.0.

WARNING: Keys derived from the app seed are likely to be different with the updated strict BIP32 HD key derivation. This includes

  • DEX accounts
  • Any keys derived by Wallets such as in client/asset/eth where it prepares a private key for the BIP44 path m/44'/60'/0'/0/0
    As such, you should not rely on any of these accounts or keys being recoverable.

This updates the GenDeepChild helper, which is used in both client/core to setup DEX account keys from the app seed, and in client/asset/eth to derive the account private key from the wallet seed.

This is especially in the eth key derivation, where the intent is to follow BIP44 with the path m/44'/60'/0'/0/0, which requires generating child keys as per BIP32 strictly.

For generating DEX account keys from the app seed, it is also good from a standardness point of view to use strict BIP32 derivation. The legacy derivation is only required for Decred wallets for compatibility.

Resolves #1337
This eliminates the occasional error from client/asset/eth.CreateWallet

@chappjc chappjc added this to the 0.4 milestone Dec 14, 2021
Copy link
Member

@buck54321 buck54321 left a comment

Choose a reason for hiding this comment

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

Approved on 16850ed...c0e6e1c

This updates the GenDeepChild helper, which is used in both client/core
to setup DEX account keys from the app seed, and in client/asset/eth to
derive the account private key from the wallet seed.

This is especially in the eth key derivation, where the intent is to
follow BIP44 with the path m/44'/60'/0'/0/0, which requires generating
child keys as per BIP32 strictly.

For generating DEX account keys from the app seed, it is also good from
a standardness point of view to use strict BIP32 derivation.  The legacy
derivation is only required for Decred wallets for compatibility.
@chappjc chappjc merged commit 2df3b4b into decred:release-v0.4 Dec 17, 2021
@chappjc chappjc deleted the bip32std-child-0-4 branch December 17, 2021 17:09
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

Successfully merging this pull request may close these issues.

None yet

3 participants