Giggle
Instant crypto payments through WhatsApp chat. Crypto payments as easy as sending a message.
Problem Statement
Giggle: WhatsApp Crypto Payments Powered by PayPal USD (PYUSD)Giggle revolutionizes cryptocurrency payments by bringing PayPal USD (PYUSD) directly to WhatsApp, the world's most popular messaging platform with 2 billion users. Instead of complex wallet interfaces and technical jargon, users send PYUSD through natural conversations - making crypto payments as simple as texting.The Challenge We're AddressingThe cryptocurrency industry faces a massive adoption barrier: complexity. Traditional crypto wallets require users to understand gas fees, hexadecimal addresses, seed phrases, and blockchain mechanics. Meanwhile, 1.7 billion adults globally remain unbanked, and cross-border remittances cost 6-7% with multi-day settlement times.The opportunity: 2 billion people already use WhatsApp daily, but only a fraction can access digital payments. PayPal's PYUSD offers the perfect bridge - a regulated, dollar-backed stablecoin that combines crypto's efficiency with traditional finance's familiarity.Our Innovation: Making PYUSD Accessible to EveryonePhone Number as Universal Crypto Wallet Account:Every phone number automatically generates a unique Ethereum wallet through deterministic key derivation. Users never see private keys, seed phrases, or wallet addresses - their phone number becomes their PYUSD financial identity.Conversational PYUSD Payment Interface:Natural language processing transforms everyday speech into PYUSD blockchain transactions:"Send $50 to +91123456789" → Instant PYUSD transfer to this wallet"What's my balance?" → Real-time PYUSD account overview"Create a $25 gift coupon for my friend's birthday with message 'Happy Birthday!'" → PYUSD locked in smart contract, unique code generated"Redeem coupon GIFT1A2B3C4D" → PYUSD instantly released from smart contract to recipient's walletCore CapabilitiesInstant Global PYUSD PaymentsSend PYUSD to any phone number worldwideReal-time PYUSD balance checking and transaction historyRequest PYUSD payments from contactsComplete audit trail for compliancePYUSD-Backed Digital Gift EconomyCreate Gift Coupons:"Create a $25 gift coupon for my friend's birthday" → Smart contract locks PYUSD, generates unique codeRedeem Gift Coupons:"Redeem coupon GIFT1A2B3C4D" → Instant PYUSD transfer to recipient's walletPersonalized Gifts:Add custom messages and images stored on IPFSSecurity:One-time redemption, expiration dates, creator refund for unredeemed giftsSmart Contract Integration:Hardhat-deployed contracts ensure secure PYUSD redemptionEnterprise-Grade Security4-6 digit PIN system with PBKDF2 encryption (100,000 iterations)Configurable daily PYUSD spending limits ($100-$1000)Transaction confirmation workflowComplete audit logging for regulatory complianceAI-Powered User ExperienceOpenAI GPT-4o-mini for natural language understandingIntent detection for PYUSD payment commands: send, request, balance,gift creation,gift redemptionExtracts gift parameters from natural language (amount, message, expiration)Detects redemption codes in various formatsFallback parser ensuring reliability for core gift featuresConversational interface requiring no command memorizationTechnical ArchitectureBackend: Express.js with TypeScript for type safetyBlockchain: Ethereum Sepolia testnet with Ethers.js v6Stablecoin: PayPal USD (PYUSD) for real-world payment utilitySmart Contract Development: Hardhat V3Database: SQLite with Drizzle ORM for relational dataMessaging: Twilio WhatsApp Business APIAI: OpenAI GPT-4o-mini for natural language processingStorage: IPFS via Pinata for decentralized metadataMarket Impact & Use CasesCross-Border PYUSD RemittancesTarget: $800+ billion annual remittance marketBenefit: Eliminate 6-7% traditional fees with PYUSDAdvantage: Instant PYUSD settlement vs. multi-day processingPayPal Integration: Leverage PYUSD's regulatory compliance and dollar stabilityFinancial Inclusion with PYUSDReach: 1.7 billion unbanked adults globallyMethod: PYUSD banking services through familiar WhatsApp interfaceImpact: Democratize access to dollar-backed digital paymentsTrust: PayPal's brand recognition reduces crypto adoption frictionPeer-to-Peer PYUSD CommercePersonal: Family PYUSD transfers, bill splitting, allowance management,birthday/holiday gift couponsBusiness: Customer PYUSD payments, vendor settlements,employee gift card distributionSocial:PYUSD-backed digital gift cards for any occasion, event payments, group transactionsGift Use Cases:Wedding gifts, birthday presents, thank-you gifts, holiday bonuses - all via WhatsAppWhy PYUSD is the Perfect FitDollar Stability:PYUSD's 1:1 USD backing eliminates volatility concernsRegulatory Compliance:PayPal's oversight provides user confidenceReal-World Utility:PYUSD is designed for payments, not speculationBrand Trust:PayPal's reputation accelerates mainstream adoptionInteroperability:PYUSD works seamlessly across Ethereum ecosystemCompetitive AdvantagesZero Learning Curve: Familiar WhatsApp interface eliminates adoption frictionNo App Downloads: Works within existing user workflowPhone Number Banking: Simpler than traditional crypto or bankingPYUSD Integration: Dollar-backed stability with blockchain efficiencyGlobal Scale: Leverages WhatsApp's 2 billion user baseInnovation HighlightsDeterministic Wallet Generation: Phone numbers create consistent, recoverable PYUSD walletsConversational Payments: Natural language eliminates command memorizationWhatsApp Integration: First-of-its-kind PYUSD payment system in messagingGift Coupon Innovation:Complete gift economy with conversational creation ("create a $50 gift") and redemption ("redeem GIFT1A2B3C4D")Smart Contract Gift Cards:On-chain PYUSD escrow with privacy-protected codes, expiration dates, and IPFS metadata for personal messagesHardhat-Powered Smart Contracts:Professional development environment ensuring secure PYUSD gift operationsCurrent Implementation StatusProduction-Ready Features:Complete WhatsApp messaging integrationAutomated PYUSD wallet creation and managementPYUSD transaction processing on EthereumPIN-based security systemComplete Gift Coupon System:Conversational gift creation via WhatsAppSmart contract PYUSD escrow with Hardhat-deployed contractsUnique code generation and redemptionIPFS metadata for personalized messages/imagesExpiration dates and creator refundsTransaction history and balance checkingOpenAI natural language processing for gift commandsTestnet Environment: Currently operates on Ethereum Sepolia with PYUSD testnet tokens for safe development and testing, with production-ready architecture for mainnet deployment.Vision & ImpactGiggle represents a fundamental shift in cryptocurrency adoption strategy by making PayPal USD accessible to everyone. Rather than forcing users to learn blockchain technology, we meet them where they already are - in WhatsApp conversations. By making PYUSD invisible but its benefits visible, we can onboard the next billion users to digital payments.The result: PYUSD payments that feel like texting, but work like global banking infrastructure - combining PayPal's trusted brand with WhatsApp's ubiquity.Built with PayPal USD (PYUSD) and Hardhat Integration
Solution
Technical Architecture: Building WhatsApp Payments with PayPal USD (PYUSD) and HardhatGiggle employs a microservices architecture built on TypeScript Express.js, handling WhatsApp webhooks through Twilio's Business API, processing natural language via OpenAI GPT-4o-mini, and executing PYUSD transactions on Ethereum Sepolia through Ethers.js v6. Smart contracts are developed and deployed using Hardhat, ensuring professional-grade security and reliability.Core Technology IntegrationWhatsApp Business API (Twilio)Enterprise-grade messaging infrastructure with 99.9% uptimeBuilt-in WhatsApp Business Policy complianceWebhook signature verification for message authenticity24-hour customer service window managementNatural Language Processing (OpenAI)GPT-4o-mini for intent detection and PYUSD payment command parsingRecognizes multiple command types: send, request, balance,gift coupon creation,gift coupon redemptionZod-validated schemas for structured command parsingFallback regex parser ensuring reliability during API outagesConversational response generation with WhatsApp formattingBlockchain Infrastructure with PYUSDEthereum Sepolia testnet for safe developmentEthers.js v6 for wallet management and PYUSD transaction broadcastingPayPal USD (PYUSD) token integration for real-world payment utilityHardhat development environment for smart contract deployment and testingPYUSD ERC-20 contract interaction for balance checks and transfersSmart Contract Development with HardhatHardhat Framework:Professional-grade Ethereum development environmentTypeScript integration for type-safe contract developmentAutomated testing suite for contract validationDeployment scripts for multiple networks (testnet/mainnet)Ethers.js v6 plugin for seamless blockchain interactionGas optimization and contract verificationData PersistenceSQLite with Drizzle ORM for type-safe database operationsRelational schema tracking PYUSD transactions and balancesAutomated migration system for schema updatesComprehensive PYUSD transaction audit logging for complianceSmart Contract ImplementationGiggleGiftCoupon.sol - PYUSD Gift Cards (Hardhat-Deployed)The smart contract, developed and deployed using Hardhat, enables the PYUSD gift economy with:Gift Coupon Creation Features:Users create PYUSD-backed gift coupons with custom amounts via WhatsAppPrivacy-protected coupon codes using keccak256 hashing (prevents front-running)IPFS metadata integration for personal messages and imagesExpiration date support with automatic cleanupPYUSD funds locked in smart contract until redemption or refundUnique coupon code generation (e.g., "GIFT1A2B3C4D")Gift Coupon Redemption Features:Anyone with the coupon code can redeem PYUSD (except the creator)Instant PYUSD transfer to redeemer's wallet upon successful validationOne-time redemption per coupon (prevents double-spending)Creator refund capability for unredeemed PYUSD coupons after expirationComplete on-chain transaction history for transparencyTechnical Security:PYUSD token compatibility for stable, dollar-backed gift cardsNon-redeemable by creator (prevents self-redemption)Reentrancy protection for secure redemptionsHardhat test suite ensuring contract security and correctnessHardhat Development WorkflowContract development in Solidity with TypeScript typingComprehensive test coverage using Hardhat's testing frameworkLocal blockchain simulation for rapid developmentAutomated deployment scripts for consistent deploymentsContract verification on Etherscan for transparencyGas optimization analysis using Hardhat toolsSecurity ImplementationPIN Authentication SystemPBKDF2 with 100,000 iterations for securityRandom salt generation for each PINConstant-time comparison preventing timing attacksSecure storage with encrypted private keys protecting PYUSD accessDeterministic Wallet GenerationPhone number normalization to E.164 international formatDeterministic PYUSD wallet generation ensuring consistencyMaster key encryption for securityWallet recovery through phone number knowledgeSmart Contract Security (Hardhat-Enabled)Automated security testing with HardhatGas usage optimization and analysisReentrancy protection in gift coupon contractsAccess control validationEvent emission for transaction transparencyTechnical InnovationsPhone Number PYUSD Wallet SystemInnovation: Instead of requiring users to manage seed phrases, we generate deterministic PYUSD wallets from phone numbers using cryptographic key derivation.Benefits:Eliminates the biggest barrier to PYUSD adoptionUsers can recover PYUSD wallets by knowing their phone numberNo private key storage requiredConsistent PYUSD wallet generation across sessionsSeamless PayPal USD access without crypto complexityIn-Memory Transaction QueueInnovation: Using JavaScript Map with setTimeout expiration instead of Redis for pending PYUSD transactions.Benefits:Simpler development setupAutomatic cleanup with 5-minute expirationPrevents stale PYUSD transaction accumulationStateless API design enabling horizontal scalingMock IPFS Development ModeInnovation: When Pinata IPFS isn't configured, return mock URIs with base64-encoded metadata.Benefits:Enables development without IPFS infrastructureMaintains API compatibility for PYUSD gift metadataEasy production transitionPreserves metadata structureAI Fallback ParserInnovation: Regex patterns parse common PYUSD payment commands when OpenAI API is unavailable.Benefits:Ensures PYUSD functionality during API outagesHandles basic commands like "send $10 PYUSD to +1234567890"Recognizes gift coupon creation patterns:"create gift $25" or "make coupon $50"Detects redemption codes:"redeem GIFT1A2B3C4D" or "use coupon GIFT1A2B3C4D"Graceful degradation maintaining user experienceNo single point of failure for core gift featuresHardhat-Powered Smart Contract DevelopmentInnovation: Using Hardhat as the primary development framework for PYUSD gift coupon contracts.Benefits:Professional Development Environment:Industry-standard tooling for smart contractsAutomated Testing:Comprehensive test suite ensuring contract reliabilityNetwork Flexibility:Easy deployment across testnet and mainnetTypeScript Support:Type-safe contract interactionsGas Optimization:Built-in tools for cost-effective PYUSD operationsData Flow ArchitecturePYUSD Payment Processing PipelineWhatsApp Message → Twilio webhook → Express.js APIIntent Processing → OpenAI GPT-4o-mini → Structured PYUSD commandWallet Management → Deterministic generation → Ethereum wallet with PYUSDBalance Verification → Ethers.js contract call → PYUSD ERC-20 balance checkTransaction Creation → Pending PYUSD transaction → PIN confirmationBlockchain Execution → Ethers.js transaction → PYUSD transfer on Ethereum SepoliaConfirmation Delivery → WhatsApp notification → Both parties notified of PYUSD transferPYUSD Gift Coupon Creation & Redemption Workflow (Hardhat-Deployed Contracts)Gift Coupon Creation Process:User Command→ "Create a $25 gift coupon for my friend's birthday" → WhatsApp messageAI Intent Detection→ OpenAI GPT-4o-mini parses amount, message, expiration → Structured coupon parametersMetadata Upload→ Personal message & image → Pinata IPFS API → Decentralized storage URIPYUSD Lock→ User approves PYUSD spending → Funds transferred to smart contract escrowSmart Contract Creation→ GiggleGiftCoupon.sol (Hardhat-deployed) → On-chain PYUSD coupon mintedCode Generation→ Unique redemption code created (e.g., "GIFT1A2B3C4D") → Stored with keccak256 hashDatabase Persistence→ SQLite → PYUSD coupon tracking with creator, amount, expirationConfirmation→ WhatsApp notification → Creator receives coupon code to share with recipientGift Coupon Redemption Process:Redemption Command→ "Redeem coupon GIFT1A2B3C4D" → WhatsApp message from recipientAI Intent Detection→ OpenAI parses redemption code → Structured redemption commandCode Validation→ Check database → Verify coupon exists, not expired, not already redeemedSmart Contract Verification→ Query GiggleGiftCoupon.sol → Validate on-chain coupon statusRecipient Verification→ Ensure redeemer is not the creator → Prevent self-redemptionPYUSD Transfer→ Smart contract executes redemption → PYUSD released from escrow to recipient walletStatus Update→ Database marks coupon as redeemed → Blockchain emits redemption eventConfirmations→ WhatsApp notifications → Both creator and recipient notified of successful redemptionIPFS Metadata→ Recipient can view personal message and image from IPFS URIPartner Technology BenefitsPayPal USD (PYUSD) - Core Payment InfrastructureDollar Stability: 1:1 USD backing eliminates cryptocurrency volatilityRegulatory Compliance: PayPal's oversight provides user confidenceReal-World Utility: Designed for payments, not speculationBrand Trust: PayPal's reputation accelerates mainstream adoptionEthereum Compatibility: ERC-20 standard enables seamless integrationPerfect for Remittances:Stable value for cross-border transfersHardhat - Smart Contract Development FrameworkProfessional Development: Industry-standard Ethereum development environmentTypeScript Integration: Type-safe smart contract development and testingAutomated Testing: Comprehensive test suites for contract validationNetwork Management: Simplified deployment across multiple networksDebugging Tools: Advanced debugging capabilities for contract developmentGas Optimization:Built-in analysis for cost-effective PYUSD operationsTwilio WhatsApp Business APIReliability: Enterprise-grade messaging with 99.9% uptimeCompliance: Built-in WhatsApp Business Policy adherenceScalability: Handles millions of concurrent PYUSD payment messagesSecurity: Webhook signature verificationOpenAI GPT-4o-miniNatural Language Understanding: Converts conversational text to PYUSD commandsIntent Detection: Recognizes PYUSD send, request, balance,gift coupon creation,gift coupon redemptionGift Command Parsing:Extracts amount, message, expiration from natural language (e.g., "create a $50 gift for my sister's wedding")Redemption Code Detection:Identifies coupon codes in various formats (e.g., "redeem GIFT1A2B3C4D" or "I have a gift code GIFT1A2B3C4D")Response Generation: Creates friendly, WhatsApp-formatted PYUSD responsesFallback Support: Graceful degradation when API unavailablePinata IPFSDecentralized Storage: PYUSD gift coupon metadata on IPFSReliability: Professional pinning service ensuring content availabilityGateway Access: HTTP access to IPFS contentMetadata Management: Structured JSON for rich PYUSD coupon dataPYUSD Integration Deep DiveWhy We Chose PayPal USDStability:Dollar-backed value prevents payment amount fluctuationTrust:PayPal's brand recognition reduces crypto adoption barriersCompliance:Regulatory oversight aligns with our vision for mainstream adoptionUtility:PYUSD is designed for payments, matching our use case perfectlyInteroperability:ERC-20 standard works seamlessly with Ethereum ecosystemPYUSD Technical ImplementationDirect integration with PYUSD ERC-20 contract on EthereumBalance queries usingbalanceOf()contract methodTransfers usingtransfer()method with proper gas estimationTransaction history tracking via blockchain event logsSupport for both Sepolia testnet (development) and mainnet (production)Hardhat deployment scripts for PYUSD-compatible smart contractsHardhat Integration Deep DiveWhy We Chose HardhatTypeScript Support:Seamless integration with our TypeScript backendTesting Framework:Robust testing for PYUSD smart contractsDeployment Automation:Consistent contract deployments across networksDeveloper Experience:Best-in-class tooling for Ethereum developmentCommunity Support:Industry-standard framework with extensive documentationHardhat Technical ImplementationSmart contract development incontracts/directoryAutomated test suites intest/directoryDeployment scripts inignition/modules/for repeatable deploymentsNetwork configuration for Sepolia testnet and mainnetEthers.js v6 integration for contract interactionPYUSD token address configuration for different networksPerformance OptimizationsCaching StrategyPYUSD wallet caching to reuse existing walletsPYUSD balance caching with 30-second TTLTransaction history caching for recent PYUSD operationsSmart Contract Gas Optimization (Hardhat-Enabled)Gas usage analysis using Hardhat toolsOptimized storage patterns for PYUSD gift couponsEfficient event emission for transaction trackingMinimal on-chain storage with IPFS offloadingError Handling & ResilienceMulti-Layer Error HandlingTwilio webhook signature validationOpenAI fallback parser activationPYUSD blockchain error handling with retry logicDatabase transaction rollback on failuresUser-friendly error message generationHardhat contract testing catching edge casesGraceful DegradationNo OpenAI: Fallback parser handles basic PYUSD commandsNo IPFS: Mock metadata for developmentNo Blockchain: Mock PYUSD responses for testingNo Database: In-memory storage for developmentETHGlobal Hackathon HighlightsThis project demonstrates the power of combining:PayPal USD (PYUSD):Bringing dollar-backed stability to WhatsApp paymentsGift Economy Innovation:First-of-its-kind PYUSD gift coupon system with conversational creation and redemptionHardhat:Professional smart contract development ensuring security and reliability for gift couponsEthereum:Leveraging blockchain for transparent, instant settlements and gift redemptionsWhatsApp:Meeting users where they already are (2B+ users) - send gifts as easily as sending a messageAI:Making complex blockchain operations conversational - "create a $50 gift" just worksIPFS:Decentralized storage for personalized gift messages and imagesDevelopment Workflow ExcellenceGift Coupon Smart Contractsdeveloped in Hardhat with TypeScriptComprehensive test coverage ensuring PYUSD gift creation and redemption are secureGift Coupon Testing:Validated creation, redemption, expiration, and refund scenariosAutomated deployment to Sepolia testnet for safe testing of gift featuresPYUSD integration validated through extensive testing including gift workflowsEnd-to-End Gift Testing:Complete user journey from WhatsApp gift creation to redemptionProduction-ready architecture for mainnet deployment with full gift economy supportThis architecture enables Giggle to handle Web3 complexity while presenting a simple, familiar interface through WhatsApp, making PayPal USD accessible to billions of users worldwide - perfectly aligned with PayPal's vision of democratizing financial services and Hardhat's mission of professional-grade smart contract development.
Hackathon
ETHOnline 2025
2025
Contributors
- jintukumardas
9 contributions
- S0naliThakur
1 contributions