Overview

Relevant source files

This document provides a comprehensive overview of the 7702-examples repository, which serves as a demonstration platform for EIP-7702 account abstraction capabilities. The repository showcases how externally owned accounts (EOAs) can be upgraded to smart accounts using multiple authentication providers and the ZeroDev SDK.

For detailed implementation of specific authentication providers, see Authentication Providers. For architecture deep-dives, see Architecture Overview. For interactive example implementations, see Examples and Demonstrations.

Purpose and Scope

The 7702-examples repository demonstrates practical implementation of EIP-7702 account abstraction through a Next.js application that supports four different authentication providers: Privy, Dynamic Labs, Turnkey, and local development setup. The application provides interactive examples of smart account capabilities including gas sponsorship, transaction batching, permission management, and chain abstraction.

The codebase serves both as a working demonstration and as a reference implementation for developers looking to integrate EIP-7702 account abstraction into their applications using embedded wallets.

System Architecture

Core Application Structure

ZeroDev Integration

Provider Implementations

Next.js Application
src/app

[[...provider]]/page.tsx
Dynamic Route Handler

AccountProviderWrapperContext
src/context/wrapper.tsx

PrivyAccountProvider
src/context/account-providers/privy-account-provider.tsx

DynamicAccountProvider
src/context/account-providers/dynamic-account-provider.tsx

TurnkeyAccountProvider
src/context/account-providers/turnkey-account-provider.tsx

LocalAccountProvider
src/context/account-providers/local-account-provider.tsx

@zerodev/ecdsa-validator

@zerodev/sdk

@zerodev/permissions

@zerodev/intent

Provider Selection and Context Flow

Account Provider Context

Provider Context Creation

URL: /[provider]
[[...provider]] route

AccountProviderWrapper
initialProvider prop

accountProvider state
AccountProviders type

PrivyProviderWrapper
WagmiProvider + PrivyProvider

DynamProviderWrapper
DynamicContextProvider + WagmiProvider

TurnkeyProviderWrapper
WagmiProvider + TurnkeyProvider

LocalProviderWrapper
WagmiProvider only

useAccountProviderContext
kernelAccountClient, embeddedWallet, isDeployed

Core Functionality

The application provides four main categories of smart account demonstrations:

Feature Implementation ZeroDev Package
Gas Sponsorship Paymaster-sponsored transactions @zerodev/sdk
Transaction Batching Multiple operations in single user operation @zerodev/sdk
Permission Management Session keys with call policies @zerodev/permissions
Chain Abstraction Cross-chain operations via intents @zerodev/intent

Authentication Provider Integration

The system supports four authentication methods through a unified interface:

Account Provider Interface

Wagmi Configuration

External SDKs

@privy-io/react-auth
embeddedWallets config

@dynamic-labs/sdk-react-core
ZeroDevSmartWalletConnectors

@turnkey/sdk-react
WebAuthn support

Private Key
Development only

wagmiConfig
sepolia + baseSepolia

HTTP transports
RPC endpoints

AccountProviderContext
login, embeddedWallet, kernelAccountClient

Key Technologies and Dependencies

Core Dependencies

The application relies on several key technology stacks:

Authentication Providers:

  • @privy-io/react-auth - Embedded wallet authentication with social logins
  • @dynamic-labs/sdk-react-core - Multi-wallet connector with smart wallet support
  • @turnkey/sdk-react - Hardware-security-module-backed key management
  • Local private key setup for development

Account Abstraction:

  • @zerodev/sdk - Core smart account functionality
  • @zerodev/ecdsa-validator - ECDSA signature validation
  • @zerodev/permissions - Session key and policy management
  • @zerodev/intent - Cross-chain intent execution

Blockchain Infrastructure:

  • wagmi - Ethereum React hooks and utilities
  • viem - TypeScript Ethereum library
  • Sepolia and Base Sepolia testnets for demonstrations

Application Framework

Built on Next.js 15 with React 19, the application uses:

  • Dynamic routing with [[...provider]] catch-all routes
  • React Context for state management across provider implementations
  • @tanstack/react-query for blockchain data fetching and caching
  • Radix UI components for consistent user interface elements

Repository Structure

The codebase follows a modular architecture with clear separation of concerns:

  • Dynamic routing: src/app/[[...provider]]/ handles provider-specific routes
  • Context providers: src/context/account-providers/ contains individual provider implementations
  • UI components: Reusable components for code display, examples, and setup instructions
  • Configuration: Environment-based configuration for different networks and services

The main entry point demonstrates EIP-7702 capabilities through interactive examples, with each provider maintaining consistent interfaces while handling authentication and wallet management differently.