Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for ERC-4337 (account abstraction) transactions #185

Open
LYC386 opened this issue Mar 20, 2023 · 0 comments
Open

Add support for ERC-4337 (account abstraction) transactions #185

LYC386 opened this issue Mar 20, 2023 · 0 comments

Comments

@LYC386
Copy link
Contributor

LYC386 commented Mar 20, 2023

Overview of erc4337
Erc4337 allows account abstraction without changing consensus protocol on ethereum. Since smart contract can’t initiate a transaction, erc4337 introduces Bundlers to collect UserOperations and wrap them as normal ethereum transactions. The transactions sent by a Bundler will be executed by a EntryPoint smart contract and bill the sender’s smart contract wallet. Docs can be found here.

Ways for support erc4337 on Meson

  1. Use third-party bundler node provider that provides erc4337 function:

    • Doesn’t need to update meson provider's workflow, only updates supported command in plugin.

    • Adds support for erc4337 transaction in meson-plugin

      • In command/ethereum.go, add new command for (eth_sendUserOperation, eth_estimateUserOperationGas)
      • In ethereum_chain.go add new ethRequest method for eth_sendUserOperation and eth_estimateUserOperationGas
        (The detail of erc4337 RPC methods can be found here)
    • The node provider used in Meson needs to support erc4337 (e.g. Stackup/Alchemy)

  2. Implement bundler on meson mixnet provider:

    • Updates meson-plugin to accept erc4337 tx

    • Requires access to a full-node with debug API enabled for tracing (for simulating transactions to validate userOp)

    • Basic workflow for meson provider bundler:

      1. Receives UserOperation
      2. Validates UserOperation
        (Full validation process can be found here)
      3. Add UserOperation to a private Mempool
      4. Collect a batch of UserOperation and create a eth transaction to call entrypoint.handleOps(ops: [UserOperations], beneficiary: provider’s address)
        (Sender of the transaction will be meson provider’s account, and thus we need to maintain a funded account on chain.)
      5. Broadcast the transaction

Resources
https://eips.ethereum.org/EIPS/eip-4337
https://docs.stackup.sh/docs/introduction/account-abstraction
https://www.alchemy.com/blog/account-abstraction
Stackup’s Bundler implementation
Infinitism's 4337 Implementation (core EIP-4337 team)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant