Overview
This guide demonstrates how to combine Magic’s API Wallet with Particle Network’s Universal Accounts to provide users with a secure, passwordless, and chain-agnostic Web3 experience. With Magic’s API Wallet, developers can generate wallets through any JWT-based auth provider, including familiar OAuth logins (such as Google) — no seed phrases or extensions required. When paired with Universal Accounts, those wallets automatically gain a unified balance across multiple EVM chains and Solana, enabling users to interact across chains through a unified balance and account, without the need to hold a specific gas token.This guide is based on a demo app where users log in using Google OAuth (via Magic’s API Wallet) and instantly interact with Universal Accounts to mint NFTs across chains — without bridges or network switching.Explore the full code in the repository below.
Demo App Repository
Explore the Magic Wallet + Universal Accounts Demo on GitHub.
Why Use Magic + Universal Accounts
Web3 onboarding and multi-chain interoperability are often complex:- Wallet installations, seed phrases, and pop-ups hurt conversion.
 - Multi-chain logic, RPCs, and bridges complicate development.
 
- Magic’s API Wallet generates secure, non-custodial wallets using JWT-based authentication, including simple OAuth logins like Google.
 - Universal Accounts extend these wallets with a chain-abstracted smart account, giving users one address and one balance across chains.
 
How It Works
The integration connects Magic’s API Wallet (for secure wallet creation) with Particle Network’s Universal Accounts (for chain abstraction).Here’s how the flow works from login to cross-chain interaction:
1
User Logs In with OAuth
When the user signs in with Google, the app retrieves their ID token through Key files:
NextAuth and sends it to the backend.The backend calls Magic’s Express API to either create or fetch an existing EOA wallet derived from that token.The private key is generated and stored inside Magic’s TEE — it never leaves Magic’s secure infrastructure.JavaScript
contexts/AuthProvider.tsx– handles login and wallet retrievalapp/api/tee/wallet/route.ts– server-side Magic API callslib/express.ts– configures Magic API credentials
2
Initialize the Universal Account
Once the Magic wallet is available, initialize the Universal Account SDK using the Magic EOA as the owner.The Universal Account provides:
/app/wallet/page.tsx
- A single address shared across chains
 - Unified balance tracking
 - Automatic routing and gas abstraction
 
3
Interact Across Chains
Users can now interact on any supported chain — e.g., mint an NFT on Avalanche using funds from Solana.The Magic wallet signs the transaction, and Universal Accounts handle routing, execution, and cross-chain liquidity under the hood.
/app/wallet/page.tsx
The Universal Account SDK abstracts cross-chain routing, gas payments, and liquidity handling automatically — users interact with a single balance, regardless of the underlying network.
Developer Benefits & Key Learnings
By integrating Magic’s API Wallet with Universal Accounts, developers can provide a modern onboarding experience and eliminate multi-chain friction.1
Frictionless Onboarding
Users log in with familiar OAuth methods (e.g., Google).
A secure wallet is generated via Magic’s TEE — no seed phrases or manual setup required.
A secure wallet is generated via Magic’s TEE — no seed phrases or manual setup required.
2
Unified Multi-Chain Account
The Magic wallet owns a Universal Account that spans all supported chains, consolidating balances and activity into one address.
3
Gas and Liquidity Abstraction
Users can transact or pay gas with any supported token — even across ecosystems (e.g., use SOL or USDC on Ethereum or Avalanche).
4
Web2-Level UX with Web3 Interoperability
Together, Magic and Particle Network provide passwordless access and cross-chain usability that feels as seamless as a Web2 app.
Running the App
You can explore the full integration locally with the provided demo repository.1
Clone the Repository
2
Set Up Environment Variables
Create a Get your Magic Secret Key from the Magic Dashboard and your Particle credentials from the Particle Dashboard.Follow the instructions here to configure your identity provider.
.env.local file and add your Magic and Particle credentials:3
Run the App
NPM
4
Try It Out
Log in with Google to generate a wallet, check your unified balance,
and mint an NFT on Avalanche — even if your funds are on Solana or Ethereum.
and mint an NFT on Avalanche — even if your funds are on Solana or Ethereum.
App Repository
See full setup details and source code on GitHub.
Conclusion
With Magic’s API Wallet with Particle Network’s Universal Accounts, developers can onboard users with familiar OAuth flows while giving them access to a single account that works across all major blockchains — unified balance, cross-chain liquidity, and gas abstraction included.It’s a foundation for truly chain-agnostic applications that feel natural to both users and developers.
Resources
Demo Repository
Explore the Magic Wallet + Universal Accounts Demo on GitHub.
API Wallet Docs
Learn how to create and manage wallets securely with Magic’s TEE-based API.
Universal Accounts Overview
Understand how chain abstraction works across EVM and non-EVM chains.
Supported Chains
See all networks compatible with Universal Accounts.