2

For import wallet by mnemonic phrase i use next code:

const seed = bip39.mnemonicToSeedSync(mnemonic_phrase, "");
const hd = HDKey.fromMasterSeed(seed.toString("hex"));
const keypair = Keypair.fromSeed(hd.derive(`m/44'/501'/0'/0'`).privateKey);

Additionally, I check the words in the phrase using the dictionary bip-0039.

In the phantom application, the seed phrase is somehow checked even if all the words of the seed phrase are in the dictionary.

How else can you check your seed phrase?

1 Answer 1

3

try something like:

if(bip39.validateMnemonic("test test test....junk") === true) { // do things }

1
  • 1
    bip39.ValidateMnemonic should be bip39.validateMnemonic
    – Leo Loki
    Commented Jan 16 at 11:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.