Serializes a Serializable
value to its BCS representation.
This function is the TypeScript SDK equivalent of bcs::to_bytes
in Move.
the BCS representation of the Serializable instance as a byte buffer.
Converts the BCS-serialized bytes of a value into a Hex instance. This function provides a Hex representation of the BCS-serialized data for easier handling and manipulation.
A Hex instance with the BCS-serialized bytes loaded into its underlying Uint8Array.
Create a new PrivateKey instance from a Uint8Array or String.
HexInput (string or Uint8Array)
Optional
strict: booleanIf true, private key must AIP-80 compliant.
Static
Readonly
LENGTHLength of an Ed25519 private key
Static
Readonly
SLIP_The Ed25519 key seed to use for BIP-32 compatibility See more https://github.com/satoshilabs/slips/blob/master/slip-0010.md
Derive the Ed25519PublicKey for this private key.
Ed25519PublicKey - The derived public key corresponding to the private key.
Sign the given message with the private key. This function generates a digital signature for the specified message, ensuring its authenticity and integrity.
A message as a string or Uint8Array in HexInput format.
A digital signature for the provided message.
Get the private key as a hex string with the 0x prefix.
string representation of the private key.
Get the private key in bytes (Uint8Array).
Uint8Array representation of the private key
Static
fromDerives a private key from a mnemonic seed phrase using a specified BIP44 path. To derive multiple keys from the same phrase, change the path
IMPORTANT: Ed25519 supports hardened derivation only, as it lacks a key homomorphism, making non-hardened derivation impossible.
The BIP44 path used for key derivation.
The mnemonic seed phrase from which the key will be derived.
Static
generateGenerate a new random private key.
Ed25519PrivateKey A newly generated Ed25519 private key.
Static
isDetermines if the provided private key is an instance of Ed25519PrivateKey.
The private key to check.
A boolean indicating whether the private key is an Ed25519PrivateKey.
Get the private key as a AIP-80 compliant hex string.
AIP-80 compliant string representation of the private key.
Get the private key as a hex string with the 0x prefix.
string representation of the private key.
Returns the hex string representation of the Serializable
value without the 0x prefix.
the hex format as a string without 0x
prefix.
Static
deserialize
Represents the private key of an Ed25519 key pair.