Skip to main content

Multisig Ownership Module

What is it? 🤔

The Multisig Module is integral to AbstraXn's Modular Smart Account, enhancing transaction security and user authentication. This document outlines its functionality, benefits, and use cases.

What is the Multisig Ownership Module? 🤔

This module allows Smart Account multiple owners (Externally Owned Accounts (EOAs)) to authorize and sign user operations (UserOps) for Smart Account. Its functionality closely resembles that of Multisig Wallet, yet it has been reconfigured as a Multisig Validation Module within the Account Abstraction + Modular Smart Accounts ecosystem.

Key Functions 🔐

  • Multiple Signer Simplicity: Offers n/n multisig, multple-signature control.
  • Multisig Signature Scheme: Utilizes the Multisig secp256k1 curve for secure signing.
  • EIP-1271 Compliance: Allowing Smart Accounts to sign Ethereum messages for logging into dApps.
  • Threshold: Offer the transaction to get executed based on Threshold of the Smart Account Wallet.

Use Cases 🌟

  1. Secure Transaction Signing: Owners can sign the transaction based on the threshold.
  2. Ownership Management: Mirrors traditional ownership systems, providing a familiar framework within a more advanced blockchain setting.

SDK Guide 📘

Initializing Multisig Module 🌟

Usage

import { MultiSigModule } from "@abstraxn/modules";

// Multisig Module Creation
const multisigModule = await MultiSigModule.create({
ownerAddresses: [await web3AuthSigner.getAddress()],
threshold: 1,
});

// Smart Account Creation
const abstraxnSmartAccount = await AbstraxnSmartAccount.create({
chainId: ChainId.SEPOLIA,
defaultValidationModule: multisigModule,
bundler: bundler, // instance of bundler
paymaster: paymaster,
});

Parameters

required params are explicitly mentioned

  • entryPointAddress(Hex): Defaults to "0x5ff137d4b0fdcd49dca30c7cf57e578a026d2789"

Returns

  • MultisigModule (MultisigModule): An instance of the AbstraXn Multisig module.
warning

To deploy the same Smart Account (with the same address) on different chains, it's crucial to use the same module address, the same initialization data (here, the owner's EOA address) for the Multisig Module here and the index. This ensures consistency in the account's address across various blockchains.

Smart Contract Deep Dive 🛠️

This section dives into the MultisigOwnershipRegistryModule for AbstraXn Smart Accounts, focusing on key functionalities and security aspects.

Core Functionalities

Signature Verification (_verifySignature) 🔐

// Internal function to verify the signature of a smart account
function _validateSignatures(
bytes memory operationDataPack
) internal view returns (uint256 validationData) {
(
bytes memory operationData,
uint48 validAfter,
uint48 validUntil,
bytes memory signatures
) = abi.decode(operationDataPack, (bytes, uint48, uint48, bytes));
bool success = checkSignatures(
keccak256(operationData),
operationData,
signatures
);
if (success) validationData = VALIDATION_SUCCESS;
else validationData = SIG_VALIDATION_FAILED;
}

Validates a signature against a data hash and registered owner, supporting EIP-1271 standard.

function isValidSignature(
bytes32 operationDataHash,
bytes memory operationDataPack
) public view virtual override returns (bytes4) {
return isValidSignatureForAddress(operationDataHash, operationDataPack, msg.sender);
}
note

isValidSignature serves as a key function for external smart contracts to verify signature authenticity.

Security Considerations

  • Strict Ownership Rules: Only Externally Owned Accounts (EOAs) can authorize transactions, ensuring secure control over Smart Account operations.
  • Signature Verification: Implements robust methods for signature validation, crucial for preventing unauthorized access.
info

The initForSmartAccount method doesn't include isSmartContract checks due to operational constraints. However, this doesn't compromise security as operations require valid EOA signatures. This ensures Smart Accounts remain secure within their operational framework.

Interaction with Smart Accounts 🤝

The MultisigOwnershipRegistryModule interacts with Smart Accounts primarily through its core functionalities:

  • Initialization and Ownership: During deployment, Smart Accounts use init method to invoke initForSmartAccount on modules, setting initial ownership and configurations.
  • User Operation Validation: When a Smart Account attempts to perform an operation, validateUserOp is invoked to ensure the action is authorized by the registered owner.
  • Signature Verification: The module uses _verifySignature to verify any signatures associated with transactions initiated by the Smart Account.