@aptos-labs/ts-sdk - v7.1.0
    Preparing search index...

    Class Ed25519PublicKey

    Represents the public key of an Ed25519 key pair.

    Since AIP-55 Aptos supports Legacy and Unified authentication keys.

    Ed25519 scheme is represented in the SDK as Legacy authentication key and also as AnyPublicKey that represents any Unified authentication key.

    Hierarchy (View Summary)

    Index

    Implementation - BCS

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

    Implementation - Serialization

    LENGTH: number = 32

    Length of an Ed25519 public key

    • Serializes the data into a byte array using the provided serializer. This allows for the conversion of data into a format suitable for transmission or storage.

      Parameters

      • serializer: Serializer

        The serializer instance used to perform the serialization.

      Returns void

    • Verifies a signature against the exact bytes of message. This is the unambiguous form — the input is interpreted as raw bytes regardless of what they encode. Pair with Ed25519PrivateKey.signBytes.

      Performs an Ed25519 malleability check (rejects non-canonical S values) before delegating to the underlying curve verifier.

      Parameters

      • args: { message: Uint8Array; signature: Signature }

        The arguments for verification.

        • message: Uint8Array

          The exact bytes that were signed.

        • signature: Signature

          The signature to verify.

      Returns boolean

    • Verifies a signed message using a public key.

      Parameters

      Returns boolean

      The polymorphic message: HexInput input is ambiguous — a bare even-length string of hex characters (e.g., "cafe") is interpreted as the 2 bytes [0xCA, 0xFE], not as 4 UTF-8 text bytes. Use verifyBytes for Uint8Array input or verifyText for string input; both are unambiguous. See convertSigningMessage for the full legacy rule.

    • Verifies a signature against the UTF-8 encoding of message. The input is always treated as text — there is no hex/text heuristic. Pair with Ed25519PrivateKey.signText.

      Parameters

      • args: { message: string; signature: Signature }

        The arguments for verification.

        • message: string

          The text that was signed.

        • signature: Signature

          The signature to verify.

      Returns boolean

    • Determines if the provided public key is a valid Ed25519 public key. This function checks for the presence of the "key" property and verifies that its data length matches the expected length for Ed25519 public keys.

      Parameters

      • publicKey: PublicKey

        The public key to validate.

      Returns publicKey is Ed25519PublicKey

      A boolean indicating whether the public key is a valid Ed25519 public key.

    Methods