Derek Chiang's blog

What does EIP-7702 mean for YOU? Part 2 -- DApp Developers

This article was originally published on X.

In part one of this series, we explored how the adoption of EIP-7702 will play out.

In part two, I’d like to zoom in on how EIP-7702 will impact DApps, and what you can do as a DApp developer to take advantage of EIP-7702.

Quick overview of EIP-7702

First, a quick recap. EIP-7702 is one of the EIPs slated to go live with Ethereum’s next upgrade (Pectra), scheduled for April 2025.

With EIP-7702, an EOA can “upgrade” itself into a smart account, while simultaneously remaining an EOA and keeping the same address.

Once the account has been upgraded, the user can then experience most of the benefits of AA such as gas sponsorship, transaction batching, passkeys, etc.

Two types of DApps

For the purpose of this article, we will differentiate between two types of dapps, which I call “open dapps” and “closed dapps.”

EIP-7702 for Open DApps

Recently, MetaMask publicly committed to supporting EIP-7702, and it’s only reasonable to expect that other major wallets will soon follow. Therefore, developers of open dapps must adjust to a new reality: the wallet your user connects to your dapp MAY be a smart wallet, and increasingly more likely so.

This leads to two questions:

Detecting a smart wallet

Detecting a smart wallet is simple — ERC-5792 defines a standard RPC wallet_getCapabilities which returns a list of “capabilities” that the wallet supports. For example, a wallet might respond with the following:

{
  "0x0": {
    "permissions": {
      "supported": true
    }
  },
  "0x2105": {
    "paymasterService": {
      "supported": true
    },
  },
}

Here, the special value 0x0 indicates that the wallet supports the capability permissions (transaction delegation) on all networks, whereas it supports paymasterService (gas sponsorship) only on chain ID 0x2105 (Base).

Therefore, if your DApp intends to use smart wallet features, it should call wallet_getCapabilities after wallet connection (or use ERC-7846 to batch wallet connection with capabilities discovery), so it knows which capabilities the connected wallet supports.

Luckily, Viem and Wagmi already support wallet_getCapabilities, so you are just one function/hook away from using this RPC.

Using a smart wallet

Once you discover the capabilities of the smart wallet, you need to decide whether to use the capabilities.

Generally, you should decide whether a capability is required or optional for your dapp.

Whether you want to require a capability, or keep it optional, is ultimately a product decision. Is the capability essential to your app experience? Do you have the engineering bandwidth to build a fallback in case the capability is not supported? These are all questions that will determine how you handle capabilities (or the lack thereof).

How to use capabilities

Since smart accounts are smart contracts, they are infinitely flexible and can in theory support an infinite number of capabilities. In practice, capabilities follow a 80-20 rule where a few capabilities are able to satisfy most use cases. In our experience at ZeroDev, the most useful capabilities are:

For each of these capabilities, there is or will be a standard wallet interface for DApp developers to use.

Right now, the interface for transaction batching has been standardized with ERC-5792

For gas sponsorship, ERC-7677 has defined an interface for using ERC-4337 paymasters, though there are other possible approaches to sponsoring gas that don’t depend on ERC-4337.

For permissions, standardization is much harder because there are so many possible approaches, including session keys, session accounts (ERC-7710), and sub accounts (ERC-7895). One attempt at unifying these approaches is ERC-7715 but it’s an ongoing effort.

“Chain abstraction” is a rapidly developing area with even more competing approaches, but the good news is that it doesn’t require any complicated wallet interface, which makes standardization easier. Right now there are at least two ERCs (ERC-7682 and ERC-7811) that address chain abstraction, but they are still at an early stage of adoption.

Do I need to know 100 different ERCs to use EIP-7702?

If you have read this far, you may be thinking to yourself — I sure wish I don’t need to learn about 100 different ERCs just to use EIP-7702!

Well, good news and bad news. The bad news is that there will indeed be a bunch of different ERCs specifying different capabilities for smart wallets. The good news is that, with the right tooling, you won’t have to know about most of these ERCs — the library will just take care of it for you. And you guessed it — ZeroDev is one such library! We do the hard work of staying at the cutting edge of wallet standardization efforts so you don’t have to.

Now let’s move on to “closed dapps,” where the story is much simpler.

EIP-7702 for Closed DApps

A “closed dapp” is a dapp that works primarily or exclusively through an embedded wallet. Most AA applications today are closed dapps, because only embedded wallets support smart accounts, not standalone wallets. As mentioned above, that will change once existing standalone wallets become smart wallets by adopting EIP-7702.

The story of EIP-7702 for closed dapps is quite a bit simpler, because the dapp doesn’t need to deal with a myriad of wallets with different capabilities. Rather, the dapp is programmed against a single wallet — the embedded wallet — and has full control over the capabilities that the wallet offers.

Therefore, the only decision a closed dapp has to make is this: should the embedded wallet be using a regular smart account, or a EIP-7702 account (smart EOA)?

Smart EOAs vs regular smart accounts

A regular smart account — that is, a smart account that is only a smart contract and NOT a EOA — has a number of advantages over a smart EOA:

On the other hand, a smart EOA also has a number of advantages:

To sum up, regular smart accounts and smart EOAs (EIP-7702 accounts) both have their advantages. To choose between them, follow these general guidelines:

Conclusion

EIP-7702 holds incredible promise for DApp developers to build Web3 experiences that were not possible before. However, it comes with a unique set of challenges, notably capability fragmentation — many capabilities have not been sufficiently standardized, so DApps may have to write different code for different smart wallets.

However, with the right tools, it won’t be so hard to build on EIP-7702 as a DApp developer.

If you are ready to get your feet wet with EIP-7702, head to this tutorial now!

About me
Frame vs Tempo — Two clashing philosophies of native AA