A SwiftUI app demonstrating gasless smart account transactions using ZeroDev Omni SDK for ERC-4337 account abstraction and Privy for authentication + embedded wallet signing.
Works on both macOS and iOS.
- Login — User authenticates via email OTP (Privy)
- Embedded wallet — Privy creates a secure embedded Ethereum wallet
- Smart account — ZeroDev creates a Kernel v3.3 smart account with the Privy wallet as owner
- Gas sponsorship — ZeroDev's paymaster sponsors all gas fees (user pays nothing)
- Send transaction — Gasless UserOp from the smart account, confirmed on Sepolia
┌──────────────┐ ┌─────────────────────┐ ┌───────────────────┐
│ Privy SDK │────>│ PrivySigner │────>│ ZeroDev Omni SDK │
│ (auth + │ │ (AsyncSignerProto │ │ (Kernel v3.3 + │
│ embedded │ │ bridges EIP-1193 │ │ paymaster + │
│ wallet) │ │ to ZeroDev) │ │ URLSession) │
└──────────────┘ └─────────────────────┘ └───────────────────┘
Key integration points:
AsyncSignerProtocol— Privy's async wallet provider maps directly to ZeroDev's async signer interface. No semaphores, no deadlocks.useURLSessionTransport()— Routes all SDK HTTP through Apple's URLSession instead of Zig's TLS client. Required on iOS, optional on macOS.
-
Copy the env file and fill in your credentials:
cp .env.example .env
ZERODEV_PROJECT_ID=... # from dashboard.zerodev.app PRIVY_APP_ID=... # from dashboard.privy.io PRIVY_CLIENT_ID=... # from dashboard.privy.io (starts with "client-") -
Run:
make run # macOS make run-ios # iOS Simulator (boots iPhone 17 Pro by default)
Use a different simulator with:
make run-ios SIMULATOR="iPhone 17e"
That's it. No Zig, no local SDK builds — the ZeroDev Omni SDK is pulled as a pre-built xcframework via SPM.
Sources/
├── GasSponsorshipApp.swift # @main entry, Privy SDK init
├── Config.swift # Reads credentials from environment / .env
├── PrivySigner.swift # AsyncSignerProtocol: Privy wallet → ZeroDev signer
├── WalletManager.swift # Auth → wallet → smart account state machine
├── RootView.swift # Navigation router based on auth state
├── LoginView.swift # Email input screen
├── OTPView.swift # OTP verification screen
└── DashboardView.swift # Wallet dashboard + send transaction
Both pulled automatically via Swift Package Manager:
zerodev-omni-sdkv0.0.1-alpha.2— ERC-4337 smart account SDK (pre-built xcframework)privy-iosv2.10.0— Auth + embedded wallets