What is a Smart Contract Wallet? ERC-4337 Explained
As the name implies, a smart contract wallet uses smart contract code to automate transactions, manage assets, and enable more powerful features. Learn more.
Web3 wallets are a user’s key to the blockchain — allowing you to access and interact with decentralized applications (or dApps), store digital assets (like NFTs), manage cryptocurrencies, and more. But as most users know, web3 wallets in their present form aren’t easy to use — making it more difficult for new participants to enter the space.
Enter smart contract wallets: the next evolution in web3 wallets, providing an infinitely-smoother user experience and enabling powerful use cases on Ethereum — such as automatically generating wallets for your users when they sign up, removing the need to sign every transaction on dApps, allowing for better collaboration with team wallets, and more.
In this blog post, we’ll cover everything you need to know about smart contract wallets, how they work & what the use cases are (especially after the introduction of account abstraction through ERC-4337), and how to get started with smart contract wallets — whether you're a user or a developer.
What is a smart contract wallet?
A smart contract wallet is a type of non-custodial web3 wallet that uses smart contracts to operate and manage assets. By adding different types of logic to the smart contract’s code, smart contract wallets unlock powerful new features — such as recoverable wallets, signless transactions, batched transactions — that are not possible with traditional crypto wallets like MetaMask.
In short, smart contract wallets offer users all of the same features that traditional wallets have — but with enhanced security & advanced customizations on top — paving the way for a better web3 user experience and better use cases, as we’ll see in the coming sections.
But before diving deeper, we first need to take a step back and understand what Ethereum accounts are, and the two main types: externally-owned accounts (EOAs), and contract accounts.
An Ethereum account is a ‘digital address’ used to send, receive, and store Ether (ETH) and tokens on the Ethereum blockchain. Depending on how an account is managed or controlled, we can classify it into one of two types: an externally-owned account (EOA) or a contract account.
What is an externally-owned account (EOA)?
An externally-owned account (or EOA) is an account created by generating a public-private key pair. The account owner (individual or organization) can then use the key pair to access and manage the funds associated with the account.
Most of the popular web3 wallets on Ethereum (such as MetaMask, Coinbase Wallet, and Rainbow) are EOAs. You can use them to initiate transactions with other EOAs or smart contracts and even send transactions to contract accounts.
Today, EOAs are fundamental to interacting with blockchains — but for new (and existing) users, their UX is not the best.
For a user to interact with the blockchain through an EOA, they must: create a wallet, store their private keys, purchase & transfer funds, pay gas fees, and sign every single action that they take on a dApp.
These shortcomings limit the use cases of EOAs. This is where contract accounts come into play.
What is a contract account?
A contract account is a smart contract that acts as a cryptocurrency wallet. You can code various logic and parameters into the contract to define how you want the wallet to function — such as automating certain transactions or setting spend limits.
One key differentiator between EOAs and contract accounts is that a contract account doesn’t have a private key, so it can’t initiate transactions on its own. But when a transaction initiated by an EOA triggers its code, it can execute various kinds of advanced operations.
This is how popular smart contract wallets (such as Safe, Argent, and Biconomy) work, as a product of contract accounts. But how does one use contract accounts? How do smart contract wallets work? Let’s dive deeper.
How does a smart contract wallet work?
The inner workings of a smart contract wallet may vary from wallet provider to wallet provider, but they all follow a similar logic:
- Smart contract wallets cannot be created individually like EOAs. To create a smart contract wallet, you must initiate a transaction using an EOA to deploy the smart contract on the blockchain. As this smart contract needs storage on the blockchain, there’s a gas fee attached to creating these wallets, which is unlike EOAs that are free to generate.
- The EOA that you use to deploy the contract is by default linked to your smart contract wallet as the“parent” wallet or admin. Similar to an EOA, every smart contract wallet gets a unique 42-character hexadecimal address. But it doesn’t have a private key, which is why it needs an EOA as admin.
- To execute any transaction from the smart contract wallet, you must first initiate the transaction from the EOA that’s set as the admin of the wallet. The smart contract can identify a request directly from admin EOA and you can manually execute the transaction from the wallet interface.
If this sounds more complicated than using an EOA, that’s because it is. But the recent introduction of account abstraction (ERC-4337), or 'smart accounts,' makes this much easier for developers & users alike.
But before we dive into smart accounts and how they improve on today's smart contract wallets, we need to better understand the key features of smart contract wallets — and thus, why ERC-4337 is such a major upgrade to them.
1. Multi-signature capability
Smart wallets allow you to add trusted third parties and assign them specific roles. For example, you can add your hardware or hot wallet or other people you trust as your co-signers or guardians.
Co-signers can help you execute multi-signature transactions.
So, let’s suppose you share a business wallet with your accountant and your business partner. You can set them up as co-signers, such that every transaction would need at least two signatures.
Now, every time the accountant makes a payment, it would only execute when you or your business partner sign the transaction.
Similarly, when you set up guardians, they can help you recover your wallet and assign a new admin EOA in case you lose access to the original one.
This is one of the most crucial innovations of smart contract wallets as they do away with the primary concern of losing all funds if you lose your private keys or seed phrase.
2. Customizable transaction controls
Unlike EOAs that only allow you to initiate transactions and approve them, smart contract wallets help you set a range of parameters for managing transactions.
For example, you can set a daily transaction limit, whitelist and blacklist addresses, set a time when you do not need your guardians to sign multi-sig transactions, bundle multiple transactions into one, and more.
3. Advanced security measures
Apart from assigning guardians, co-signers, transaction limits, etc., you can add another layer of security using either in-app multi-factor authentication or third-party authenticators.
It is important to note that these features and customizations may vary depending on the wallet provider you use.
List of 10 most popular smart contract wallets
There are many smart contract wallets that users can use today, each with its own unique features. Some of the most popular smart contract wallets include:
How are smart accounts (ERC-4337) different from existing smart contract wallets?
ERC-4337 is a newly deployed Ethereum standard that introduces account abstraction, or smart accounts, to all EVM-compatible blockchains. Despite how similar smart accounts and smart contract wallets sound, they have some contrasting differences.
Account abstraction simply refers to separating (abstracting) an account from the blockchain, without making any changes to the underlying blockchain. The contract accounts created using account abstraction are called smart accounts.
The reason smart accounts are groundbreaking is that until now, smart contract wallets needed a separate EOA with a private key to initiate a transaction, as we discussed in the above section.
So, for every transaction users had to pay extra gas from the EOA to send the transaction to the contract. As a result, smart contract wallet owners also had to maintain an ETH balance in a separate EOA. Or, they could use third-party relay systems, which are mostly centralized.
Account abstracted wallets or smart accounts get rid of the need for EOAs. Instead, smart accounts can send a UserOperation object that defines the purpose of the transaction and has the relevant data for verification.
The requested UserOperation goes to an alt mempool — a waiting area specifically for pending smart account transactions — and waits for bundlers (nodes) to pick up transactions, bundle them, and pay the gas for the transaction to register all UserOperation in a block.
To prioritize transactions, bundlers use a similar logic to how miners or validators prioritize transactions in the mempool based on the fee associated with each of them. Bundlers earn the combined fee paid within all UserOperation they bundled.
On top of everything that smart contract wallets offer already, smart accounts add even more powerful features on top. Here are a few of them:
- Simplified user experience. EOAs, private keys, or seed phrases go out of the picture, thus adding another level of simplicity for crypto wallet users.
- Decentralized operation: Smart accounts rely on a distributed network of bundlers or nodes instead of centralized relayers.
- Standardized contract accounts across all EVM chains: While there exist other account abstraction solutions like Argent or Biconomy, ERC-4337 standardizes account abstraction throughout the EVM ecosystem.
Use Cases for Smart Contract Wallets & Smart Accounts
Although smart accounts are new as an Ethereum standard, they have many use cases. Here are some of the most important ones:
- Recoverable wallets: Smart accounts enable the development of recoverable crypto wallets without the need for EOAs, private keys, or seed phrases.
- Auto-create wallets for app users: Companies or projects can easily generate new non-custodial crypto wallets for their users the moment they sign up. Users will no longer have to worry about managing private keys or remembering seed phrases.
- Team wallets: Teams can set up team wallets using smart accounts, where they can add multiple users with tiered permissions, thus giving them only the required level of control.
- Custom transactions: As discussed in the smart contract wallets section above, smart accounts offer a range of customizations for transactions, such as setting transaction limits, specifying durations within which transactions are approved without signers, blocking certain transactions or requests, etc.
- Gas upgrades: ERC-4337 introduced the ability for dApp developers to pay the gas on behalf of their users. This can be especially useful for free NFT mints or other kinds of airdrops. Further, smart account users can add fees in any ERC-20 token they prefer, compared to EOAs that only allow gas to be paid in ETH.
FAQs
How do smart accounts differ from smart contract wallets?
Smart contract wallets existed before ERC-4337 standardized account abstraction for all EVM chains. Account abstracted wallets or smart accounts add on top of the benefits of smart contract wallet benefits. See sections How Smart Accounts Work and Use Cases of Smart Accounts.
What chains support account abstraction or smart accounts?
Smart accounts are a product of Ethereum standard ERC-4337, and will be supported across all EVM-compatible Layer 1 and Layer 2 chains such as Ethereum, Polygon, Optimism, and 700+ more chains.
How do bundlers make money?
Each transaction requested from a smart account comes with associated fees, which the bundler earns when they relay the transaction to the chain.
Closing thoughts: Are smart accounts the future?
In conclusion, smart accounts significantly increase the potential of previously existing smart contract wallets. They standardize account abstraction across EVMs and remove the need for EOAs and seed phrases for end-users.
With lower barriers to entry, more users would finally be able to access, use, and manage crypto assets with the same ease they manage their fiat balances and transactions. And although EOAs won’t stop existing anytime soon, smart contract wallets will become the default in web3 — especially among users that are new to the space.
If you have any questions, join 33,000+ other builders in our Discord community — or reach out to the team directly for more info on how to get started with smart accounts.
And if you want to start building web3 apps with smart accounts, get started with thirdweb’s web3 tools & SDKs — they’re free!