You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
description: "Learn the fundamental differences between Externally Owned Accounts (EOAs) and Smart Wallets, and how these differences affect your application development."
4
4
---
5
5
6
-
> **What you’ll learn**
7
-
> By the end of this guide, you’ll understand:
6
+
> **What you'll learn**
7
+
> By the end of this guide, you'll understand:
8
8
> - How Smart Wallet signatures work differently from EOA signatures.
9
9
> - When and why certain operations fail with Smart Wallets.
10
10
> - How to implement universal signature verification.
11
-
> - What changes are needed in your smart contracts and applications
11
+
> - What changes are needed in your smart contracts and applications
// signature format varies, validated via EIP-1271
29
27
```
30
-
</Tab>
31
-
</Tabs>
32
28
33
-
<Note>
34
-
EOAs use private keys directly. Smart Wallets use passkeys that are validated by the wallet contract through the `isValidSignature` function.
35
-
</Note>
29
+
**Key Difference**: EOAs use private keys directly. Smart Wallets use passkeys validated by the wallet contract through `isValidSignature`.
36
30
37
31
## Signature Verification
38
32
@@ -119,56 +113,54 @@ Smart Wallets can batch multiple operations into a single transaction, reducing
119
113
## Smart Contract Incompatibilities
120
114
121
115
### Self-Calls Will Fail
122
-
Smart Wallets have restrictions on certain operations to maintain security and compliance with the ERC-4337 standard.
116
+
117
+
Smart Wallets block calls back to themselves for security and ERC-4337 compliance.
123
118
124
119
```solidity
125
120
// This will fail with Smart Wallets
126
121
function badExample() external {
127
122
// msg.sender is the Smart Wallet contract
123
+
// This call back to the wallet will be blocked
128
124
IWallet(msg.sender).transfer(amount);
129
125
}
130
126
131
127
// Pass data as parameters instead
132
128
function goodExample(address recipient, uint256 amount) external {
133
-
// Process parameters directly
129
+
// Process parameters directly without calling back to msg.sender
134
130
_transfer(recipient, amount);
135
131
}
136
132
```
137
133
138
134
### CREATE Opcode Not Supported
139
135
140
-
Smart Wallets cannot use the CREATE opcode to deploy new contracts directly. This is a limitation of the ERC-4337 standard and smart accounts, as confirmed by the Base Account documentation.
136
+
ERC-4337 doesn't support CREATE opcode. Use CREATE2 with factory patterns instead.
141
137
142
138
```solidity
143
139
// Smart Wallets cannot use CREATE
144
140
function badDeploy() external {
145
-
new MyContract(); // Will fail
141
+
// This will fail - CREATE opcode not supported in ERC-4337
142
+
new MyContract();
146
143
}
147
144
148
145
// Use CREATE2 factory pattern
149
146
function goodDeploy(bytes32 salt) external {
147
+
// CREATE2 is supported and creates deterministic addresses
150
148
new MyContract{salt: salt}();
151
149
}
152
150
```
153
151
154
152
### Transfer vs Call
155
153
156
-
The Solidity `.transfer()` method forwards exactly **2300 gas** to the recipient. However, Smart Wallets often require more gas than this limit to execute their `receive` or `fallback` functions, which may include:
157
-
158
-
- Updating internal balances or state
159
-
- Emitting events for transaction tracking
160
-
- Executing additional logic in their receive functions
161
-
- Handling complex fallback scenarios
162
-
163
-
Because Smart Wallets are contracts, these operations can easily exceed the 2300 gas limit imposed by `.transfer()`, causing transfers to fail.
154
+
`.transfer()` forwards only 2300 gas, which is insufficient for Smart Wallet operations that may need more gas for state updates and event emissions.
164
155
165
156
```solidity
166
-
// .transfer() can fail with Smart Wallets
157
+
// .transfer() forwards only 2300 gas - may fail with Smart Wallets
if (balance.eq(0)) thrownewError("Need ETH for gas");
188
176
```
189
-
</Tab>
190
177
191
-
<Tabtitle="Smart Wallets Can Use Sponsored Gas">
178
+
**Smart Wallets**: Can use sponsored gas via paymasters
192
179
```javascript
193
-
//Smart Wallet: Can use paymasters for sponsored transactions
180
+
//Check paymaster support
194
181
constcapabilities=awaitwallet.request({
195
-
method:'wallet_getCapabilities'
182
+
method:'wallet_getCapabilities',
183
+
params: [address]
196
184
});
197
185
198
-
if (capabilities.paymasterService) {
199
-
// Transaction can be sponsored
200
-
awaitsponsoredTransaction();
186
+
if (capabilities[chainId]?.paymasterService?.supported) {
187
+
// Use sponsored transactions
188
+
awaitwallet.request({
189
+
method:'wallet_sendCalls',
190
+
params: [{ /* transaction with paymaster capabilities */ }]
191
+
});
201
192
}
202
193
```
203
-
</Tab>
204
-
</Tabs>
205
194
206
195
## Deployment Differences
207
196
208
-
| Aspect | EOA | Smart Wallet |
209
-
|--------|-----|-------------|
210
-
|**Deployment**| No deployment needed | Contract must be deployed |
211
-
|**Address Generation**| Derived from public key | Deterministic before deployment |
212
-
|**Availability**| Immediately usable | Can use lazy deployment |
213
-
|**Pre-deployment Signing**| Not applicable | Supported via ERC-6492 |
197
+
**EOAs**: No deployment needed, immediately usable, address derived from public key
198
+
199
+
**Smart Wallets**: Contract deployment required (can be lazy), deterministic addresses, supports pre-deployment signing via ERC-6492
214
200
215
201
## Implementation Checklist
216
202
217
203
### For Applications Supporting Both Wallet Types
218
204
219
-
<AccordionGroup>
220
-
<Accordiontitle="Signature Verification">
221
-
- Implement universal signature verification
205
+
<Steps>
206
+
<Step title="Signature Verification">
207
+
Implement universal signature verification that supports both ECDSA (EOA) and EIP-1271 (Smart Wallet).
208
+
222
209
- Support ERC-6492 for undeployed Smart Wallets
210
+
- Reference the [Sign and Verify Typed Data guide](https://docs.base.org/base-account/guides/sign-and-verify-typed-data)
223
211
- Test with both wallet types
224
-
</Accordion>
225
212
226
-
<Accordiontitle="Transaction Handling">
227
-
- Support both direct transactions and UserOperations
228
-
- Implement batching where beneficial
229
-
- Handle sponsored gas scenarios
230
-
</Accordion>
213
+
<Check>
214
+
Verify your signature verification works with both deployed and undeployed Smart Wallets.
215
+
</Check>
216
+
</Step>
231
217
232
-
<Accordiontitle="Gas Assumptions">
233
-
- Do not assume users hold ETH
234
-
- Check for paymaster capabilities
218
+
<Step title="Capability Detection">
219
+
Use `wallet_getCapabilities` to detect supported features.
220
+
221
+
- Check the [Base Account Capabilities documentation](https://docs.base.org/base-account/reference/core/capabilities/overview) for available capabilities
222
+
- Implement capability-specific features using `wallet_sendCalls` or `wallet_connect` as appropriate
223
+
</Step>
224
+
225
+
<Step title="Transaction Handling">
226
+
Support both direct transactions (EOA) and UserOperations (Smart Wallet).
227
+
228
+
- Implement batching with `wallet_sendCalls` or Wagmi's `useWriteContracts` where beneficial
229
+
- Handle sponsored gas scenarios using paymaster capabilities
230
+
</Step>
231
+
232
+
<Step title="Gas Assumptions">
233
+
Do not assume users hold ETH.
234
+
235
+
- Check for paymaster capabilities before requiring ETH balance
235
236
- Provide fallbacks for non-sponsored transactions
236
-
</Accordion>
237
-
</AccordionGroup>
237
+
238
+
<Check>
239
+
Test your application with Smart Wallets that have zero ETH balance.
240
+
</Check>
241
+
</Step>
242
+
</Steps>
238
243
239
244
### For Smart Contracts
240
245
241
-
<AccordionGroup>
242
-
<Accordiontitle="Compatibility Audit">
243
-
- Remove all self-calls to `msg.sender`
244
-
- Replace CREATE with CREATE2 patterns
245
-
- Replace `.transfer()` with `.call()`
246
-
- Test with Smart Wallet accounts
247
-
</Accordion>
248
-
</AccordionGroup>
246
+
<Steps>
247
+
<Step title="Compatibility Audit">
248
+
Remove all self-calls to `msg.sender`.
249
249
250
-
## Testing Your Implementation
250
+
<Warning>
251
+
Self-calls to `msg.sender` will fail with Smart Wallets.
0 commit comments