[EVM: Zero to Hero] Smart Contract Wallets
Explaining what powers the worlds most valuable blockchains
Welcome to Article 3 of EVM: Zero to Hero. This series helps you learn about technical web3 concepts in a simple and fun way.
In case you missed it, here’s what we covered in Article 2:
Some basic cryptography: Caesar’s cipher and asymmetric key encryption
EVM account types: EOAs and contract accounts
Pros and cons of each account type
We also briefly introduced smart contract wallets (SCWs) and how they address the shortcomings of traditional EOA wallets.
In this article, we’ll dive deeper into the use cases of SCWs and how they work under the hood. We’ll also talk about an exciting update coming to the EVM that could make SCWs even more powerful!
Smart Contract Wallets
As a refresher, here are the pros and cons of the two EVM account types that we discussed in the last article:
We also talked about wallets, a term for applications that help you manage your crypto. Most wallets are EOA-based, meaning they help you manage your private keys. However, as seen in the chart above, EOA wallets suffer from two major issues:
Error-prone. If you lose your private key, you lose your money
Inflexible. There is no “custom” functionality of EOAs when managing your funds. You can use them to manually send crypto to someone else, and that’s it
Smart Contract Wallets (SCWs) address these issues. SCWs use the customizability of smart contracts to provide an enhanced wallet experience through features like:
Multi-user transactions. With an EOA wallet, whoever owns the private key can make unilateral decisions over the funds in the wallet. A SCW can be set up such that multiple private keys are needed to move funds. This is useful when companies want to make sure all C-suite executives sign off before sending money.
Spending limits. Regular wallets have no limit on how much money can be moved out of them. A SCW can enforce that only a certain amount of money can be spent in a single day. This is useful when companies give employees a daily stipend.
Emergency lock. If someone steals your private key associated with an EOA account, there’s nothing you can do. However, if you’re using a SCW, you can tell the smart contract to “freeze” your assets if you believe someone may have compromised your account.
These features are possible because smart contracts are programs, and developers can code programs to do whatever they want. If you wanted to create a SCW that only allowed you to spend money on Tuesdays, you could!
As you can tell, many of the features that SCWs enable are what we’ve all come to expect from modern financial tools. This is why SCWs are exciting: compared to EOA wallets, smart contract wallets provide a more intuitive user experience, lowering the barrier to entry into web3.
Peeking Under The Hood
It’s important to remember that smart contract wallets are still, well, smart contracts. This means they cannot initiate transactions themselves, and still require an EOA to initiate transactions on their behalf.
From the last article:
The EVM only supports transactions that have been signed with a private key. Since smart contracts don’t have private keys, they can’t create transactions! Therefore, only EOAs can create transactions that in turn call smart contracts.
As a result, smart contract wallets typically follow a pattern where they have assigned EOA(s) from which they accept transactions. You can think of a SCW as a “customizable intermediary” between a user and a target smart contract.
While this may sound cumbersome, the benefits of handling funds in the smart contract layer outweigh the additional process needed to use a SCW. A step in the right direction!
The Downsides of SCWs
While there are clearly benefits to using smart contract wallets, there also are a few downsides worth mentioning (sigh… no free lunch).
Still Need an EOA. As we talked about above, smart contract wallets still need an EOA from which to originate transactions. Managing an EOA and a SCW can be cumbersome. However, SCWs mitigate the risk of private key issues because it’s possible to switch EOA owners or support multiple EOA owners.
Deployment Costs. It costs money to create a smart contract. We haven’t covered it yet, but gas is the term used to describe the cost of creating or interacting with smart contracts. It costs about $10 USD to create a SCW on Ethereum, but other chains are much cheaper. On the other hand, creating a public-private keypair for an EOA is free.
Hacking Risks. Without directly stealing a private key, an EOA is virtually unhackable. However, SCWs have code, and code can have vulnerabilities. It’s important that you use a smart contract wallet from a reputable company.
Despite these downsides, smart contract wallets are still gaining steam due to their customizability.
The Future: Account Abstraction
One of our goals with this series is to not only educate you on the current state of the EVM now but also what it will be in the future.
Account Abstraction (AA) addresses Downside #1 from the previous section. Specifically, AA allows for transactions to be initiated without a private key, meaning smart contracts can initiate transactions!
With AA, there is a world where EOAs are no longer important. Previously, SCWs needed to specify an owner EOA, which was secured by a private key. Now, AA enables SCWs to support any authentication method, whether it be traditional username & password, login with Google, or something else.
This is a big step forward in improving the usability of EVM blockchains!
So How Is AA Actually Going to Happen?
There are many ways to implement Account Abstraction. Proposals for AA (and other EVM improvements) are submitted as Ethereum Improvement Proposals (EIPs). EIPs are a way for the Ethereum community to discuss proposals and weigh their pros and cons. Eventually, if there’s enough support, EIPs are integrated into the EVM.
There have been a few suggestions for how to implement AA over the years, but the current favorite is EIP 4337. We’re a little too early in this series to talk about the proposal in more detail, but we’ll be covering it soon enough!
Recap
Enjoyed this article? The next in this series is article is out now!
In today’s article, we covered:
The benefits and downsides of smart contract wallets
How smart contract wallets work under the hood
A peek into the future of the EVM with Account Abstraction
As always, feel free to reach out on Twitter or via email at shekar@ramaswamy.org with any questions or feedback.
Next time, we’re going to be deep diving into the anatomy of smart contracts. We’ll take you through their special properties and how they work behind the scenes. Stay tuned!
How do you feel about EVM: Zero to Hero?
Further Reading
A great overview of Account Abstraction