CRYPTO NEWS

How to convert mnemonic to 32 byte seed?

I have a 24-word mnemonic, and I want to convert it to public and private keys.

This is how I did it:

  const hex = HexCoder.instance;

  final seed = bip39.mnemonicToSeedHex(_mnmonic);

  final algorithm = Ed25519();

  // The hex.decode(seed) have 64 bytes lengths.
  final keyPair = await algorithm.newKeyPairFromSeed(hex.decode(seed));

  final newPublicKey = await keyPair.extractPublicKey();

But I get this error:

ArgumentError (Invalid argument(s): Seed must have 32 bytes)

What am I missing?

How to convert mnemonic to 32 byte seed?

Shopping cart
There are no products in the cart!
Continue shopping
0