toSeed static method

Uint8List toSeed(
  1. String mnemonic, {
  2. String passphrase = "",
})

Derives a cryptographic seed from a BIP-39 mnemonic and an optional passphrase.

This method takes a BIP-39 mnemonic phrase and an optional passphrase and uses them to derive a cryptographic seed. The passphrase is typically empty or a user-defined value. The resulting seed can be used for generating private keys and addresses.

Parameters:

  • mnemonic: The BIP-39 mnemonic phrase.
  • passphrase: An optional passphrase (default is an empty string).

Returns: A cryptographic seed as a Uint8List.

Implementation

static Uint8List toSeed(String mnemonic, {String passphrase = ""}) {
  final String salt = "mnemonic$passphrase";
  return pbkdfDeriveDigest(mnemonic, salt);
}