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

Mnemonic whitespace separator deviates from reference implementation #29

Closed
gz-c opened this issue Feb 25, 2019 · 1 comment
Closed

Comments

@gz-c
Copy link

gz-c commented Feb 25, 2019

The use of strings.Fields in splitMnemonicWords allow more than one whitespace character between words.

https://golang.org/pkg/strings/#Fields

Fields splits the string s around each instance of one or more consecutive white space characters, as defined by unicode.IsSpace

The bip39 spec is not explicit about how words are to be separated.

The reference implementation uses a single space for the separator, after normalizing unicode to ascii:

https://github.com/trezor/python-mnemonic/blob/7d23efe34f3dd537996f31dae34f663207dac232/mnemonic/mnemonic.py#L153

@tyler-smith
Copy link
Owner

Thanks for this report! This should be tightened up in the spec. I think until 2.0 is done with real native multi language support it makes sense to stick to single spaces. I'll change this.

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

No branches or pull requests

2 participants