The chances are you already know that “Account Abstraction is going to change Web3 forever”, “onboard the next billion people” and everything. If not — check these articles suggested by Alchemy. However, it’s a different thing to understand what exactly happening with ERC-4337 transactions under the hood.
If you’re curious, after reading this article you will know all the data that goes into User Operations. And the best part — you don’t need to be a developer to understand it. Let’s dive in! We’ll start with definitions.
User Operation is an intention of action packed with additional information — to interact with other components of the ERC-4337 standard. User Operation has properties that allow it to be bundled, validated, executed, and paid for its execution.
Unlike the previous suggestion of Account Abstraction, EIP-2938, this one is a workaround to add AA without changing the consensus of the Ethereum network.
UserOperation is a pseudo-transaction object, an ABI-encoded struct. It looks like this:
struct UserOperation {
address sender;
uint256 nonce;
bytes initCode;
bytes callData;
uint256 callGasLimit;
uint256 verificationGasLimit;
uint256 preVerificationGas;
uint256 maxFeePerGas;
uint256 maxPriorityFeePerGas;
bytes paymasterAndData;
bytes signature;
}
Source: eth-infinitism GitHub.
In EntryPoint contract you will see other structs, such as MemoryUserOp and UserOpInfo. However, they’re only used internally, so we’ll focus on UserOperation struct itself.
We will take an example from the actual Polygon mainnet. Here’s the first-ever transaction/interaction with Polygon’s ERC-4337: Entry Point version 0.6.0 contract: https://polygonscan.com/tx/0xfcfdf5b6124b4b985448cebc5388e31b73d00315f4aa8417ee66b4bf96cc6ae4
<aside> 💡 Polygon is a sidechain with the same implementation of ERC-4337 as Ethereum.
</aside>
The first step is getting the data: click “Decode Input Data” on the transaction page:

Now we can read User Operations passed by handleOps function:

<aside> 💡 handleOps function takes arrays of UserOps as input!
However, since mempool is not so busy for now, most handleOps transactions contain only one User Operation. Otherwise, you would see two, three, or more structs in one transaction data.
</aside>
To the first line!
sender type address — the account (user) making the operation. Usually, it’s the address of Smart Contract Wallet (SCW). Take a look at the account from our example: 0x753a018071Ae56748b46cAE8cB4399Df4B80fFf6. Indeed, it's the SCW for a dApp.
