Represents an authentication key used for account management. Each account stores an authentication key that enables account owners to rotate their private key(s) without changing the address that hosts their account. The authentication key is a SHA3-256 hash of data and is always 32 bytes in length.

Account Basics

Account addresses can be derived from the AuthenticationKey.

Hierarchy (view full)

Constructors

  • Creates an instance of the AuthenticationKey using the provided hex input. This ensures that the hex input is valid and conforms to the required length for an Authentication Key.

    Parameters

    • args: {
          data: HexInput;
      }

      The arguments for constructing the AuthenticationKey.

      • data: HexInput

        The hex input data to be used for the Authentication Key.

    Returns AuthenticationKey

    Throws an error if the length of the provided hex input is not equal to the required Authentication Key length.

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.

  • Returns the hex string representation of the Serializable value with the 0x prefix.

    Returns string

    the hex formatas a string prefixed by 0x.

  • Convert the internal data representation to a Uint8Array.

    This function is useful for obtaining a byte representation of the data, which can be utilized for serialization or transmission.

    Returns Uint8Array

    Uint8Array representation of the internal data.

Properties

data: Hex

The raw bytes of the authentication key.

LENGTH: number = 32

An authentication key is always a SHA3-256 hash of data, and is always 32 bytes.

The data to hash depends on the underlying public key type and the derivation scheme.