BIP32.fromSeed constructor

BIP32.fromSeed(
  1. Uint8List seed, [
  2. NetworkType? nw
])

Implementation

factory BIP32.fromSeed(Uint8List seed, [NetworkType? nw]) {
  if (seed.length < 16) {
    throw ArgumentError("Seed should be at least 128 bits");
  }
  if (seed.length > 64) {
    throw ArgumentError("Seed should be at most 512 bits");
  }
  NetworkType network = nw ?? _BITCOIN;
  final I = hmacSHA512(utf8.encode("Bitcoin seed"), seed);
  final IL = I.sublist(0, 32);
  final IR = I.sublist(32);
  return BIP32.fromPrivateKey(IL, IR, network);
}