Bip32Base.fromSeed constructor

Bip32Base.fromSeed(
  1. List<int> seedBytes, [
  2. Bip32KeyNetVersions? keyNetVer
])

Creates a BIP-32 key from a seed.

The seedBytes parameter is used to generate a master key, and the optional keyNetVer specifies the key network version.

Implementation

Bip32Base.fromSeed(List<int> seedBytes, [Bip32KeyNetVersions? keyNetVer]) {
  seedBytes = seedBytes.asImmutableBytes;
  keyNetVer ??= defaultKeyNetVersion;
  final result = masterKeyGenerator.generateFromSeed(seedBytes);
  final keyData = Bip32KeyData(chainCode: Bip32ChainCode(result.item2));
  _privKey = _initializePrivateKey(
      result.item1, null, keyData, keyNetVer, curveType);
  _pubKey =
      _initializePublicKey(result.item1, null, keyData, keyNetVer, curveType);
}