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

    Class Secp256k1PublicKey

    Represents a Secp256k1 ECDSA public key.

    Hierarchy (View Summary)

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

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

      The message is SHA3-256 hashed before verification (matching the Aptos-side Secp256k1 signing convention), and the signature is required to be in canonical low-S form for malleability resistance.

      Parameters

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

        The arguments for verification.

        • message: Uint8Array

          The exact bytes that were signed.

        • signature: Secp256k1Signature

          The signature to verify.

      Returns boolean

    • Note: Secp256k1Signatures can be verified syncronously.

      Verifies the provided signature against the given message. This function helps ensure the integrity and authenticity of the message by confirming that the signature is valid.

      Parameters

      Returns Promise<boolean>

      A boolean indicating whether the signature is valid for the given message.

    keyType: string = "secp256k1"
    COMPRESSED_LENGTH: number = 33
    LENGTH: number = 65

    The length of the Secp256k1 public key in bytes.