Written by: 0xjs@黄金财经
At the 183rd ACDE meeting of Ethereum held on April 12, 2024, EIP-3074 was officially included in the next Ethereum hard fork Pectra upgrade (Prague upgrade for short).
Therefore, EIP-3074 has received attention from the Ethereum community. Many people in the Ethereum community believe that this EIP will forever change the way users interact on the EVM chain, making the wallet user experience simpler, cheaper and more powerful.
So, what is EIP-3074?
What is EIP-3074?
One sentence description:EIP-3074 gives EOA wallet smart contract functions (such as account abstraction), including the ability to perform single transaction approval, batch transactions, wallet asset recovery, sponsored transactions, etc..
EIP-3074 was proposed by Ethereum researcher Sam Wilson, Go Ethereum developer, and others to turn existing EOAs into smart contracts by adding two new EVM opcodes, AUTH and AUTHCALL. These two opcodes work together to allow smart contracts to act on behalf of EOAs.
AUTH opcode (0xf6): This opcode allows a user to authorize a specific EOA by checking the ECDSA signature. The signature must be made with the EOA's private key and requires overwriting a specific message (commit).
AUTHCALL opcode (0xf7): This opcode allows an authorized smart contract to start a transaction from the EOA's account. It works similarly to the existing CALL opcode, but uses the authorized EOA as the sender instead of the contract itself.
AUTH takes the user's signature and intended action and verifies that their signature is correct. It sets a variable to account for the origin address of the txn, allowing a smart contract to perform actions on behalf of an EOA, thereby implementing delegation of authorization control. AUTHCALL then calls the target contract using the initiator address as the caller instead of the actual msg.sender.
EIP-3074 workflow and new use cases
are as follows:
The user signs a message (off-chain, not a transaction)--->The user or initiator sends the message as a transaction to the caller contract--->The caller uses AUTH and AUTHCALL to verify and call each target contract with the user as the sender's address
This new transaction flow has gained some use cases, such as:
Use Case 1: Sponsored Transaction. Assume that Bob does not have any ETH in his wallet. Applications can provide Gas for Bob's transaction without the need to buy/bridge ETH. This could be huge for getting mass retail adoption.
Use Case 2: The ability to perform multiple operations in one transaction. Currently in order to swap tokens on Uniswap, users must first approve Uniswap to use their own tokens and then run the actual swap. With EIP-3074, these two operations can be batched into a single transaction.
Use Case 3: Asset Recovery. A special caller contract can be set up so that users can use social recovery to recover their assets if they lose their private keys. If the social recovery conditions are met, a signature can be submitted to the caller to move the assets.
What does EIP-3074 mean for Ethereum?
Before EIP-3074: Smart contracts require users to sign transactions when interacting with smart contracts. Therefore, users need to participate in some message signing for on-chain tasks performed every day.
After EIP-3074: Users can sign a key once and grant smart contracts permission to sign transactions from the user's wallet. Users can sign this permission with their own keys and then they are ready to go. It will be a game changer for web3 games, where users can sign a session once and then play the entire game without worrying about interacting with smart contracts.
Unlike ERC-4337's upgrade at the contract level, the advantage of EIP-3074 is that it is upgraded from the EVM instruction level, and users can enjoy the functions of smart contracts without special additional settings. For example, the three use cases mentioned in the previous section will greatly improve the Ethereum user experience.
Having said so many advantages, what are the disadvantages of EIP-3074?
The biggest one is the caller. The caller contract needs to be fully audited, non-upgradeable and trustless, otherwise the user's funds can be easily stolen.
In addition, some existing reentry checks may not apply to EIP-3074.
Because EIP-3074 adds two new opcodes, a hard fork is required to add this change. This is part of the reason why EIP-3074 was postponed and ERC4337 was adopted first.
The account-abstracted ERC-4337 does not require a hard fork, it is purely a change to the contract and off-chain system.