You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Apr 15, 2019. It is now read-only.
Expected behaviour
Code respects the fact that a word can occur more than one time in a BIP39 mnemonic.
Actual behaviour
Code assumes that a word occurs only once in a BIP39 mnemonic.
Steps to reproduce
Study BIP39 or run this code to convince yourself that there are valid mnemonics with a word occurring multiple times:
node double_word_finder.js
This runs for ~10 seconds and outputs something like
As you can see, we have a little over 3% mnemonics with at least one word occurring at lest 2 times.
Now we have this code:
https://github.com/LiskHQ/lisk-nano/blob/ab5aafe/src/components/passphrase/passphraseVerifier.js#L25
There the passphrase is split by a word. The rest of the code assumes this results in 2 parts:
https://github.com/LiskHQ/lisk-nano/blob/ab5aafe/src/components/passphrase/passphraseVerifier.js#L44
Now the problem is that the following nmemonic split by prevent
results in 3 parts.
Proposed solution: do not assume a word occurs only once and split by
index
(part 1: 0...index-1; part2: index+1…11).The text was updated successfully, but these errors were encountered: