privateKeyBytes function

Uint8List privateKeyBytes(
  1. String mnemonic,
  2. [String hdPath = DEFAULT_HD_PATH]
)

Returns a byte array representation of the private key derived from the current mnemonic

Implementation

Uint8List privateKeyBytes(String mnemonic, [String hdPath = DEFAULT_HD_PATH]) {
  final seed = bip39.mnemonicToSeedHex(mnemonic);
  final root = bip32.BIP32.fromSeed(HEX.decode(seed));
  final child = root.derivePath(hdPath);
  return child.privateKey;
}