tari-project / tari

The Tari protocol
https://tari.com
BSD 3-Clause "New" or "Revised" License
346 stars 214 forks source link

Duplicate words in mnemonic lists cause break language detection #3570

Closed sdbondi closed 2 years ago

sdbondi commented 2 years ago

Describe the bug Ref BIP039 Duplicate words breaks language detection. Detection currently assumes unique words in each language set. Suggest changing it to account for duplicates by considering more than one word in the seed until a single set is selected.

Duplicates:

---- cipher_seed::test::cipher_seed_to_and_from_mnemonic_with_passphrase stdout ----
thread 'cipher_seed::test::cipher_seed_to_and_from_mnemonic_with_passphrase' panicked at 'Couldn't create CipherSeed from Mnemonic: Mnemonic Error: `Only 2048 words for each language was selected to form Mnemonic word lists`', base_layer/key_manager/src/cipher_seed.rs:369:27
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

To Reproduce Steps to reproduce the behavior: Test in https://github.com/tari-project/tari/pull/3569

Expected behavior Language detection always works

delta1 commented 2 years ago

Was this fixed?

sdbondi commented 2 years ago

Fixed in #3607