Class: Slip0010
Class to help with slip0010 key derivation https://github.com/satoshilabs/slips/blob/master/slip-0010.md.
Constructors
Constructor
new Slip0010():
Slip0010
Returns
Slip0010
Methods
getMasterKeyFromSeed()
static
getMasterKeyFromSeed(seed
,keyType
):object
Get the master key from the seed.
Parameters
seed
Uint8Array
The seed to generate the master key from.
keyType
KeyType
= KeyType.Ed25519
The key type.
Returns
object
The key and chain code.
privateKey
privateKey:
Uint8Array
chainCode
chainCode:
Uint8Array
Throws
If the seed is invalid.
derivePath()
static
derivePath(seed
,path
,keyType
):object
Derive a key from the path.
Parameters
seed
Uint8Array
The seed.
path
The path.
keyType
KeyType
= KeyType.Ed25519
The key type.
Returns
object
The key and chain code.
privateKey
privateKey:
Uint8Array
chainCode
chainCode:
Uint8Array
getPublicKey()
static
getPublicKey(privateKey
,keyType
,withZeroByte
):Uint8Array
Get the public key from the private key.
Parameters
privateKey
Uint8Array
The private key.
keyType
KeyType
= KeyType.Ed25519
The key type.
withZeroByte
boolean
= true
Include a zero bute prefix.
Returns
Uint8Array
The public key.