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

dex/keygen: use ChildBIP32Std for extended key derivation #1341

Merged
merged 1 commit into from Dec 17, 2021

Conversation

chappjc
Copy link
Member

@chappjc chappjc commented Dec 9, 2021

Requires decred/dcrd#2845
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

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.
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.

Good stuff, @chappjc!

@chappjc chappjc merged commit c54f8d1 into decred:master Dec 17, 2021
@chappjc chappjc deleted the bip32std-child branch December 17, 2021 17:00
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.

hdkeychain private key padding/length decision
3 participants