An article to understand how EIP-4337 (account abstraction) will improve Ethereum UX
DeFi之道
2022-10-12 13:00
本文约2060字,阅读全文需要约8分钟
What does account abstraction mean to us? How to implement account abstraction for Ethereum?

Original author:Nishil, Researcher at Biconomy

Compilation of the original text: The Way of DeFi

Compilation of the original text: The Way of DeFiEIP-4337One of the main disadvantages of ethereum is the complex user experience, let us understand the proposed by nethermind and opengsn researchers

How to try to solve this problem with Account Abstraction.

How will account abstraction EIP-4337 improve Ethereum UX?

So, let's start with what Account Abstraction (AA) means.

1. Definition of Account Abstraction (AA)

Account abstraction can provide users with the ability to simplify the use of accounts, thereby reducing the need to understand the underlying process.

It's like we use a gmail account without knowing how it works.

With account abstraction, we have the opportunity to escape the scary world of mnemonics.

We can enable different signing options, gas fees can be sponsored by the Dapp or paid in fiat currency, etc.

Now that we know what the definition of Account Abstraction (AA) is, let's understand how to bring it to Ethereum.

2. How to implement account abstraction for Ethereum

  • There are currently two types of accounts on Ethereum: externally owned accounts (EOA) and smart contract accounts.

  • The so-called Externally Owned Account (EOA) means that these accounts are controlled by the user's key pair (public key and private key). This is the way most users use to interact with Ethereum. Account interaction interface.

The smart contract account is not controlled by any private key, but by its code. For example, all DeFi protocols are controlled by smart contract accounts.

The problem with Ethereum is that externally owned accounts (EOAs) gain privileges that smart contract accounts do not. The most notable example is the ability to initiate transactions. Currently, only Externally Owned Accounts (EOAs) can do this.

This is a problem because the EOA functionality is hardcoded into the Ethereum protocol and there is no room for customization.

Example: Gmail gives you the option to enable 2FA on your account. Similar customizability is not possible on Ethereum today.

  • EOA on Ethereum has the following limitations:

  • Users cannot use custom signature schemes. ECDSA is a typical signature scheme used by Ethereum to generate public-private key pairs.

  • Gas fees must be paid in native cryptocurrency ($ETH).

Because your private key is your account, losing your key means losing your account.

All these problems can be easily solved by smart contract wallets as they allow the use of custom logic.

But as mentioned earlier, transactions on Ethereum can only be initiated through ECDSA-protected Externally Owned Accounts (EOAs), not smart contract wallets.

Now you might be asking - why don't we change that?EIP-2938All right,

is a way to solve this problem. It introduces an Ethereum protocol change that allows transactions to be initiated from smart contracts instead of EOAs.

But the problem is that it requires major changes to the protocol.

Therefore, researchers at netermind and opengsn, with the help of Vitalik Buterin, proposed EIP-4337.

How will account abstraction EIP-4337 improve Ethereum UX?

The proposal proposes a workaround that would bring "account abstraction" to Ethereum without requiring any changes to the consensus layer protocol.

It does not modify the logic of the consensus layer itself, but replicates the functionality of the current tx storage pool to a higher level system.

  • A process has many moving parts, including:

  • User operations

  • Bundler

Paymaster (optional)

Next, let us understand these concepts one by one.

This proposal introduces the concept of "user actions" that allow us to encode custom functionality into our smart contract wallets.

User actions package user intent, signatures, and other data for verification.

Related images:

How will account abstraction EIP-4337 improve Ethereum UX?

The following is the general process of initiating a transaction through a smart contract wallet:

1. Alice (user) initiates a "user operation" and includes the tx it wants to execute;

How will account abstraction EIP-4337 improve Ethereum UX?

2. She sends the operation to a high-level "user operation storage pool".

3. The operation is partially verified and broadcast to the P2P storage pool node network.

4 — Actions are chosen to be performed by a "Bundler", anyone can be a Bundler, such as MEV Seekers, Validators, you or me, etc.

5 — Then Bundler bundles all operations into one big tx.

6 — Bundler includes the block in the Ethereum block along with other tx.

Now let's try to break down the functionality of Bundler to see how tx is executed and verified.

1 — Bundler routes tx to a global "entrypoint" smart contract.

2 — The global contract operates through each user and calls the "validation function" in the smart contract wallet.

3 — The wallet runs this function to verify the signature of user actions and compensate the bundler for bundling these transactions.

4 — The wallet runs an execute operation to execute the transaction specified in the operation.

5 — Then return the remaining gas to the wallet after performing the operation.

The EIP also proposes the concept of "paymaster".

Instead of relying on their wallets, users can now have payers sponsor their transaction fees.

How will account abstraction EIP-4337 improve Ethereum UX?

  • There are many use cases for the sponsorship transaction feature, the most commonly cited use cases are:

  • Allow app developers to pay fees on behalf of their users;

Allow users to pay fees in ERC20 tokens, and the contract acts as an intermediary for receiving ERC20;

3. What does account abstraction mean to us?

All of this is very exciting, but why should we care? Well, there are multiple reasons.

Proposal to allow us to use custom signature schemes. Users can now turn every phone into a hardware wallet using built-in solutions for iOS and Android devices.

It allows native support for multiple signers on Ethereum. Two or more users can now approve a single transaction, increasing security.

Social recovery can be enabled. If a user somehow loses his key, he can recover the account for him by simply asking his friends and family.

Well, that's all for the proposal.


DeFi之道
作者文库