The new Ethereum ERC-4337 standard seeks to allow the creation of more flexible and powerful wallets for users of this blockchain and its different services.
One of the most recent updates within Ethereum is known as Account Abstraction or Account Abstraction, which has been implemented following the standard, ERC-4337.
What exactly is the Account Abstraction or Account Abstraction that ERC-4337 claims? We are going to explain in a simple and understandable way what this new standard is and what functionalities it offers to the Ethereum network.
Account Abstraction or Account Abstraction, the new improvement of Ethereum
Account Abstraction or Account Abstraction is an improvement of Ethereum that was presented by Vitalik Buterin, Yoav Weiss, Kristof Gazso, Namra Patel, Dror Tirosh, Shahaf Nacson and Tjaden Hess, on September 29, 2021, under the EIP-4337 (EIP or Ethereum Improvements Proposals, better known as Ethereum Improvement Proposal).
Its objective is to allow the creation of an infrastructure capable of offering intelligent accounts controlled by smart contracts. In this way, the users of these accounts can enjoy unique capabilities such as:
- Key recovery.
- Automatic and recurring payment system.
- "Sponsored" gas rates (at zero cost to the user).
Everything in a simple way, using a single standard and without giving up decentralization in account control.
The idea of account abstraction is nothing new. In fact, the original idea has been under construction for more than 9 years and has had the participation of important players such as VISA.
However, it was not until February 22, 2023, that the developers decided to deploy this improvement on Ethereum, through the release of eleven (11) smart contracts that give rise to what is known as EntryPoint.
How does the ERC-4337 work?
To understand how ERC-4337 works, we must first understand how accounts are set up within Ethereum. On the network, we have two types of accounts:
- Externally Owned Accounts (EOA or Externally Owned Account). They are the ones we normally use in purses such as Dappradar. That is, they are accounts that are managed by a wallet, which is in charge of generating the private keys, the public keys and is also in charge of interacting with the network (requesting balances, interacting with smart contracts, sending payments, etc. ).
- Contract Account (CA) or Smart Accounts. A CA is a type of account managed by a smart contract. For example, the accounts of a staking pool from Uniswap. The same goes for DAI Vaults or any other type of account managed by smart contracts.
Knowing this makes it easier to understand how the ERC-4337 works. The improvement aims to allow users to use a wallet that supports this standard to generate accounts that they can manage. However, these accounts are controlled by a smart contract.
Thus, the user only has to interact with the smart contract to recover their access and access to their tokens contained in said smart contract. It is just as it currently happens in staking pools, only this time, ERC-4337 is developed to be much easier and safer to use and implement.
low level operation
To accomplish this, the ERC-4337 replicates the functionality of the transaction mempool in a higher level system using smart contracts.
First of all, the user's operations along with signatures and other data are taken for verification. This process is possible thanks to the joint work between the validators and the Flashbots, who are in charge of grouping these operations into «a single bundled transaction“, which is later included in an Ethereum block.
The gas tariff is paid by these actors, who, in turn, receive compensation from all the individual operations grouped together, as happens in the mempool. The same criteria is used to prioritize operations, only in this case other variables come into play, such as:
- Knowledge of the sender or the wallet that performs the operation.
- Nonce and signature, which are parameters passed to the verification function of the wallet, in order that a transaction can be verified.
- initCode, which is an init code to create the wallet with if it doesn't already exist.
- callData, which is wallet call data for the actual execution step.
- The remaining fields have to do with gas management and commissions; the full list of fields can be found in the ERC 4337 specification.
In this way, a wallet with ERC-4337 support becomes a wallet managed by a smart contract.
Advanced features of the ERC-4337
What advantages does the implementation of ERC-4337 offer in Ethereum and its wallets?
Account recovery
One of the most common facts within the ecosystem is the loss of access to our accounts. lose data like seed phrase in an accident or the loss of a physical purse (hardware wallet) are quite frequent events. Normally, a loss of this type is irrecoverable and with it millions of euros in value are lost. But what if we could change that?
This is where the ERC-4337 comes in. Because the account is controlled by a smart contract, it is possible schedule account recovery conditions. For example, if the account has had a certain amount of inactivity, we can schedule it to return the tokens to a previously given address, which would allow us to recover that balance.
Or better still, we can program the wallet with a series of conditions that allow us to earn the recovery of the money more directly. For example, if we sign a transaction with a certain message (our secret) and a destination address, and send it to the address, the smart contract can detect this and perform a balance transfer to the previously given address, allowing us to recover the balance of that purse.
In short, the ERC-4337 allows for account recovery schemes that would be impossible with a traditional account.
Use of 2FA in our accounts
Another advanced function that we can enable thanks to the ERC-4337, is the execution of transactions under conditions that must be met. Imagine for a moment that you have a shared account and that you have limited it to make expenses of 1000 euros per month.
In case the limit is exceeded, it would be necessary to apply a 2FA in which you and your partner must sign the transaction to make it valid.
Well, the ERC-4337 can do just that. With proper programming, it is possible to create an account with two signatures and set a monthly spending limit, and if exceeded, subsequent transactions will require approval from both parties in order to complete.
Of course, the previous case is just a sample of the capacity, which can be adapted for more things, depending on the needs of the users or the platform on which the account is deployed.
Advanced operating capabilities
In addition, the ERC-4337 activates a set of advanced operating options. For example, with this standard it is possible to execute several operations with our wallet and sign all of them in a single occasion. In this way, the same transaction in Ethereum can execute two or more operations in an atomic and transparent way, requiring only one approval for them.
With this type of operation, for example, we can operate in a certain DEX, executing several operations at the same time, and in the end, issuing all of them as a set, which reduces the cost in commissions of our operations.
More effective use of cryptography and updates
Another advanced property of the ERC-4337 is that it allows us a more effective use of cryptographic advances. For example, with a little modification, we can adapt the ERC-4337 to use Schnorr signature schemes, which would make our transaction operations on the network more secure and economical.
Likewise, we can with a small update of the smart contract, make use of future advances in the EVM. For example, we can employ ZK cryptography upon arrival of the zkEVM (Zero Knowledge EVM) or quantum-resistant cryptography implementation. If anything, ERC-4337 flexes developers' ability to adapt these technologies and apply them quickly so we can explore them.
multi-chain support
Another advanced property of the ERC-4337 is that it offers support for multiple strings. This is possible thanks to the fact that it is a smart contract built on the capabilities of Solidity and EVM. This means that any network that supports these two technologies can successfully implement the ERC-4337 standard.
Thus, networks such as Polygon or Gnosis can take advantage of this capability for their networks and offer greater functionality, something that, in fact, is already being done in the respective testnets of this and other EVM-compatible networks.
Pros and cons of implementing ERC-4337
However, the implementation of ERC-4337 offers us a series of pros and cons, among which can be identified:
Pros
- It does not centralize the control of the wallets. This is thanks to the fact that their control remains decentralized at all times.
- Improvements in the security of wallets. From the use of advanced options such as 2FA, greater ease in the implementation of multi-signatures, among other improvements at the cryptographic level, ERC-4337 offers better security for wallets that implement the standard. In addition, it reduces complexity in the development of wallets.
- Reduces the complexity in the management and control of purses. A feature that undoubtedly helps to spread access to this technology by people who are not used to or do not have great knowledge of cybersecurity and cryptocurrencies.
- Multi-chain support and interoperability. Thanks to the use of Solidity and EVM, which are the only requirements that chains where this standard is deployed must meet, without the need to alter the consensus protocol in any way.
- It maintains the possibility of replacing commissions. To do this, it is only necessary to send a new operation with a higher commission.
- Flexibility of the execution logic. This allows wallets to add custom logic to the execution step, for example, perform atomic multi-operations.
Cons
- Slight increase in DoS vulnerability. This is despite the best effort of the protocol, simply because the verification logic is allowed to be somewhat more complex than the status quo of a single ECDSA verification.
- gas overload. Slightly more gas overhead than normal transactions (although offset in some use cases by multi-trade support). This is due to the need for intermediation of ERC-4337 smart contracts. Bottom line: higher fees for using this feature.
- One transaction at a time. Accounts cannot queue and submit multiple transactions to the mempool. However, the ability to perform atomic multi-operations makes this feature much less necessary.