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)

Implementation - BCS

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

Implementation - Serialization

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

  • Create a bitmap that holds the mapping from the original public keys to the signatures passed in

    Parameters

    • args: {
          bits: number[];
      }
      • bits: number[]

        array of the index mapping to the matching public keys

    Returns Uint8Array

    Uint8array bit map

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

Implementation - Other

  • Get the index of the provided public key.

    This function retrieves the index of a specified public key within the MultiKey. If the public key does not exist, it throws an error.

    Parameters

    Returns number

    The corresponding index of the public key, if it exists.

    Error - If the public key is not found in the MultiKey.

Methods

MMNEPVFCICPMFPCPTTAAATR