Skip to content

[Bug] Phrases using common words between wordlists will fail unless passing lower index in Mnemonic.Words #3211

@dabura667

Description

@dabura667
English check OK:
abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon angle
French check OK:
abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon brave
both check OK:
abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon amateur double

Here are 3 phrases, all using only the common words of English and French.

One only checks OK on the English wordlist, one only checks OK on the French wordlist, and the last one checks OK on both lists.

Entering all three into Copay using the following locale settings will yield the following results:

'en':

  1. Pass
  2. Fail
  3. Pass

'fr':

  1. Pass
  2. Fail
  3. Pass

The expected behavior would be:

'en':

  1. Pass
  2. Fail
  3. Pass

'fr':

  1. Fail
  2. Pass
  3. Pass

Suggestion:
Depending on the locale of Copay, pass a wordlist to bitcore-mnemonic in this line:
https://github.com/bitpay/bitcore-wallet-client/blob/b342e6d8f9be23a904dbff3219028bc47a47e322/lib/credentials.js#L86
like this: var m = new Mnemonic(words, localewordlist);

There is a possibility (though very small) that a French phrase generated by Copay can not be recovered in Copay due to this. (Unless you are checking the mnemonic output again using Mnemonic.isValid() after generating.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions