Sign in

Account abstraction

Suggest an edit

Every Ethereum account today is one of two things: an EOA controlled by a private key, or a contract account controlled by code. EOAs can initiate transactions but their behavior is fixed by the protocol. Contracts can have any behavior but cannot initiate transactions on their own. Account abstraction is the umbrella term for changing this. The goal is to let accounts be controlled by arbitrary code while still being able to send transactions.

What's wrong with EOAs

An EOA is an account at an address derived from a public key, controlled by the corresponding private key, with a balance attached to it. The protocol allows only one kind of authorization: a transaction signed by the matching private key, using ECDSA on the secp256k1 curve.

EOA vs smart account: what changes when code controls your accountTwo columns compare an EOA and a smart account across signature scheme, gas payment, key loss, multiple signers, batched operations, and spending limits. The EOA is powerful but rigid and cannot be customized, while the smart account is flexible but can't self-initiate transactions without ERC-4337 or EIP-7702. EOA vs smart account: what changes when code controls your account EOA (Externally Owned Account) controlled by a private key Signature scheme: ECDSA on secp256k1, period Gas payment: must hold ETH, no alternatives Lose the key: account is gone forever Multiple signers: not natively possible Batched operations: one tx, one action Spending limits, allowlists: no, key is all-or-nothing Initiate transactions: yes (this is the one win) Powerful but rigid cannot be customized Smart account controlled by contract code Signature scheme: whatever the code accepts passkeys, multisig, BLS, ZK proofs Gas payment: USDC, sponsored, paymaster Lose the key: social recovery via guardians Multiple signers: thresholds, weighted votes Batched operations: approve + swap + stake in one tx Spending limits, allowlists: session keys with scoped power Initiate transactions: needs help (the problem to solve) Flexible but can't self-initiate needs ERC-4337 or EIP-7702

A smart account is a contract that holds your funds and decides for itself what counts as a valid operation. The code can require two signatures from a 2-of-3 multisig. It can accept a passkey signature from your phone instead of an ECDSA signature. It can require a transaction below a daily spending limit to go through automatically while above-limit transactions wait for a second approver.

The one thing a contract cannot do is initiate a transaction. Only an EOA can, so without something to bridge the two sides a smart account is passive and waits to be called.

Two approaches are in production. ERC-4337 is an application-layer solution that went live on Ethereum mainnet in March 2023 and works without any consensus change. EIP-7702 is a protocol-layer change that activated in the Pectra upgrade in May 2025.

ERC-4337: smart accounts without changing the protocol

The constraint that smart contracts can't initiate transactions is at the EVM level. Changing it would mean a hard fork. ERC-4337 leaves it in place: the user signs off-chain, and someone else turns the signature into a real transaction. The gasless approvals lesson used the same move for one function, permit, where a relayer submits the owner's signature and pays the gas.

The obvious way to apply it to a whole account is for the wallet's developer to run the relayer, a server with an EOA that takes each signed request and calls the user's smart account. Then every account of that wallet works only while that one server is running and agrees to serve it.

ERC-4337 lets anyone do the relaying. The user signs a struct called a UserOperation that describes what they want done: which contract to call, with what data, paid for somehow. They send it to a service called a bundler instead of submitting it to the regular mempool. The bundler is an EOA running a node. It collects UserOperations, batches them into a single real transaction, and submits that transaction to the chain. The bundler pays gas for the submission.

A bundler pays up front for operations from accounts it knows nothing about, so before it includes one it has to know that it will be paid back. It cannot study the code of every wallet to find out. So the bundler's transaction calls one singleton contract, the EntryPoint, which runs the same fixed protocol for each UserOperation in the batch:

  1. Ask the user's smart account "is this UserOperation valid?" The smart account checks the signature however it wants (ECDSA, passkey, multisig, ZK proof, whatever) and either accepts or rejects.
  2. Have the smart account execute whatever the UserOperation asked for.
  3. Make sure someone pays the bundler back for gas, plus a small profit tip.

Validation is a separate step from execution so that a bundler can run it before putting an operation into a batch, and drop the operations that would not pay.

