Back

EIP7702: what it is, why it matters, and how Privy helps you upgrade!

Ankush Swarnakar

|

Dec 11, 2024

Image

EIP7702 is a planned upgrade to Ethereum protocol that is expected to go live on mainnet as part of the Pectra hardfork in early 2025. EIP7702 introduces a new transaction type that enables externally-owned accounts (EOAs) to act as a smart contract for the duration of a transaction.

In this post, we’ll dive into how EIP7702 works, why it matters, and the ways Privy can help you leverage it to build better products.

Head to demo.privy.io to try out an onchain subscription service we built with 7702: it is secure, programmable and efficient. No need to lock up funds to power subscriptions onchain, it simply works out of the box with your existing EOA.

The fragmentation of Ethereum’s accounts

Over the past few years, Ethereum accounts have been fragmented between two types: externally-owned accounts (EOAs) and smart wallets:

  • EOAs are simple public-private keypairs that allow users to initiate transactions and control assets. These comprise the vast majority of accounts today, but lack any programmability and the flexibility that comes from having accounts exist independently of the keys that control them (like easier recovery, built in gas sponsorship, etc).

  • Smart wallets are themselves smart contracts deployed onchain, meaning they are inherently programmable and can offer advanced features around permissions, security, gas payments, and more. The nature of these accounts inherently being smart contracts, however, presents significant overhead to getting set up.

By allowing EOAs to leverage smart contracts for validation, EIP7702 gives EOAs smart wallet capabilities.

For users, this means smoother onchain experiences regardless of the underlying account type (EOA vs. smart wallet) they use. For apps, it unifies the experience of integrating with EOAs and smart wallets, meaning less branching logic and mental overhead in favor of focusing on their core product.

What EIP7702 unlocks

EIP7702 will supercharge the user experience of accounts in the Ethereum ecosystem in a few ways, namely:

  • Advanced capabilities for EOAs. For the first time ever, EOAs can tap into smart wallet features like gasless transactions, sessions to allow apps to take certain actions on a user’s behalf, programmable controls, and more. Across the board, this programmability is a major security and UX upgrade for EOAs.

  • Flexibility around using smart wallets. Before EIP7702, choosing to build on smart wallets was an irreversible decision; changing wallet implementations after the fact would change the underlying wallet address for users, which is a non-starter for most apps. With EIP7702, apps can start with EOAs and easily “upgrade” users into smart wallets, even modifying the underlying smart wallet implementation you use, all while preserving the same wallet address.

  • Simple account portability. EIP7702 gives you many of the benefits of smart wallet programmability with the portability of a private key, independent of any hosted service.

Using EIP7702 to power subscriptions

To demonstrate the power of EIP7702, we built a demo showcasing how to use EIP7702 to power onchain subscriptions. Using EIP7702, a user can subscribe to an action once, and a merchant can pull subscription fees from their account at intervals in the future without needing the user to be online. We built this demo on the Odyssey Testnet working with the Ithaca team’s new Porto library. We’re excited to keep working with them to push what can be built onchain as we grow our space!

Check out a walkthrough of the demo here or try it for yourself by logging into the Privy demo and clicking “subscribe” on the right.

In this demo, you can login with your preferred authentication method, create an embedded wallet, and use the wallet as you normally would. From there, EIP7702 enables you to create a “subscription” by registering an app session (in this case a passkey) as an authorized signer on the wallet, granting it certain permissions such as withdrawing a given amount from your wallet at known intervals.

In an ecommerce context, the merchant could use the app session to draw funds from your account and fulfill the subscription. This unlocks new experiences where apps can enrich a user’s experience with actions that don’t require explicit consent for each transaction, like executing limit orders at a given price, requesting signatures at high-frequency to power an onchain game, or even rebalancing a user’s wallet between different assets they may have.

The Privy team is excited to support EIP7702 the day it goes live on Ethereum Mainnet. From enabling subscriptions, to offchain actions, gas sponsorship, better wallet recovery and more… this is just the start.

If you’d like early access to any of these features or to learn more, please reach out!

Happy building! –Team Privy

Share this post


RELATED POSTS