2

I'm developing a Hedera Wallet for Flutter, and I need to convert the mnemonic to the private key.

I use the bip39 to convert the mnemonic to seed.

But how can I convert the seed to the PrivateKey?

Hossein Yousefpour
  • 3,827
  • 3
  • 23
  • 35

1 Answers1

3

As per documentation here https://docs.hedera.com/hedera/sdks-and-apis/sdks/keys/recover-keys-from-a-mnemonic-phrase:

//Use a recovered mnemonic to recover the private key
const recoveredMnemonic = await Mnemonic.fromString(mnemonic.toString());
const privateKey = await recoveredMnemonic.toPrivateKey();

//v2.0.5
Serg Metelin
  • 1,094
  • 7
  • 22