← Back to home

MagicPay

A Magic Link that brings Crypto to fiat to non Crypto Users + Agent Mode

Problem Statement

MagicPay is an AI-powered crypto-to-fiat bridge that revolutionizes how people send money globally using PYUSD stablecoin. The project addresses the fundamental crypto adoption barrier - the recipient onboarding problem - where crypto holders want to send value but recipients lack the knowledge or tools to interact with crypto directly.🎯 Core Problem Solved: Traditional crypto transfers require both sender and recipient to understand wallets, blockchain networks, and transaction processes. MagicPay eliminates this friction by allowing senders to use crypto while recipients receive familiar bank deposits or email-based claim links.πŸ”„ How It Works: Sender connects their crypto wallet and sends PYUSD to any email address Smart contract escrow securely holds the funds with 30-day timeout protection Recipient receives an email with a claim link - no crypto knowledge required Fern API integration enables direct bank account deposits via hosted forms AI Agent mode allows natural language transactions like "Send $100 PYUSD to mom@email.com for groceries" πŸ€– Dual-Mode Experience: Traditional Mode: Classic web interface with forms and buttons for crypto-experienced users Agent Mode: AI-powered conversational interface using natural language for crypto operations 🌍 Global Impact: MagicPay makes crypto accessible to mainstream users by abstracting away blockchain complexity while maintaining security through smart contract escrow and regulatory compliance.

Solution

πŸ› οΈ How It's MadeπŸ—οΈ Architecture Overview: MagicPay is built as a full-stack application with smart contract infrastructure, combining traditional web technologies with cutting-edge AI frameworks and blockchain protocols.⛓️ Blockchain & Smart Contracts: Solidity smart contracts deployed on Ethereum Sepolia testnet using Hardhat PYUSD token integration with automatic network detection (Sepolia/Mainnet) Escrow contract system with timeout protection and refund mechanisms Web3.py for blockchain interactions and transaction management πŸ”™ Backend (Python/FastAPI): FastAPI framework for high-performance REST API with automatic OpenAPI documentation SQLAlchemy + SQLModel for type-safe database operations with PostgreSQL Pydantic models for request/response validation and serialization Async/await patterns for concurrent blockchain operations JWT authentication and role-based access control Mailgun integration for email notifications with claim links 🎨 Frontend (Next.js/React): Next.js 15 with Turbopack for fast development and optimized builds TailwindCSS for modern, responsive design with gradient effects and animations Dynamic wallet connection for seamless Web3 integration across multiple wallets TypeScript for type safety and better developer experience Modern UI/UX with glass-morphism effects, gradients, and smooth transitions πŸ€– AI Integration Stack: ASI Agents Framework: Autonomous agent infrastructure for crypto operations MCP (Model Context Protocol): AI-wallet communication protocol TheGraph Protocol: Real-time blockchain data indexing and analytics Nora AI: Conversational AI interface for natural language processing 🏦 Financial Infrastructure: Fern API: Off-ramp integration for bank deposits with hosted compliance forms Stripe-like UX for bank account collection and payout processing KYC/AML compliance through Fern's regulatory framework Multi-currency support planned (USDC, USDT, DAI) ⚑ Layer 2 & Scaling: Zircuit integration for Layer 2 scaling solution Polygon/Arbitrum support planned for reduced transaction costs Cross-chain compatibility architecture for future expansion πŸ”§ Notable Technical Implementations:Smart Contract Escrow Innovation: solidity // Custom escrow with timeout and role-based access contract MagicPayEscrow { mapping(bytes32 => Transfer) public transfers; uint256 public constant TIMEOUT_PERIOD = 30 days;function claimTransfer(bytes32 transferId) external { // Advanced claim logic with security checks } }AI-Powered Transaction Processing: Natural language parsing converts "Send $100 to mom" into structured blockchain transactions Intent recognition for complex crypto operations through conversational interface Context awareness using MCP for wallet state and transaction historyHybrid Backend Architecture: pythonDual-mode operation: Simulation vs Real blockchainclass BlockchainService: definit(self): if settings.ESCROW_CONTRACT_ADDRESS: self.mode = "real_contract" # Use deployed escrow else: self.mode = "simulation" # Operator simulation 4. Dynamic PYUSD Detection: python def get_pyusd_contract_address_by_chain_id(chain_id: int) -> str: if chain_id == 1: return PYUSD_MAINNET_ADDRESS # 0x6c3ea9036406852006290770BEdFcAbA0e23A0e8 elif chain_id == 11155111: return PYUSD_SEPOLIA_ADDRESS # 0x9D2423AD5fb0e435dcC8209f4Fee4Bb1AA97Cb2d πŸš€ Deployment & DevOps: Docker containerization for consistent environments GitHub Actions CI/CD for automated testing and deployment Environment-based configuration for dev/staging/production Comprehensive logging and error monitoring πŸ”’ Security & Compliance: Smart contract auditing patterns with OpenZeppelin libraries Input validation and SQL injection prevention Rate limiting and DDoS protection GDPR compliance with data encryption and user consent πŸ“± Multi-Platform Strategy: Telegram Mini Apps integration (Q4 2025) Mobile-responsive web design Cross-platform wallet support via Dynamic API-first architecture for future integrations The most notably "hacky" innovation is our AI Agent mode that translates natural language into precise blockchain transactions, making crypto as easy as sending a text message while maintaining full security through smart contract escrow.This architecture positions MagicPay as a next-generation fintech platform that bridges traditional finance and decentralized crypto through AI-enhanced user experiences.

Hackathon

ETHGlobal New York 2025

2025

Contributors