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

Accept BIP-39 mnemonic phrase as Uint8Array #107

Merged
merged 4 commits into from
Jan 18, 2023

Conversation

Mrtenz
Copy link
Member

@Mrtenz Mrtenz commented Jan 17, 2023

This adds support for passing mnemonic phrases as Uint8Array, in all places where we accept them. The expected format is the same as the format we use in @metamask/scure-bip39.

The derivation path can now look like [new Uint8Array(), 'bip32:...', ...]. Only the first BIP-39 segment can be a Uint8Array, it's not supported for BIP-32 segments.

Closes #106.

src/BIP44CoinTypeNode.test.ts Show resolved Hide resolved
src/BIP44Node.test.ts Show resolved Hide resolved
src/SLIP10Node.test.ts Show resolved Hide resolved
src/derivation.ts Show resolved Hide resolved
src/utils.ts Show resolved Hide resolved
@Mrtenz Mrtenz marked this pull request as ready for review January 18, 2023 10:45
@Mrtenz Mrtenz requested a review from a team as a code owner January 18, 2023 10:45
src/utils.ts Show resolved Hide resolved
src/SLIP10Node.test.ts Show resolved Hide resolved
src/derivation.test.ts Show resolved Hide resolved
src/derivation.ts Show resolved Hide resolved
@Mrtenz Mrtenz merged commit f4c6747 into main Jan 18, 2023
@Mrtenz Mrtenz deleted the mrtenz/mnemonic-as-uint8array branch January 18, 2023 11:10
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.

Support mnemonics being passed as Uint8Array
2 participants