Signer implementation for the MultiKey authentication scheme.

This account utilizes an M of N signing scheme, where M and N are specified in the MultiKey. It signs messages using an array of M accounts, each corresponding to a public key in the MultiKey.

Note: Generating a signer instance does not create the account on-chain.

Implements

Constructors

  • Constructs a MultiKeyAccount instance, which requires multiple signatures for transactions.

    Parameters

    • args: {
          address?: AccountAddressInput;
          multiKey: MultiKey;
          signers: Account[];
      }

      The arguments for creating a MultiKeyAccount.

      • Optionaladdress?: AccountAddressInput

        An optional account address input. If not provided, the derived address from the public key will be used.

      • multiKey: MultiKey

        The multikey of the account consisting of N public keys and a number M representing the required signatures.

      • signers: Account[]

        An array of M signers that will be used to sign the transaction.

    Returns MultiKeyAccount

Methods

  • Verify the given message and signature with the public keys.

    This function checks if the provided signatures are valid for the given message using the corresponding public keys.

    Parameters

    Returns boolean

    A boolean indicating whether the signatures are valid for the message.

  • Waits for any proofs on KeylessAccount signers to be fetched. This ensures that signing with the KeylessAccount does not fail due to missing proofs.

    Returns Promise<void>

    A promise that resolves when all proofs have been fetched.

  • Static constructor to create a MultiKeyAccount using the provided public keys and signers.

    Parameters

    • args: {
          publicKeys: PublicKey[];
          signaturesRequired: number;
          signers: Account[];
      }

      The arguments for creating a MultiKeyAccount.

      • publicKeys: PublicKey[]

        The N public keys of the MultiKeyAccount.

      • signaturesRequired: number

        The number of signatures required to authorize a transaction.

      • signers: Account[]

        An array of M signers that will be used to sign the transaction.

    Returns MultiKeyAccount

    MultiKeyAccount - The newly created MultiKeyAccount.

Properties

accountAddress: AccountAddress

Account address associated with the account

publicKey: MultiKey

Public key associated with the account

signaturesBitmap: Uint8Array
signerIndicies: number[]

An array of indices where for signer[i], signerIndicies[i] is the index of the corresponding public key in publicKey.publicKeys. Used to derive the right public key to use for verification.

signers: Account[]

The signers used to sign messages. These signers should correspond to public keys in the MultiKeyAccount's public key. The number of signers should be equal or greater than this.publicKey.signaturesRequired

signingScheme: SigningScheme

Signing scheme used to sign transactions