libbitcoin/libbitcoin-explorer

electrum-new command uses bip39 dictionaries.

Closed this issue · 2 comments

I discovered this because --language pt was not parsing when I added a test for it. Portuguese isn't in the bip-39 dictionaries but is in the Electrum dictionaries.

        (
            "language,l",
            value<explorer::config::language>(&option_.language),
            "The language identifier of the mnemonic dictionary to use. Options are 'en', 'es', 'pt', 'ja', 'zh_Hans' and 'any', defaults to 'en'."
        )

The explorer::config::language class returns a selection of bip39 dictionaries. This is a distinct set from Electrum, but has overlapping members, allowing the previous set of tests to pass. The bip39 and Electrum en and zh_Hans dictionaries are identical, but es is distinct, with overlapping words.

https://github.com/libbitcoin/libbitcoin-explorer/blob/master/include/bitcoin/explorer/commands/electrum-new.hpp#L161

This code is in master, so not supported. But a rollback to this bug should allow for key recovery if anyone has used it live.

Once this is resolved we will need to ensure we have test coverage in both commands for all languages and prefixes (including old) and verify each against Electrum.

I removed pt and reconciled dictionaries with electrum and bip39 repos.