Migrate Your Ethereum Dapp to StarkNet
Step-by-step guide to migrate an Ethereum/EVM dapp to StarkNet using Chipi. Maps ethers.js, viem, wagmi, RainbowKit, ConnectKit, and MetaMask to Chipi equivalents.
Overview
Migrate your EVM (Ethereum) dapp to StarkNet using Chipi. This guide maps ethers.js, viem, wagmi, RainbowKit, ConnectKit, Web3Modal, and MetaMask patterns to Chipi equivalents. Chipi handles wallets, gas fees, and key management. You don't need to understand StarkNet internals.
Key Mental Shifts from EVM
Moving from Ethereum to StarkNet with Chipi involves several conceptual changes:
- No EOAs. StarkNet uses account abstraction natively. Every account is a smart contract. No private key signing in the browser, no MetaMask popups. Chipi wallets use passkeys.
- No Chain Switching. No
wallet_switchEthereumChain, no chain IDs, no multi-chain config. Remove all chain/network switching logic. - Gasless Native. Users never pay gas. Remove all gas estimation, maxFeePerGas, gasLimit logic.
- Multicall Free. StarkNet natively supports multiple calls in one transaction. No need for Multicall3 contracts.
- No ABI Files. Chipi hooks abstract contract interactions. For custom contracts, use
useCallAnyContract. - u256 = Two Felts. Uint256 is split into
[low_128, high_128]. The SDK handles this for standard operations. - Address Format. EVM uses 0x + 40 hex chars. StarkNet uses 0x + 64 hex chars.
Remove the EVM Provider Stack
Remove your current wallet connection layer entirely:
RainbowKit: Remove RainbowKitProvider, ConnectButton, getDefaultWallets, and uninstall @rainbow-me/rainbowkit.
ConnectKit: Remove ConnectKitProvider, ConnectKitButton, and uninstall connectkit.
Web3Modal: Remove createWeb3Modal, Web3Modal, WalletConnect project ID, and uninstall @web3modal/wagmi.
wagmi: Remove WagmiConfig, createConfig, chain definitions, transport configs, connector setup.
Replace everything with ChipiProvider wrapping your app root.
Replace Wallet and Token Hooks
Map EVM hooks to Chipi equivalents:
tsx// BEFORE (wagmi):
const { address, isConnected } = useAccount();
const { data: balance } = useBalance({ address, token: usdcAddress });
const { write } = useContractWrite(config);
// AFTER (Chipi):
import { useChipiWallet, useTransfer, useGetTokenBalance } from "@chipi-stack/nextjs";
const { wallet, hasWallet } = useChipiWallet();
const { data: balance } = useGetTokenBalance({
walletAddress: wallet?.publicKey, tokenAddress: "USDC",
});
const { mutateAsync: transfer } = useTransfer();No extension. No connection modal. No chain switching. Just passkeys.
Replace Authentication
If you use Sign-In with Ethereum (SIWE), remove it entirely:
- - Remove
siwe,@spruceid/siwe-parser, SIWE adapters - - Remove
wallet.signMessagefor auth, nonce generation, and signature verification
Replace with standard auth (Clerk, Firebase, or Supabase). The wallet is created after auth, not used for auth. Users sign in with email, Google, or passkeys. Then Chipi creates a wallet linked to their session.
Bridge Assets
Move assets from Ethereum to StarkNet:
- - StarkGate (official L1→L2): starkgate.starknet.io. Supports ETH, USDC, USDT, DAI, WBTC. Takes about 12 minutes for L1 finality.
- - LayerSwap (cross-chain): layerswap.io. Supports many chains to StarkNet. Takes 2-10 minutes.
Migration Checklist
Verify your migration is complete:
- - All ethers/viem/wagmi imports removed
- - No window.ethereum or provider references remaining
- - No chain switching logic remaining
- - No gas estimation code remaining
- - No ABI imports remaining (unless using useCallAnyContract)
- - Wallet creation works with passkey
- - Token transfers work gaslessly
- - No 40-char addresses in StarkNet calls (must be 64)