Class MultiEd25519PublicKey

Represents the public key of a K-of-N Ed25519 multi-sig transaction.

A K-of-N multi-sig transaction requires at least K out of N authorized signers to sign the transaction for it to be executed. This class encapsulates the logic for managing the public keys and the threshold for valid signatures.

Hierarchy (view full)

Constructors

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.

  • Serializes the current instance into bytes using the provided serializer. This allows for the conversion of the instance's data into a format suitable for transmission or storage.

    Parameters

    • serializer: Serializer

      The serializer used to convert the instance into bytes.

    Returns void

  • Verifies a multi-signature against a given message. This function ensures that the provided signatures meet the required threshold and are valid for the given message.

    Parameters

    Returns boolean

    True if the signature is valid; otherwise, false.

    Error if the bitmap and signatures length mismatch or if there are not enough valid signatures.

Properties

publicKeys: Ed25519PublicKey[]

List of Ed25519 public keys for this LegacyMultiEd25519PublicKey

threshold: number

The minimum number of valid signatures required, for the number of public keys specified

MAX_KEYS = 32

Maximum number of public keys supported

MIN_KEYS = 2

Minimum number of public keys needed

MIN_THRESHOLD = 1

Minimum threshold for the number of valid signatures required