In code, step 1 is a function the account implements. This one is written against version 0.7 of the reference ERC-4337 contracts and accepts a signature from a single owner key:

solidity
function validateUserOp(PackedUserOperation calldata userOp, bytes32 userOpHash, uint256 missingAccountFunds)
    external
    returns (uint256 validationData)
{
    require(msg.sender == address(entryPoint), "only EntryPoint");
    bytes32 hash = MessageHashUtils.toEthSignedMessageHash(userOpHash);
    bool signedByOwner = ECDSA.recover(hash, userOp.signature) == owner;
    if (missingAccountFunds > 0) {
        (bool ok, ) = payable(msg.sender).call{value: missingAccountFunds}("");
        require(ok, "prefund failed");
    }
    return signedByOwner ? SIG_VALIDATION_SUCCESS : SIG_VALIDATION_FAILED;
}

The EntryPoint calls it with the hash of the UserOperation and missingAccountFunds, the ETH the account still has to send to cover the operation's maximum gas cost. The function accepts calls only from the EntryPoint, checks whether owner signed the hash, and sends the missing ETH before anything is executed. After execution the EntryPoint pays the bundler out of that ETH and keeps the rest as the account's deposit. A signature from another key makes the function return SIG_VALIDATION_FAILED instead of reverting. The EntryPoint then rejects the operation by reverting the whole handleOps call, which undoes the ETH transfer too. Returning instead of reverting lets a wallet simulate the operation with a placeholder signature from any key, for example to estimate its gas, before the user has signed it. That is also why the ETH goes out whatever the signature check found: an account that returned before paying would fail the EntryPoint's prefund check, and the simulation would stop there.

Step 3 is where paymasters come in. If the user has ETH, they can pay the bundler directly out of their smart account's balance. If they don't, they can point to a paymaster, which is a separate contract that agrees to cover the gas. The EntryPoint then takes the gas from the paymaster's deposit and passes the account zero as missingAccountFunds. Paymasters might require payment in USDC, might check that the call is to an allowlisted dApp, might sponsor the user as part of a subscription. The protocol stays neutral about why the paymaster is willing to pay.

The cost of this design is operational complexity. ERC-4337 deliberately avoided protocol changes, which meant inventing a parallel mempool, a parallel transaction format, and an ecosystem of bundlers and paymasters. None of that is part of Ethereum's core protocol. It all lives in contracts and off-chain services. The account also depends on bundlers: if only a few exist and they all refuse to include UserOps from certain users (sanctioned addresses, for example), those users are de-facto blocked from using 4337. The mitigation is many independent bundlers, and the protocol's open structure aims to keep the barrier to entry low.

Signature verification still costs gas. A smart account that does ECDSA on every UserOp pays roughly the same for the check as an EOA would. More complex schemes (multisig, ZK proofs) cost more. The operation as a whole costs more than a plain transaction, because the EntryPoint's steps run on chain on top of the call itself.

EIP-7702: smart accounts at the protocol level

Instead of building infrastructure around EOAs, EIP-7702 lets an EOA act as a smart account directly, at its own address.

It introduces a new transaction type (type 0x04, the SetCode transaction) that includes an authorization list. Each authorization is signed by an EOA's private key and says "set my account's code to point to this contract."

