Represents the private key of an Ed25519 key pair.

Hierarchy (view full)

Implements

Constructors

Methods

  • Serializes a Serializable value to its BCS representation. This function is the TypeScript SDK equivalent of bcs::to_bytes in Move.

    Returns Uint8Array

    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.

    Returns Hex

    A Hex instance with the BCS-serialized bytes loaded into its underlying Uint8Array.

  • Get the private key as a hex string with the 0x prefix.

    Returns string

    string representation of the private key.

  • Derives 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.

    Parameters

    • path: string

      The BIP44 path used for key derivation.

    • mnemonics: string

      The mnemonic seed phrase from which the key will be derived.

    Returns Ed25519PrivateKey

    Error if the provided path is not a valid hardened path.

  • Determines if the provided private key is an instance of Ed25519PrivateKey.

    Parameters

    Returns privateKey is Ed25519PrivateKey

    A boolean indicating whether the private key is an Ed25519PrivateKey.

    Use instanceof Ed25519PrivateKey instead.

Properties

LENGTH: number = 32

Length of an Ed25519 private key

SLIP_0010_SEED = "ed25519 seed"

The Ed25519 key seed to use for BIP-32 compatibility See more https://github.com/satoshilabs/slips/blob/master/slip-0010.md