Bip32.fromSeed constructor
Bip32.fromSeed(
- Uint8List seed, [
- 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') as Uint8List, seed);
final il = i.sublist(0, 32);
final ir = i.sublist(32);
return Bip32.fromPrivateKey(il, ir, network);
}