Construct a NodeEd25519
object.
The chain code of the node (32 bytes).
The network of the node
Hardened key derivation uses HIGHEST_BIT.
Getter for the depth
of the key.
Getter for the fingerprint
of the key.
The fingerprint are the first 4 bytes of the identifier of the key.
Getter for the identifier
of the key.
The identifier is build as follows:
Getter for the index
(account index) of the key.
Getter for the parentFingerprint
parent fingerprint of the key.
Getter for the privateKey
of the key.
Getter for the publicKey
of the key.
Derive a child node with index
.
When the node is not neutered, an extended private key will be created and when the node is neutered, an extended public key will be created.
This method is an overload of the bitcoinjs/bip32
package's derive
method adapted to use our child
key derivation functions CKDPriv
and CKDPub
.
Hardened child derivation (derives private key).
Generic child derivation.
This method reads the derivation paths and uses derive
and deriveHardened
accordingly.
Derivation paths starting with m/
are only possible
with master nodes (for example created from seed).
Getter for private field __D
.
This method is added to explicitely expose the
__D
field to allow sub-classes to make
use of it.
The __D
field represents the private key.
Getter for private field depth
.
This method is added to explicitely expose the
depth
field to allow sub-classes to make
use of it.
Getter for private field index
.
This method is added to explicitely expose the
index
field to allow sub-classes to make
use of it.
Getter for private field parentFingerprint
.
This method is added to explicitely expose the
parentFingerprint
field to allow sub-classes to make
use of it.
Getter for private field __Q
.
This method is added to explicitely expose the
__Q
field to allow sub-classes to make
use of it.
The __Q
field represents the public key.
Return whether the node is neutered or not.
Neutered keys = Extended Public Keys Non-Neutered keys = Extended Private Keys
Validate a BIP32/BIP44 path by regular expression.
Get the neutered node.
Sign binary data with current node.
Overloads the bitcoinjs/bip32
method named sign
in order to
be ED25519 compliant and use tweetnacl
with ed25519 instead
of secp256k1.
The binary data to sign.
Get the Base58 representation of said key.
This method is modified to use the Network
class to
determine privateKey and publicKey prefixes (version field).
The Base58 representation is laid on 78 bytes with following
specification (with ||
concatenation operator) :
version || depth || parent || index || chain code || priv/pub
Private keys are prepended with 0x00
, public keys are encoded
in X9.62 format.
Verify a signature signature
for data
hash
with the current node.
Overloads the bitcoinjs/bip32
method named verify
in order to
be ED25519 compliant and use tweetnacl
with ed25519 instead
of secp256k1.
The binary data that was supposedly signed.
The signature binary data that needs to be verified.
Returns true for a valid signature, false otherwise.
Decode a base58 extended key payload into its'
NodeEd25519
object representation.
This method parses the base58 binary data and uses read fields to initialize a BIP32-ED25519 hyper-deterministic node.
No ED25519 changes have been done here.
The base58 payload of the extended key.
(Optional) The network of the key.
Create a hyper-deterministic ED25519 node from a binary seed.
Depending on the curve algorithm, the seed is prepended with one of:
ed25519 seed
for ed25519[-sha512] implementation (Network.SYMBOL)Generated using TypeDoc
Class
NodeEd25519
describes a hyper-deterministic BIP32 node implementation, compatible with ed25519 EC-curve.It is an implementation of BIP32 that is adapted to work with ED25519 ellyptic curve keys rather than secp256k1 keys.
This class uses features provided by the
bitcoinjs/bip32
package and therefor is licensed under the BSD-2 Clause License as mentioned here.https://github.com/bitcoin/bips/blob/master/bip-0032.mediawiki
https://github.com/satoshilabs/slips/blob/master/slip-0010.md
https://github.com/bitcoinjs/bip32
https://github.com/nemtech/NIP/issues/12
0.2.0