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 full)

Constructors

  • Create a new PublicKey instance from a Uint8Array or String.

    Parameters

    • hexInput: HexInput

      A HexInput (string or Uint8Array)

    Returns Ed25519PublicKey

Properties

LENGTH: number

Length of an Ed25519 public key

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

  • Parameters

    Returns void

  • Get the public key as a hex string with a 0x prefix e.g. 0x123456...

    Returns string

  • Get the public key in bytes (Uint8Array).

    Returns Uint8Array

    Uint8Array representation of the public key

  • Verifies a signed data with a public key

    Parameters

    Returns boolean

  • Parameters

    Returns publicKey is Ed25519PublicKey

  • Parameters

    Returns publicKey is Ed25519PublicKey

    use instanceof Ed25519PublicKey instead.