Detailed analysis of ERC-4337: How far are we from popularizing smart contract wallets?
A&T Capital
2022-09-19 11:00
本文约3779字,阅读全文需要约15分钟
An article to appreciate the past, present, and future of Ethereum wallets.

Primer

Primer

  • The current mainstream Ethereum wallet (referring to EOA wallet) has very limited user experience, and the following convenience functions can only be completed through smart contract wallets (some off-chain auxiliary solutions can provide convenience, but will introduce unnecessary external risks, so it is not in within the scope of this article).

  • No private key & mnemonic experience, social retrieval (eg Argent, Unipass)

  • Batch transactions (eg Gnosis Safe)

In purely on-chain games, there is no need for multiple signatures (Session Key)

Fortunately, we are already very close to the prevailing smart contract standard, which means users will soon have a 100x better Ethereum wallet experience!

Interpretation: smart contract wallet, account abstraction and ERC-4337

Smart Contract Wallet is one of the two wallet forms currently supported by Ethereum, and the other is the EOA wallet (eg Metamask) commonly used by the public.

  • As the name suggests, all the aforementioned good values ​​benefit from smart contracts:

  • The smart contract account is controlled by its code: by writing the code, any logic can be realized.

In contrast, an EOA wallet is an address on the blockchain controlled by a private key from which users can issue transactions.

  • But the limitations of the "private key is the account" feature are also obvious: users cannot authorize another key to sign for a given address, nor can they write custom logic on it.

Important addition: smart contract wallets can be compiled to have the exact same experience as EOA (only one signing key, not upgradeable, etc.), but not the other way around.Account Abstraction

ERC-4337 It is to reduce complexity and improve effectiveness by omitting unnecessary details in the Ethereum account system (eliminates the need for EOA and special handling of smart contract wallets), and finally provides the basis for the aforementioned valuable functions! (Refer to the explanation of Abstraction in Computer Science [1])

  • It is one of the designs to realize the abstract utility of accounts:

  • It is realized without modifying the underlying core protocol of the blockchain. (ERC-4337, it is expected to run through in the near future)

It is implemented by modifying the underlying core protocol of the blockchain. (EIP-3074, in EVM will be mid to long term plan/Starkware/zksync is almost done)

Framework level comparison: EOA wallet, current mainstream smart contract wallet and ERC-4337 wallet

(If you are not interested in technical details, you can skip directly to "Advantages of ERC-4337 compared to current mainstream smart contract wallets")

Auxiliary reading tips:

EOA

In the figure above, the dividing line divides each frame into three parts: the user signature phase, the relay phase (before the transaction is packaged in a block), and the final execution phase (after the transaction is packaged in a block). Hope this division can give you a better understanding.

A transaction, signed by the user with their private key using standard ECDSA, is then sent to the Ethereum Mempool where miners pack it into the next block.

Current smart contract wallet

The biggest difference from EOA: For the sake of network security and better UX, the current mainstream smart contract wallets need to build & operate a replayer to send user information to the final smart contract wallet.

ERC-4337

Considering that there is no common development standard in Ethereum's current mainstream smart contract wallets (eg Safe, Argent, Loopring), each project must develop & maintain its own relayer and related fee modules, and independently audit its adoption smart contract functions.

  • The biggest difference from the current mainstream smart contract wallets is:

  • Build a common module Useroperation Mempool & Bundler to replace the relayer module independently developed by each project;

Introduce the Entry Point smart contract to optimize the user experience of creating a new wallet and the smart contract wallet to verify the feasibility of user-operation and other processes.

The specific process is as follows. Unlike transactions, User Operations issued by users will be collected into User Operation Mempool, and Bundler will package several User Operations (with gas fee attached) and send them to Ethereum’s transaction mempool. Block producers include until the next block.

The above packaged User Operation will be processed by the Entry Point smart contract, including the initial deployment of the smart contract account and verification of the user User Operation object.

Ultimately, user User Operation is handled by the smart contract wallet selected by the user.

  • The advantages of ERC-4337 compared to the current mainstream smart contract wallets

  • Each smart contract wallet does not need to operate a separate relayer;

  • The highly convenient smart contract function modules are universal, which greatly saves the cost of reinventing the wheel;

After being packaged by Bundler, the fixed cost of the transaction can be amortized, ultimately reducing the user's transaction cost.

