0 purchases
slip 0010 ed25519
Dart SLIP-0010 ed25519 HD Key #
Forked from https://github.com/alepop/dart-ed25519-hd-key with the async code removed.
Key Derivation for ed25519 #
SLIP-0010 - Specification
Usage #
import "package:ed25519_hd_key/slip_0010_ed25519.dart";
import 'package:convert/convert.dart';
void main() async {
String hexSeed =
'fffcf9f6f3f0edeae7e4e1dedbd8d5d2cfccc9c6c3c0bdbab7b4b1aeaba8a5a29f9c999693908d8a8784817e7b7875726f6c696663605d5a5754514e4b484542';
List<int> seedBytes = hex.decode(hexSeed);
KeyData master = await ED25519_HD_KEY.getMasterKeyFromSeed(seedBytes);
print(hex.encode(master.key)); // 171cb88b1b3c1db25add599712e36245d75bc65a1a5c9e18d76f9f2b1eab4
print(hex.encode(master.chainCode)); // ef70a74db9c3a5af931b5fe73ed8e1a53464133654fd55e7a66f8570b8e33c3b
KeyData data = await ED25519_HD_KEY.derivePath("m/0'/2147483647'", seedBytes);
print(hex.encode(data.key)); // ea4f5bfe8694d8bb74b7b59404632fd5968b774ed545e810de9c32a4fb4192f4
print(hex.encode(data.chainCode)); // 138f0b2551bcafeca6ff2aa88ba8ed0ed8de070841f0c4ef0165df8181eaad7f
var pb = await ED25519_HD_KEY.getPublicKey(data.key);
print(hex.encode(pb)); // 005ba3b9ac6e90e83effcd25ac4e58a1365a9e35a3d3ae5eb07b9e4d90bcf7506d
}
copied to clipboard
Koala Wallet Users #
See example/kadena_koala_derivation.dart for an example on how to export your private key from your 24-word recovery phrase.
References #
SLIP-0010
BIP-0032
BIP-0044
For personal and professional use. You cannot resell or redistribute these repositories in their original state.
There are no reviews.