Overview
This guide demonstrates how to combine Magic’s Wallet API with Particle Network’s Universal Accounts to give users a secure, passwordless, and chain-abstracted Web3 experience. With Magic Wallet API, developers can generate wallets through familiar OAuth logins (such as Google) — no seed phrases, no browser extensions, and no wallet pop-ups.When paired with Universal Accounts, those wallets automatically gain a unified balance and cross-chain capabilities, allowing users to interact with assets across multiple chains through a single unified account.
You can explore the full code in the repository below.
Demo App Repository
Why Use Magic + Universal Accounts
Web3 apps traditionally face two main challenges:- User onboarding — requiring wallet installations, seed phrases, and multiple pop-ups.
- Multi-chain complexity — needing separate integrations, RPCs, and bridging for each supported chain.
- Magic Wallet API allows developers to create secure, non-custodial wallets via simple user logins.
- Universal Accounts extend those wallets into chain-abstracted smart accounts — a single address and balance shared across chains.
How This Demo Works
User Logs In
A secure wallet is automatically generated inside Magic’s trusted environment — no seed phrase or wallet setup required.
Universal Account Initialization
Cross-Chain Interaction
What You’ll Learn
By following this guide and exploring the demo app, you’ll learn how to combine Magic Wallet API and Universal Accounts to deliver a modern, chain-abstracted user experience.Generate a Secure Wallet via Magic’s Wallet API
Link the Wallet to a Universal Account
Experience Chain Abstraction in Action
Run the Demo Locally
You’ll see how the login, wallet creation, and cross-chain minting flow work together in a real environment.
For detailed implementation steps, refer to the demo repository and SDK documentation.
How It Works
The demo combines Magic’s Wallet API for secure wallet creation with Particle Network’s Universal Accounts for chain abstraction and cross-chain operations.Here’s how the flow works end-to-end.
1. User Logs In with OAuth
NextAuth and sends it to the backend.The backend calls the Magic Wallet API to either create or fetch an existing EOA wallet derived from that ID token.
- The private key is generated and stored inside Magic’s TEE — it never leaves Magic’s secure infrastructure.
- All API calls to Magic happen through server-side routes (
/api/tee/*) to protect API keys. - The resulting public address is returned to the client as the user’s Magic Wallet.
contexts/AuthProvider.tsx– handles login and wallet retrievalapp/api/tee/wallet/route.ts– forwards OAuth token to Magic API securelylib/express.ts– sets Magic API credentials and executes TEE requests
2. Universal Account Initialization
- A single address for all supported chains
- Unified balance tracking
- Automatic cross-chain routing and gas abstraction
3. Interact Across Chains
- The app generates a Universal Transaction, describing the intended action.
- Deposit any of the supported Primary Assets into the Universal Account.
- The Magic EOA signs the transaction’s root hash via
personal_sign. - The Universal Account infrastructure bridges and executes automatically across chains.
app/wallet/page.tsx– handles Universal Account initialization and transaction creation
Benefits for Developers
By integrating Magic Wallet API with Universal Accounts, developers can dramatically simplify user onboarding and multi-chain operations while maintaining full decentralization and security.Simplified User Onboarding
No wallet pop-ups, seed phrases, or browser extensions are required — a secure wallet is created automatically via Magic’s TEE-based API.
Unified Multi-Chain Experience
Developers don’t need to manage custom RPC configurations, network switching, or per-chain contract deployments — the Universal Account abstracts this away.
Gas Abstraction
For instance, a user holding USDC or SOL on Solana can cover gas fees for transactions on Ethereum or Avalanche automatically.
Cross-Chain Liquidity
No bridges, swaps, or network switches required — liquidity moves behind the scenes.
Running the App
You can explore this integration in action by running the provided app locally.This section gives a quick setup overview — full instructions are available in the repository’s README.
Clone the Repository
Set Up Environment Variables
.env.local file and add your Magic and Particle configuration keys:and your Particle credentials from the Particle Dashboard.
Run the App
Try It Out
and mint an NFT on Avalanche — even if your funds are on Solana or Ethereum.
App Repository
Key Takeaways
Combining Magic Wallet API with Universal Accounts gives developers a complete foundation for user-friendly, cross-chain dApps.Frictionless Wallet Creation
Users simply log in with OAuth — no extensions, seed phrases, or manual setup.
Full Chain Abstraction
Users interact with one account and one balance that works across all supported networks.
Web2-Level UX for Web3 Apps
enabling passwordless access, unified balances, and effortless cross-chain transactions.
