Represents the private key of an Ed25519 key pair.

Hierarchy

Implements

Constructors

Properties

signingKey: Hex

The Ed25519 signing key

LENGTH: number = 32

Length of an Ed25519 private key

SLIP_0010_SEED: "ed25519 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

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

  • Helper function to get a value's BCS-serialized bytes as a Hex instance.

    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.

    To derive multiple keys from the same phrase, change the path

    IMPORTANT: Ed25519 supports hardened derivation only (since it lacks a key homomorphism, so non-hardened derivation cannot work)

    Parameters

    • path: string

      the BIP44 path

    • mnemonics: string

      the mnemonic seed phrase

    Returns Ed25519PrivateKey

  • A private inner function so we can separate from the main fromDerivationPath() method to add tests to verify we create the keys correctly.

    Parameters

    • path: string

      the BIP44 path

    • seed: Uint8Array

      the seed phrase created by the mnemonics

    • offset: number = HARDENED_OFFSET

      the offset used for key derivation, defaults to 0x80000000

    Returns Ed25519PrivateKey

Generated using TypeDoc