Namespace
Get the public key associated with this private key.
The public key can be freely given and used by other parties to verify the signatures generated by this private key.
Get the public key associated with this private key.
The public key can be freely given and used by other parties to verify the signatures generated by this private key.
deprecated - This method is deprecated and will be removed in future versions.
Use the signTransaction
method with the legacy=false
flag or don't
pass it all for the modern approach.
Derive a new private key at the given wallet index.
Only currently supported for keys created with fromMnemonic()
; other keys will throw
an error.
You can check if a key supports derivation with .supportsDerivation()
Recover the recovery ID used in the signature for the given message.
Note: This method only works for ECDSA secp256k1 keys.
32-byte r
component of the signature
32-byte s
component of the signature
The original (unhashed) message
Recovery ID (0–3), or -1 if not found or not applicable
Check if derive
can be called on this private key.
This is only the case if the key was created from a mnemonic.
Sign a message with this private key.
Optional
legacy: falseCreate a keystore with a given passphrase.
The key can be recovered later with fromKeystore()
.
Note that this will not retain the ancillary data used for
deriving child keys, thus .derive()
on the restored key will
throw even if this instance supports derivation.
Optional
passphrase: string = ""Static
fromConstruct a private key from bytes. Requires DER header.
Static
fromConstruct a ECDSA private key from bytes.
Static
fromConstruct a ED25519 private key from bytes.
Static
fromRecover a private key from a keystore, previously created by .toKeystore()
.
This key will not support child key derivation.
Optional
passphrase: string = ""Static
fromOptional
passphrase: string = ""Static
fromRecover a private key from a pem string; the private key may be encrypted.
This method assumes the .pem file has been converted to a string already.
If passphrase
is not null or empty, this looks for the first ENCRYPTED PRIVATE KEY
section and uses passphrase
to decrypt it; otherwise, it looks for the first PRIVATE KEY
section and decodes that as a DER-encoded private key.
Optional
passphrase: string = ""Static
fromConstruct a Ed25519 private key from a Uint8Array seed.
Static
fromConstruct a Ed25519 private key from a Uint8Array seed.
Static
fromStatic
fromConstruct a private key from a HEX-encoded string with a der prefix
Static
fromStatic
fromStatic
generateDepredated - Use generateED25519()
instead
Generate a random Ed25519 private key.
Static
generateDepredated - Use generateED25519Async()
instead
Generate a random Ed25519 private key.
Static
generateGenerate a random EDSA private key.
Static
generateGenerate a random ECDSA private key.
Static
generateGenerate a random Ed25519 private key.
Static
generateGenerate a random Ed25519 private key.
Static
get
proto