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

Use the normalize_string function when reading mnemonic words #122

Merged
merged 1 commit into from
Jan 4, 2024

Conversation

nglsena0722
Copy link
Contributor

I created a mnemonic word using the to_mnemonic function of the module you created. However, I entered the mnemonic word as a parameter of the to_entropy function to regenerate a private key again later, but got a ValueError: myword is not in list.

As it turns out, the environment in which I type the mnemonic words used NFC method, and the module you created used the word in the NFKD method. Therefore, when reading the word in the to_entropy function, I suggest that it is always normalized with the NFKD method through the normalize_string function.

Thanks for reading this.

@prusnak prusnak closed this Jan 4, 2024
@prusnak prusnak reopened this Jan 4, 2024
@prusnak
Copy link
Member

prusnak commented Jan 4, 2024

@matejcik what do you think? Should we do this or is it a caller's responsibility to provide a valid NFKD input?

@matejcik
Copy link
Contributor

matejcik commented Jan 4, 2024

check() and to_seed() also do it so it seems consistent to do it here too

@prusnak prusnak merged commit 308aae0 into trezor:master Jan 4, 2024
5 of 6 checks passed
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.

3 participants