BIP32.fromSeed constructor

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

From Seed

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") as Uint8List, seed);
  final il = I.sublist(0, 32);
  final ir = I.sublist(32);
  return BIP32.fromPrivateKey(il, ir, network);
}