JSPM

@hawkingnetwork/ed25519-hd-key-rn

1.0.1
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 73
  • Score
    100M100P100Q84753F
  • License GPL-3

Adapted for React Native compatibility from https://github.com/alepop/ed25519-hd-key

Package Exports

  • @hawkingnetwork/ed25519-hd-key-rn

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@hawkingnetwork/ed25519-hd-key-rn) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

ed25519 HD Key React Native

Key Derivation for ed25519

SLIP-0010 - Specification

Installation

npm i --save @hawkingnetwork/ed25519-hd-key-rn

Usage

example:

const { derivePath, getMasterKeyFromSeed } = require("ed25519-hd-key");
const hexSeed =
  "fffcf9f6f3f0edeae7e4e1dedbd8d5d2cfccc9c6c3c0bdbab7b4b1aeaba8a5a29f9c999693908d8a8784817e7b7875726f6c696663605d5a5754514e4b484542";

const { key, chainCode } = getMasterKeyFromSeed(hexSeed);
console.log(key.toString("hex"));
// => 2b4be7f19ee27bbf30c667b642d5f4aa69fd169872f8fc3059c08ebae2eb19e7
console.log(chainCode.toString("hex"));
// => 90046a93de5380a72b5e45010748567d5ea02bbf6522f979e05c0d8d8ca9fffb

const { key, chainCode } = derivePath("m/0'/2147483647'", hexSeed);

console.log(key.toString("hex"));
// => ea4f5bfe8694d8bb74b7b59404632fd5968b774ed545e810de9c32a4fb4192f4
console.log(chainCode.toString("hex"));
// => 138f0b2551bcafeca6ff2aa88ba8ed0ed8de070841f0c4ef0165df8181eaad7f

Tests

npm test

References

SLIP-0010

BIP-0032

BIP-0044