Multi-Owner Light Account
Overview
Multi-Owner Light Account is a variant of Light Account that supports multiple ECDSA or SCA owners at once rather than a single one. Each owner has full control over the account, including the ability to add or remove other owners. This lets your account integrate with multiple signers at once, and supports recovering your account if one signer is lost.
Like Light Account, Multi-Owner Light account is an ERC-4337 smart account. It is fully production-ready with a security audit, gas optimizations, and ERC-1271 signature support.
Multi-Owner Light Account uses v0.7 of the entry point. For details about entry point versions, see the EntryPoint v0.7 Upgrade Guide.
Getting started
The code snippet below demonstrates how to use Multi-Owner Light Account with Account Kit. It creates an account and sends a UserOperation
from it:
import { createMultiOwnerLightAccountAlchemyClient } from "@alchemy/aa-alchemy";
import { LocalAccountSigner, sepolia } from "@alchemy/aa-core";
import type { Address, Hex } from "viem";
const chain = sepolia;
// The private key of your EOA that will be the signer of Light Account
const PRIVATE_KEY: Hex = "0xYourEOAPrivateKey";
const SECOND_OWNER_ADDRESS: Address = "0xSomeAddress";
const signer = LocalAccountSigner.privateKeyToAccountSigner(PRIVATE_KEY);
// Create a provider to send user operations from your smart account
const provider = await createMultiOwnerLightAccountAlchemyClient({
// get your Alchemy API key at https://dashboard.alchemy.com
apiKey: "ALCHEMY_API_KEY",
chain,
signer,
// The initial owners always include signer. Any additional owners can be
// specified here.
owners: [SECOND_OWNER_ADDRESS],
});
// Fund your account address with ETH to send for the user operations
// (e.g. Get Sepolia ETH at https://sepoliafaucet.com)
console.log(provider.getAddress()); // Log the smart account address
// Send a user operation from your smart account
const { hash: uoHash } = await provider.sendUserOperation({
uo: {
target: "0xTargetAddress", // The desired target contract address
data: "0xCallData", // The desired call data
value: 0n, // (Optional) value to send the target contract address
},
});
console.log(uoHash); // Log the user operation hash
// Wait for the user operation to be mined
const txHash = await provider.waitForUserOperationTransaction({ hash: uoHash });
console.log(txHash); // Log the transaction hash
Address calculation
For the Multi-Owner Light Account, the address of the smart account will be calculated as a combination of the initial owners and the salt. You will get the same smart account address each time you supply the same signer
and owners
. Alternatively, you can supply salt
if you want a different address for the same signer
and owner
params (the default salt is 0n
).
If you want to use a signer to connect to an account whose address does not map to the contract-generated address, you can supply the accountAddress
to connect with the account of interest. In that case, the signer
and owners
params are not used for address calculation, and the signer
param is only used for signing the operation.
Reference: https://eips.ethereum.org/EIPS/eip-4337#first-time-account-creation
Deployment addresses
The following table lists the deployed factory and account implementation contract addresses for MultiOwnerLightAccount
on different chains:
Chain | Factory Address | Account Implementation |
---|---|---|
Eth Mainnet | 0x000000000019d2Ee9F2729A65AfE20bb0020AefC | 0xd2c27F9eE8E4355f71915ffD5568cB3433b6823D |
Eth Sepolia | 0x000000000019d2Ee9F2729A65AfE20bb0020AefC | 0xd2c27F9eE8E4355f71915ffD5568cB3433b6823D |
Polygon Mainnet | 0x000000000019d2Ee9F2729A65AfE20bb0020AefC | 0xd2c27F9eE8E4355f71915ffD5568cB3433b6823D |
Polygon Mumbai | 0x000000000019d2Ee9F2729A65AfE20bb0020AefC | 0xd2c27F9eE8E4355f71915ffD5568cB3433b6823D |
Polygon Amoy | 0x000000000019d2Ee9F2729A65AfE20bb0020AefC | 0xd2c27F9eE8E4355f71915ffD5568cB3433b6823D |
Optimism | 0x000000000019d2Ee9F2729A65AfE20bb0020AefC | 0xd2c27F9eE8E4355f71915ffD5568cB3433b6823D |
Optimism Sepolia | 0x000000000019d2Ee9F2729A65AfE20bb0020AefC | 0xd2c27F9eE8E4355f71915ffD5568cB3433b6823D |
Arbitrum | 0x000000000019d2Ee9F2729A65AfE20bb0020AefC | 0xd2c27F9eE8E4355f71915ffD5568cB3433b6823D |
Arbitrum Sepolia | 0x000000000019d2Ee9F2729A65AfE20bb0020AefC | 0xd2c27F9eE8E4355f71915ffD5568cB3433b6823D |
Base | 0x000000000019d2Ee9F2729A65AfE20bb0020AefC | 0xd2c27F9eE8E4355f71915ffD5568cB3433b6823D |
Base Sepolia | 0x000000000019d2Ee9F2729A65AfE20bb0020AefC | 0xd2c27F9eE8E4355f71915ffD5568cB3433b6823D |
Zora Mainnet | 0x000000000019d2Ee9F2729A65AfE20bb0020AefC | 0xd2c27F9eE8E4355f71915ffD5568cB3433b6823D |
Zora Sepolia | 0x000000000019d2Ee9F2729A65AfE20bb0020AefC | 0xd2c27F9eE8E4355f71915ffD5568cB3433b6823D |
Fraxtal Mainnet | 0x000000000019d2Ee9F2729A65AfE20bb0020AefC | 0xd2c27F9eE8E4355f71915ffD5568cB3433b6823D |
Fraxtal Sepolia | 0x000000000019d2Ee9F2729A65AfE20bb0020AefC | 0xd2c27F9eE8E4355f71915ffD5568cB3433b6823D |