Skip to content

Support 12-word (128 bit) BIP39 mnemonic strings #27

@lemois-1337

Description

@lemois-1337

What it is?
Currently we support in karlsenwallet only 256 bit BIP39 mnemonics. The bit size is configured at:

const bip39BitSize = 256

Why it is needed?
It would be very beneficial for the user to specify the entropy (bit size) during wallet creation and/or import to make it portable and allow using it in paper wallet, mobile wallet, web wallet and Node.js CLI wallet. At the end we will support 12- and 24-word mnemonics in all wallet implementations to get full interoperability.

How it should be implemented?
We need to add a new CLI parameter --entropy to the create command for the following operations.

  1. Creation of the wallet:
    karlsenwallet create --entropy 128 will create wallet with 12-word seed phrase
    karlsenwallet create --entropy 256 will create wallet with 24-word seed phrase

  2. Import of the wallet
    karlsenwallet create --import --entropy 128 will import wallet with 12-word seed phrase
    karlsenwallet create --import --entropy 256 will import wallet with 24-word seed phrase

  3. Dump of the mnemonic
    karlsenwallet dump-unencrypted-data will dump the mnemonic either in 12- or 24-word.

The create -h command must be extended as well to explain entropy difference

Additional Information
https://github.com/tyler-smith/go-bip39

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions