EOA Rainbow Bridge
Seamlessly bridge between traditional EOA wallets and smart contract accounts.
Overview
The EOA Rainbow Bridge enables users to:
- Use existing EOA wallets
- Upgrade to smart accounts
- Maintain backward compatibility
- Seamless transition
How It Works
EOA Wallet → Rainbow Bridge → Smart Account
↓ ↓ ↓
Private Key Ownership Advanced FeaturesImplementation
typescript
import { createSmartAccount } from '@aastar/account';
import { privateKeyToAccount } from 'viem/accounts';
// 1. Start with EOA
const eoaAccount = privateKeyToAccount(process.env.PRIVATE_KEY);
// 2. Create smart account owned by EOA
const smartAccount = await createSmartAccount({
owner: eoaAccount.address,
salt: 0n,
factoryAddress: CONTRACTS.sepolia.simpleAccountFactory,
});
// 3. Use smart account for advanced features
const user = createEndUserClient({
chain: sepolia,
transport: http(),
account: smartAccount,
});
// Now user has:
// - Gasless transactions
// - Social recovery
// - Session keys
// - Batch operationsBenefits
- No Learning Curve: Users keep their familiar wallets
- Gradual Adoption: Upgrade when needed
- Best of Both Worlds: EOA simplicity + smart account features
- Backward Compatible: Works with existing DApps
Use Cases
- Onboarding new users
- Migrating existing users
- Multi-wallet support
- Progressive enhancement
