Rationale
PIP-22 was proposed to add account abstraction capabilities to the Polygon PoS network. Discussions emerged within the community around safety and account abstraction alternatives. This dissection discusses the most prominent AA proposals and evaluates their advantages and disadvantages.
The overall goal is to enhance the user experience when interacting with the Polygon network through batching (e.g., approve + swap in one transaction), transaction sponsoring and more advanced account abstraction applications.
Overview
EIP-3074: AUTH & AUTHCALL
EIP-3074 introduces two new EVM instructions: AUTH
and AUTHCALL
. Using a ECDSA signatures, an EOA can delegate control over itself to a smart contract. The smart contract can then execute arbitrary code on behalf of the EOA.
EIP-5806: Delegate transaction type
EIP-5806 introduces a new transaction type that operates similarly to DELEGATECALL
within a smart contract. This allows an EOA to delegatecall a smart contract which can execute arbitrary code on behalf of an EOA.
RIP-7560: Native Account Abstraction
RIP-7560 proposes to enshrine account abstraction while remaining backwards compatible with ERC-4337 and allowing existing smart contract wallets implementing this standard to upgrade to native account abstraction.
Pros
All three proposals enable UX improvements for users in one way or another such as batching capabilities or gas sponsoring.
EIP-5806, through the delegatecall transaction type allows a user to execute arbitrary code using a smart contract. This allows for batching capabilities for example where a smart contract could accept multiple transactions from an EOA and execute them back to back, like an approval transaction and a swap on a DEX, without the need for multiple transactions. Most functionalities that can be achieved by a smart contract (except for data storage and deployment of new smart contracts) can be achieved by EOAs too with EIP-5806.
EIP-3074 expands upon the functionality of EIP-5806 by supporting gas sponsoring, meaning under EIP-3074, an EOA no longer needs to hold the native gas token in order to pay for transactions. Instead of delegating control over itself to a smart contract using a transaction, this proposal uses a signature. This allows for far more advanced use cases such as signing over control of an EOA to a video game for the duration of 30 minutes while only allowing the executing smart contract to manage in game assets of the account. EIP-3074 is also built in a future-proof way to enable more advanced functionalities like alternative signature schemes, smart contract accounts and the ability to send native gas tokens in the future.
RIP-7560 builds on top of ERC-4337 so advanced account abstraction features like key rotation or social recovery are already available using ERC-4337 today. RIP-7560 acts as an intermediary step to full account abstraction and adds two main functionalities, gas sponsoring for EOAs and a decentralised mempool for account abstraction transactions.
Cons
For both, EIP-5806 and EIP-3074, allowing a smart contract to execute arbitrary code on behalf of the EOA comes with their own set of risks. Wallet drainers have become the primary choice of scammers and phishers because they rely on the user to blindly hand over assets by signing a transaction or message. Usually, a single signature is required to steal one specific asset. With arbitrary code execution, all assets held in a single account could be compromised with a single signature of a transaction or message.
When it comes to functionality, EIP-5806 does not allow for gas sponsoring, so EOAs still always need to own the native gas token in order to be able to pay for transactions. While RIP-7560 offers advanced functionality to EOAs like gas sponsoring and validity time ranges, itâs missing a lot of additional functionality like batching.
Mitigations
Mitigation of drainer risk is being tackled by wallets already today. Many wallets already alert users of phishing sites and simulate transactions in advance to display users the in and outflows of funds as a result of the transaction. Additionally wallets display reputation scores and associate risks with smart contracts a user wants to interact with. The capabilities of wallet applications will only get better over time, mitigating a lot of the risks for EIP-5806 and EIP-3074.
Blind signing is already prohibited by most wallets due to security concerns, so special support for EIP-3074 would be required. As detailed in the EIP choosing invoker contracts that execute transactions on behalf of the EOA should be treated like choosing smart contract wallet implementations. They should be thoroughly reviewed, tested and accepted by the community. Wallet applications can leverage their existing infrastructure to warn or block users from interacting with untrusted smart contracts.
As for the limited functionality of account abstraction transactions in RIP-7560, EOAs can migrate their assets to an ERC-4337 wallet that enables the full account abstraction functionality. However, this is something that can already be done today and does not require RIP-7560.
Implementation challenges, maintenance & DevX
Each account abstraction proposal comes with their own set of changes to the EVM that need to be implemented, maintained as well as might affect developers building non AA use cases on top of Polygon. These changes can also affect infrastructure providers like block explorers and wallet applications.
Client modifications
EIP-3074 only requires changes to the EVM execution environment to handle the new opcodes AUTH
and AUTHCALL
.
EIP-5806 requires changes to the client to support the new delegatecall transaction type. An alternative mempool is not required most likely, due to the similarity of delegatecall transactions to type 2 transactions.
RIP-7560 requires the biggest changes to the client by far. A new decentralised mempool is required for the introduced AA_TX_TYPE
transaction type. Additionally, RPC endpoints need to be modified to support the new transaction type and new RPC endpoints need to be added.
Devtooling and Wallet interaction.
EIP-3074 should not affect the majority of developers, as the standard Solidity compiler should still work for all applications. For developers building on top of EIP-3074 a Solidity version needs to be patched that implements both new opcodes. With every new release of Solidity it is recommended to release new patched versions supporting EIP-3074. When it comes to testing smart contracts, the local nodes used by Hardhat and Foundry do not support EIP-3074 yet. A patched version could be offered to developers as well or efforts could be made to work with Foundry and the Nomic Foundation to enable this functionality. When it comes to wallet interactions, ECDSA signatures are already supported by all wallets. As previously mentioned additional safeguards should be added to protect users.
EIP-5806 and RIP-7560 introduce new transaction types that are not supported by common libraries to interact with EVM networks such as web3.js and ethers.js. To support the new transaction types, developers would need to call RPC methods manually to submit transactions until the libraries support the implemented proposal natively.
Infrastructure
Infrastructure like block explorers and indexers would most likely not support the proposals out of the box and would need custom implementations to support them.
Transactions utilising EIP-3074 should not really affect existing infrastructure, as there are no major changes to the execution of transactions. Emitted events and calls which are mainly used to index data on chain would remain the same. Block explorers would need to add support for patched Solidity versions in order to be able to verify smart contracts using the new introduced opcodes.
The new transaction types introduces in EIP-5086 and RIP-7560 would require custom implementations by block explorers in order to display these transactions properly to the user.
Potential future conflicts with Ethereum
The addition of new transaction types and opcodes could conflict with future EIPs implemented on Ethereum. If there is an overlap, this could create issues with infrastructure providers like wallets, that need to implement special edge cases for the Polygon network. This section analyses changes made to the execution environment of each proposal, their potential conflicts and mitigation plans.
If Polygon implements EIP-3074 there is a risk that Ethereum implements another EIP before EIP-3074 that uses the same opcodes as AUTH (0xf6)
and AUTHCALL (0xf7)
. This would mean that compiling a smart contract targeted at Ethereum would behave differently on Polygon. Fortunately, new opcodes are rarely introduced in EIPs, only two EIPs (2997 & 5478) use the same opcode slot and both are stagnant, so the risk of this happening is low.
There are multiple EIPs proposing new transaction types with the ID â„ 0x04. If Polygon were to implement EIP-5806 with transaction type 4 for example, but RIP-7560 would be accepted first on Ethereum, this would likely break many different integrations for Polygon. Similarly, if Polygon tried to avoid such a scenario by assigning a different transaction type identifier but EIP-5806 would be implemented on Ethereum using transaction type 4, the same transaction type would use two different identifiers on different networks likely causing similar problems.
Rollback the upgrade
Regardless of what proposal will be implemented on Polygon, a scenario where a different proposal becomes the standard across the EVM ecosystems might become reality. In such a scenario the selected proposal might see little to no usage on Polygon and add overhead over time. In this case it might make sense to remove the support for the proposal again to align with the wider Ethereum ecosystem and reduce complexity for future upgrades. This section explores potential issues that could arise from such a rollback of functionality.
Should EIP-3074 become obsolete, the implementation of AUTH
and AUTHCALL
could likely be deleted from the EVM implementation without a larger impact. Smart contracts using EIP-3074 would no longer work and revert, but because EOAs delegate execution to these smart contracts only, no funds would be at risk.
If EIP-5806 functionality is removed, smart contracts used for transaction delegation would still be functional and could be called normally. Depending on the implementation of the contracts, regular transactions to these contracts might still succeed but result in stuck funds, because the call is no longer delegated.
Due to the complexity of RIP-7560 as well as the ability of smart contracts to send AA_TX_TYPE
transactions, it is likely not feasible to roll back the upgrade and might result in stuck funds.
Functional evaluation
In the quest to seamlessly integrate the next billion users into the crypto ecosystem, the interface and interaction layer must evolve to become so intuitive and user-friendly that users may not even realise they are using a wallet. While EIP-5806 and RIP-7560 offer significant improvements for current users, they seem to primarily cater to this existing audience, improving their experiences rather than revolutionising access for new entrants. EIP-5806âs lack of gas sponsoring capabilities requires applications to continuously ensure their usersâ wallets are sufficiently funded with gas tokens. For RIP-7560 to unleash its full capabilities, it requires applications to deploy ERC-4337 smart contract wallets on behalf of their users to leverage the advanced features offered by RIP-7560.
EIP-3074 stands out by enabling straightforward transaction sponsorship, effectively removing a significant barrier for end-users. It provides flexibility in execution, which is important for the development of non-custodial applications across various domains, such as investment platforms or gaming, that might employ MPC wallets integrated with social logins. In such scenarios, the conventional concerns regarding blind signing diminish, as the application assumes complete oversight of the userâs assets during their active session.
In summary, while EIP-5806 and RIP-7560 enhance the experience for current blockchain users by addressing specific limitations, EIP-3074 presents a more holistic solution aimed at broadening cryptoâs appeal and accessibility.