A simple payment application with server-side smart account wallets, USDC transfers, and gasless transactions on Arbitrum Sepolia. Earn interest on idle USDC balances with Aave integration.
git clone <your-repo-url> cd onchain-payments npm installCopy .env.example to .env:
cp .env.example .envThen fill in the required values:
- Get from: https://app.supabase.com/project/_/settings/api
NEXT_PUBLIC_SUPABASE_URL- Your Supabase project URLNEXT_PUBLIC_SUPABASE_ANON_KEY- Your Supabase anonymous key
- Can be any PostgreSQL database, including Supabase
- For Supabase: https://app.supabase.com/project/_/settings/database
DATABASE_URL- Full PostgreSQL connection string
- Get from: https://dashboard.alchemy.com/
- Create an app and a gas policy
ALCHEMY_API_KEY- Your Alchemy API keyALCHEMY_POLICY_ID- Your Alchemy gas sponsorship policy ID⚠️ These are server-side only and never exposed to the client
- Generate a new private key:
node -e "console.log('0x' + require('crypto').randomBytes(32).toString('hex'))" MASTER_WALLET_PRIVATE_KEY- The generated private key
- Hardware Security Modules (HSM)
- Multi-Party Computation (MPC) services (e.g., Fireblocks, BitGo)
- Secure key management systems (e.g., AWS KMS, HashiCorp Vault)
- Multi-signature setups
Different institutions have different security practices for private key management. Choose the approach that fits your security requirements.
Push the database schema to your PostgreSQL database:
npm run db:pushThis uses Drizzle Kit to read your schema from src/db/schema.ts and create the tables directly. For future schema changes, you can use Drizzle migrations to track changes over time.
npm run devVisit http://localhost:3000
Deploy to Vercel with one command:
npm run deployOr deploy to production:
npm run deploy:prodAfter deploying, make sure to set up your environment variables in the Vercel dashboard:
- Go to your project settings → Environment Variables
- Add all variables from
.env.example - Redeploy to apply changes
- Sign Up - Users create an account with email/password
- Smart Account - A smart account wallet is automatically created for each user
- Get USDC - Users get testnet USDC from Circle's faucet
- Send Payments - Send gasless USDC payments to other users
- Earn Interest - Toggle on Aave to automatically earn interest on idle USDC balances
- View Transactions - See all transactions on Arbitrum Sepolia
- Next.js 14 - App Router
- Supabase - Authentication and PostgreSQL database
- Alchemy - Smart account wallet infrastructure
- Aave - For earning interest on the USDC
- Arbitrum Sepolia - Testnet blockchain
- USDC - Real testnet USDC token
- Tailwind CSS + shadcn/ui - Styling and components
- ✅ No wallet installation required for users
- ✅ One-click gasless payments
- ✅ Server-side transaction signing
- ✅ Real USDC on Arbitrum Sepolia testnet
- ✅ Earn interest with Aave - simple toggle to start earning
- ✅ Transaction history and receipts