Represents the Secp256k1 ecdsa public key

Secp256k1 authentication key is represented in the SDK as AnyPublicKey.

Hierarchy (view full)

Constructors

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

    Parameters

    • hexInput: HexInput

      A HexInput (string or Uint8Array)

    Returns Secp256k1PublicKey

Properties

LENGTH: number

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 raw public key bytes

    Returns Uint8Array

  • Verifies a Secp256k1 signature against the public key

    Note signatures are validated to be canonical as a malleability check

    Parameters

    Returns boolean

  • Parameters

    Returns publicKey is Secp256k1PublicKey

  • Parameters

    Returns publicKey is Secp256k1PublicKey

    use instanceof Secp256k1PublicKey instead