ed25519-hd-key
BIP-0032 like derivation for ed25519 curve
Last updated 7 months ago by alepop .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ npm install ed25519-hd-key 
SYNC missed versions from official npm registry.

BuyMeACoffee codecov

ed25519 HD Key

Version 2.0.0

I've rebuilt the library from the ground up for version 2.0.0. It now uses @noble/ed25519 and @noble/hashes. These libraries are faster, audited, and cleaner.

If you need to use tweetnacl, you can stick with version 1.3.0.

Key Derivation for ed25519

SLIP-0010 - Specification

Installation

npm i --save ed25519-hd-key

Usage

example:

const { derivePath, getMasterKeyFromSeed, getPublicKey } = 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

console.log(getPublicKey(key).toString('hex'))
// => 005ba3b9ac6e90e83effcd25ac4e58a1365a9e35a3d3ae5eb07b9e4d90bcf7506d

Tests

npm test

References

SLIP-0010

BIP-0032

BIP-0044

Current Tags

  • 2.0.0                                ...           latest (7 months ago)

9 Versions

  • 2.0.0                                ...           7 months ago
  • 1.3.0                                ...           4 years ago
  • 1.2.1                                ...           4 years ago
  • 1.2.0                                ...           6 years ago
  • 1.1.2                                ...           7 years ago
  • 1.1.1                                ...           7 years ago
  • 1.1.0                                ...           7 years ago
  • 1.0.0                                ...           9 years ago
  • 0.5.0                                ...           9 years ago
Maintainers (1)
Downloads
Total 34
Today 0
This Week 0
This Month 26
Last Day 0
Last Week 0
Last Month 8
Dependencies (2)
Dev Dependencies (7)
Dependents (1)

© 2010 - cnpmjs.org x YWFE | Home | YWFE