How far are we from popularizing smart contract wallets?

100% EVM chain

(Thanks to https://hackmd.io/@erc4337 [2]) for the great help)the answer issoon

up. The core contract is basically ready, and several excellent teams are about to release production-level ERC-4337 native client wallets!

To deploy ERC-4337 - a common standard for the entire EVM ecosystem, several major modules need to be developed (shown in red dots above):

① Production grade ERC-4337 native client wallet

While ERC-4337 does not specify a signature scheme, relying on MetaMask to use ERC-191 or ERC-712 signed dapps for UserOperation is not an optimal user experience. Market requires client wallets to natively support proxy wallet addresses and their UserOperation transactions through a dedicated standard signature scheme.

② UserOperation Block Builder Bundler

Development progress:

The main mode of operation of the ERC-4337 network requires at least a certain part of the network block building structure (eg miners, validators, orderers, etc.) to natively support UserOps in its public P2P mempool, and use these UserOps to create bundles and include Entry Point transactions are in a block.

Development progress:

③ Entry Point Smart Contract

The core part of ERC-4337.

Development progress:

④ Production level ERC-4337 ECDSA proxy wallet smart contract

The main mode of operation of ERC-4337 assumes that each user will acquire an identity represented by a proxy wallet. This means that providing a secure implementation for such wallets is critical. This also means that we must ensure that the user's proxy wallet address is deterministic and consistent across the network, just like EOA.

Development progress:

⑤ ERC-4337 Client SDK

This part aims to make it as easy as possible to integrate ERC-4337 into various wallets and dapps, such as continuing to use MetaMask while experiencing the functionality of ERC-4337.

Development status:

Although these functions are not a necessary part of the ERC-4337 wallet, the value of the ERC-4337 wallet must be built on it.

Development progress:

Development progress:

Not 100% EVM L2 (eg Starknet)The answer is earlier than the EVM environment.

As a non-EVM equivalent blockchain, Starkware can more easily implement account abstraction (compared to Ethereum and a 100% EVM environment) with some modifications at the protocol level.

image description

The basic process of Account Abstraction on StarkNet

Currently, progress in account abstraction is almost at a production-ready level, and Starkware has released StarkNet Alpha 0.10.0 (inspired by ERC-4337) which includes account abstraction improvements

  • Some interesting stuff has come up during the [DevConnect StarkNet Hackathon]:

  • Session Key: By creating a one-time signing key stored in the browser, users only need to sign in the game once for a period of time. This eliminates the need for players to sign duplicate deals. (Briq & Realms [3])

  • Dead Man's Switch: If the account is not used for a certain period of time, this design allows trusted accounts to access the assets in your wallet and transfer the ownership of the account to the designated person, so as to solve the problem if the original holder disappears. Transfer of account assets. (deadman [4])

Game union multi-signature system: Allows token holders to open their NFT usage permissions within the union while retaining ownership. (Guildly [5])

Product form and value capture

Product form: In the end, it may not be the same as what I have seen so far

Recalling the previous content, the main contract of account abstraction and even the wallet client SDK will be open source, which means that it is very easy to launch a basic wallet (without various fancy functions) based on the account abstraction framework. Then there are already a lot of great convenience features in the open source community, and more can be expected. Best of all, these basic wallet and convenience features are all under the same standard!

Then, the product form will probably be like this: anyone can build a standardized front-end, and load a plug-in market with convenience functions, allowing users to use the plug-ins they want to use, and display the plug-ins currently in use (I am not a PM Or artists, if the picture below is ugly, please forgive me :)

Value capture: we need to confront the revenue model of public goods again

Referring to the aforementioned theory, if the basic interface will be precipitated into the underlying infrastructure, and most of the convenience functions will also be open source, how to do value capture?

Of course, the wallet can continue to use the swap function to realize traffic monetization.

Can mass users get used to pay-per-view for public goods?

end

end

Just as Vitalik has repeatedly explained the account abstraction publicly: account abstraction is the only way for the blockchain network to reach the mainstream crowd! Hope this article gives you a better understanding of it.

Although there are still many practical limitations (eg many dapps that do not support EIP-1271 >>> smart contract wallets cannot interact with these dapps), and it is not suitable for multi-chain scenarios. But just like L2 is the future of Ethereum, I believe account abstraction is the future of Ethereum wallets!

Original link

Original link

A&T Capital
作者文库