Native Account Abstraction (via EIP-7702 Smart EOAs)
With the recent Ethereum upgrade Pectra, EIP-7702 allows you to upgrade your EOA and get SmartWallet-like functionality with:
- Much cheaper gas costs, batching functionality
- No account separation - your wallet address does not change, not even on zksync chains (once they implement EIP-7702)
- Much faster execution, with the option of paying for gas yourself or having thirdweb manage gas sponsorship, similar to SmartWallet.
The API is also drastically simplified!
Upgrade to an EIP7702 smart account, unlocking all functionality of 4337 without the downsides, and thirdweb handles the execution and gas sponsorship for you!
Upgrade to an EIP7702 smart account, unlocking all functionality of 4337 without the downsides, but sponsoring gas yourself.
"Normal" EOA Execution, no smart account functionality
When using EIP-7702 execution modes - if not already delegated to a smart account - an EIP-7702 authorization will be signed and bundled with your first transaction, similar to how 4337 works with initcode, but without the large gas costs, slower execution and chain specific requirements.
SmartWallet (via EIP-4337 Bundlers)
Instantiate a SmartWallet
to enable advanced blockchain interactions, including gasless transactions through account abstraction. This wallet type is especially useful for creating a user-friendly experience in decentralized applications.
Advanced Functionality
This method sets up a SmartWallet with optional gasless transactions, leveraging account abstraction. It's designed for developers looking to create seamless blockchain interactions within their applications.
Example
Here's how you can create a SmartWallet for a user, assuming you already have a ThirdwebClient and a personal wallet (PrivateKeyWallet or InAppWallet) set up: