ed25519 HD Key

Key Derivation for ed25519

Ported from ed25519-hd-key js library

SLIP-0010 - Specification

Usage

import "package:hex/hex.dart";
import "package:ed25519_hd_key/ed25519_hd_key.dart";

void main() {
  String hexSeed =
      'fffcf9f6f3f0edeae7e4e1dedbd8d5d2cfccc9c6c3c0bdbab7b4b1aeaba8a5a29f9c999693908d8a8784817e7b7875726f6c696663605d5a5754514e4b484542';
  KeyData master = ED25519_HD_KEY.getMasterKeyFromSeed(hexSeed);
  print(HEX.encode(master.key)); // 171cb88b1b3c1db25add599712e36245d75bc65a1a5c9e18d76f9f2b1eab4012
  print(HEX.encode(master.chainCode)); // ef70a74db9c3a5af931b5fe73ed8e1a53464133654fd55e7a66f8570b8e33c3b

  KeyData data = ED25519_HD_KEY.derivePath("m/0'/2147483647'", hexSeed);
  var pb = ED25519_HD_KEY.getBublickKey(data.key);
  print(HEX.encode(data.key)); // ea4f5bfe8694d8bb74b7b59404632fd5968b774ed545e810de9c32a4fb4192f4
  print(HEX.encode(data.chainCode)); // 138f0b2551bcafeca6ff2aa88ba8ed0ed8de070841f0c4ef0165df8181eaad7f
  print(HEX.encode(pb)); // 005ba3b9ac6e90e83effcd25ac4e58a1365a9e35a3d3ae5eb07b9e4d90bcf7506d
}

References

SLIP-0010

BIP-0032

BIP-0044

Libraries

ed25519_hd_key