EIP-7702: an EOA delegates to smart wallet contract codeBefore EIP-7702, Alice's EOA is only a keypair with no code. Alice signs an authorization naming a contract address, someone submits a type-0x04 transaction with it, and afterward calls to Alice's EOA execute that contract's code while keeping her own storage and balance. EIP-7702: an EOA can borrow contract code, signed by its own private key Before EIP-7702: an EOA is just a keypair EOA address 0xAlice... code: (empty) balance: 2.5 ETH When anyone calls 0xAlice..., nothing executes. It's a wallet, not a contract. Step 1. Alice signs an authorization with her private key: Authorization tuple: chainId: 1 address: 0xSmartWalletImpl... ← contract whose code to use nonce: 7 Step 2. Anyone submits a type-0x04 transaction with that authorization: type-0x04 transaction - authorization_list: [ Alice's signed authorization ] - other normal fields (to, data, gas, ...) the submitter can be Alice OR anyone else; the auth was signed by Alice After: Alice's EOA now executes contract code when called EOA address 0xAlice... code: 0xef0100 || 0xSmartWalletImpl... ← delegation indicator balance: 2.5 ETH Calls to 0xAlice... now execute 0xSmartWalletImpl's code with Alice's storage. Persists until Alice signs another auth (could be to 0x0 to revoke). Her private key still works for normal signing alongside the delegation.

After a SetCode transaction is processed, the EOA's account state gets a delegation indicator: a small piece of data starting with 0xef0100 followed by the address of the implementation contract. The EVM treats this as the EOA's code. When anyone calls the EOA's address, the EVM looks up the indicator, finds the implementation contract, and executes its code in the context of the EOA's storage. None of the 4337 infrastructure is needed for this.

Only the account's own key can delegate it. The authorization is signed by the EOA's private key, and the protocol checks this signature before applying the delegation, like it checks a transaction signature. The type-0x04 transaction that carries the authorization can be submitted by anyone, so a relayer can pay its gas.

The delegation lasts until the key replaces it. It stays in place across transactions until Alice signs another authorization, which could be to a different contract, or to the zero address to revoke.

The key keeps all of its power. Alice's private key still works for signing regular transactions. The delegation adds the ability to also be called as a contract, and the two paths coexist.

That last property is the price of 7702. Whoever holds the key can send a regular transaction that ignores the code's spending limits and second approvers, or sign a new authorization that removes them. The key cannot be rotated either, because the address is derived from it. So no rule in the delegated code can lock out a thief who has the key, and the seed phrase has to be guarded as carefully as before.

The authorization is the other risk. It hands the account's storage and balance to the code it names, so a user tricked into signing an authorization for a malicious contract has given that contract the whole account. The gasless approvals lesson described the same phishing with permit signatures, where one signature gave the attacker the user's whole balance of one token.

The features come down to who signs, who pays, and what runs

Who may sign is decided in validation. A smart account can implement validateUserOp to accept WebAuthn signatures, so users authenticate with their device's biometric and the key never leaves the secure enclave on their phone. It can accept a session key, a temporary, restricted key for a specific dApp: "this key can spend up to 100 USDC, only on the game contract, for the next 4 hours." The dApp can then submit operations within those bounds without re-prompting. It can let designated guardians (other addresses the user trusts) collectively replace a lost signer after a delay.

Who pays is decided by the paymaster in 4337, or by a relayer sending the type-0x04 transaction in 7702: a dApp covers gas for first-time users, or the user pays in USDC and the paymaster pays the ETH. What runs can be several calls in one operation: approve USDC, swap for ETH, and stake the ETH take one signature, where an EOA sends three transactions.

Use 4337 for new addresses and 7702 for existing ones

4337 alone makes sense when users are starting fresh and willing to use a new address that's a contract from day one. 7702 is the right fit for existing users with EOAs that already have an on-chain history: they don't have to move funds to a new address, they sign one authorization and their existing account gets smart-wallet logic. The two are used together when the delegated implementation supports the 4337 interface, so the same wallet integrates with bundlers and paymasters.

The account is as safe as the code that controls it

A smart account moves the risk from one key to the code that controls the account, and to whoever can replace that code. In February 2025 the exchange Bybit lost about 1.46 billion dollars from a Safe, a multisig wallet contract. The attackers got its signers to approve a transaction that replaced the code the wallet runs, and then emptied it. The upgradeable contracts lesson covered the mechanism. A 7702 authorization is the same kind of change, and it takes one signature.

The code is also shared. A bug in the implementation contract is a bug in every account delegated to it, and the same holds for the EntryPoint.

EIP-7702 has pitfalls around storage compatibility. If two different implementation contracts use the same storage slots for different things, switching delegation between them can leave your account's state in a meaningless configuration. The fix is to use stable storage layouts (often via ERC-7201 namespaced storage) so swapping implementations doesn't conflict.

For any account design, yours or one you are about to use, ask who can move the funds if each of its keys leaks, and who can if a bug is found in the code that controls the account.