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 ?? _finalBitcoin;
  final i = hmacSHA512(utf8.encode("Bitcoin seed") as Uint8List, seed);
  final il = i.sublist(0, 32);
  final ir = i.sublist(32);
  return BIP32.fromPrivateKey(il, ir, network);
}