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

Refactor: Update Hierarchical Deterministic Key Derivation #2

Merged
merged 2 commits into from
Jun 24, 2023
Merged

Refactor: Update Hierarchical Deterministic Key Derivation #2

merged 2 commits into from
Jun 24, 2023

Conversation

teddyjfpender
Copy link
Contributor

Refactor: Update Hierarchical Deterministic Key Derivation

This pull request introduces improvements to the key derivation process in the context of Hierarchical Deterministic (HD) wallets. With the new modifications, the key derivation process could support multiple accounts, which is a crucial feature for users wishing to manage more than one account. The update also uses the defined hardened derivation paths.

The changes introduced in this PR are as follows:

  • Updated the deriveKeyPair function to accept an optional accountNumber parameter. If no account number is provided, the function defaults to account 0 (see vault.ts and hd.ts). This allows the key derivation process to generate keys for different accounts.

  • Added a new test to ensure that the deriveKeyPair function generates different keys for different account numbers (see hd.test.ts).

  • Updated the getHierarchicalDeterministicPath function to accept a MinaHDPath object which holds information about the account index, change, and index for generating the BIP44 path (see hd.ts).

  • Introduced the MinaHDPath, MinaKeyConst, and MinaPathLevelIndexes interfaces and constants in types.ts to facilitate HD path generation.

  • Refactored test cases to align with these changes (see hd.test.ts and vault.test.ts).

Have a look at the proposed changes; I appreciate any feedback or questions you may have 😄

@netlify
Copy link

netlify bot commented Jun 24, 2023

Deploy Preview for pallad canceled.

Name Link
🔨 Latest commit 348cff0
🔍 Latest deploy log https://app.netlify.com/sites/pallad/deploys/6496cc1b0b6f530008d58f08

@mrcnk mrcnk merged commit da5e2a7 into palladians:main Jun 24, 2023
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.

2 participants