ERC-4337 Account Abstraction Flashcards
(13 cards)
What is Account Abstraction (ERC-4337)
A system that enables the use of smart contract wallets with arbitrary logic instead of EOAs, without changing the blockchain.
What is a UserOperation
A structure describing a user’s transaction, including calldata, gas info, signature, and more. It allows complex instructions from a smart contract wallet.
What is the EntryPoint contract in ERC-4337
A singleton smart contract that validates and executes bundles of UserOperations.
Who or what is a Bundler
A node that collects UserOperations, creates a transaction with handleOps(), and submits it to the blockchain via the EntryPoint.
What is a Paymaster
A smart contract that sponsors the gas fee for a UserOperation.
What is a Factory in ERC-4337?
A contract that deploys smart accounts using CREATE2, allowing precomputed addresses and wallet creation on demand.
What is an Aggregator
A contract that validates aggregated signatures from multiple UserOperations using the same scheme.
What does CREATE2 enable in wallet creation?
Deployment of smart wallets at predictable addresses, enabling users to receive funds before wallet deployment (counterfactual address).
What happens in the Verification phase of handleOps()?
- Create the
sender
Smart Contract Account if it does not yet exist. - Calculate the fee the
sender
must add to its “deposit” in theEntryPoint
- Call
validateUserOp
on thesender
contract -
When using paymaster: check that the
paymaster
has enough ETH deposited with theEntryPoint
to pay for theUserOperation
, and then callvalidatePaymasterUserOp
on the paymaster to verify that the paymaster is willing to pay for theUserOperation
. - Validate the account’s deposit in the
EntryPoint
is high enough to cover the max possible cost
What happens in the Execution phase?
- Call the account with the
UserOperation
’s calldata. - After the call, refund the account’s deposit with the excess gas cost that was pre-charged.
- After the execution of all calls, pay the collected fees from all
UserOperations
to thebeneficiary
address provided by the bundler.
How does a Paymaster handle post-execution logic?
It can use the postOp() function to adjust based on actual gas used (e.g., deduct tokens like USDC).
What are Smart Contract Wallets in ERC-4337?
Wallets powered by smart contracts with custom logic (e.g. Soul Wallet, Candide).
What restrictions are placed on validateUserOp to prevent simulation attacks?
Limited storage access and restricted opcodes to avoid interference or falsification.