CupFi
Save the planet, one sip at a time—get rewarded for using your reusable cup!
Problem Statement
We are living in an era defined by a supremacy of compute. AI models are getting larger, GPU demands are skyrocketing, and everyone is chasing “faster technology” and stronger inference speeds. The Web3 world is no exception — AI agents, on-chain DeFi modules, and modular layers are proliferating rapidly. But do we really need all this “new tech”?Or are we actually lacking truly meaningful use cases?Most current blockchain applications remain trapped in their own echo chambers. The complex mechanisms of DeFi and the hype-driven language of NFTs make it hard for outsiders to relate. Ask them: “Would you use these?” The answer is often: “Why should I?”✧ What will truly bring Web3 to the masses isn’t deeper technology, but more accessible on-ramps.CupFi is exactly such an entry point. It doesn’t begin with speculation — it begins with the everyday. A reusable cup, a carbon-reducing action, can unlock on-chain identity, initiate staking, claim tokens, participate in DeFi, and unlock the full Web3 journey.No tutorial videos, no complicated steps, no technical barriers. CupFi users might not even realize they’re using blockchain.And yet, they’ve completed their first on-chain transaction, experienced their first staking, and earned their first sustainability token.✧ The future of Web3 is not something you consciously “enter” — it’s something you unknowingly live in.Starting from a cup of coffee, let the chain come into real life — not people going into the chain.✦ Multimodal AI Verification Core At the heart of CupFi’s technology lies a cutting-edge multimodal AI model used to validate eco-conscious behaviors:➤ Image Recognition Accuracy – Utilizes advanced visual recognition algorithms to precisely identify reusable cups in submitted photos ➤ Scene Context Comprehension – AI interprets environmental and contextual clues to distinguish genuine usage from fraudulent scenarios ➤ Professional Prompt Engineering – The development team has designed optimized prompts that significantly enhance recognition accuracy ➤ Forgery Detection – The model is specially trained to detect photo tampering and manipulation ➤ Continuous Learning Mechanism – Verification cases are logged to continually refine the system’s detection capabilities✦ Three-Layer Verification Framework CupFi has developed a resilient three-tier verification architecture:➤ Self Protocol Identity Verification – Ensures each user is a real individual using zero-knowledge proof (ZKP) technology ➤ Economic Staking Mechanism – Introduces an economic layer through CELO token staking to deter dishonest behavior ➤ Multimodal AI-Based Image Verification – Verifies the authenticity of eco-friendly actions through cutting-edge AI analysis✦ Integration with Self Protocol CupFi deeply integrates with Self Protocol, a privacy-first, open-source identity system:➤ Zero-Knowledge Proofs – Users can verify identity without disclosing personal information ➤ NFC-Based Passport Scanning – Users generate ZKPs by scanning passport data via mobile NFC functionality ➤ Selective Disclosure – Users may choose to share only the necessary parts of their identity ➤ Sybil Attack Mitigation – Effectively prevents bots and multiple account exploitation✦ Staking Verification Mechanism Once users complete identity verification through Self Protocol, they must stake a minimum of 0.0001 CELO tokens to become eligible. This mechanism:➤ Establishes a threshold for genuine participation ➤ Raises the barrier for fraudulent behavior ➤ Provides a basis for reward distribution ➤ Aligns users with vested economic interest✦ Full User Journey➤ Identity Authentication Users complete a one-time identity verification via Self Protocol to establish their authenticity➤ Token Staking Users stake CELO tokens (minimum 0.0001 CELO) through the StakingPool contract➤ Photo Submission Upon qualification, users upload photos documenting their use of reusable cups➤ AI-Based Verification The multimodal AI analyzes submissions across multiple dimensions to verify authenticity➤ Daily Validation Requirement Users must complete 3 successful verifications per day to become reward-eligible➤ Reward Distribution Qualified users receive EcoCupToken rewards based on their staking amount and current APR✦ Technical Highlights➤ Advanced AI Application – Employs state-of-the-art multimodal AI to accurately identify eco-conscious behaviors ➤ Zero-Knowledge Identity Verification – Implements privacy-preserving identity validation through Self Protocol ➤ Layered Anti-Fraud Measures – Combines identity verification, staking incentives, and AI-based validation ➤ Sustainable DeFi Architecture – Built on Celo’s carbon-neutral blockchain, aligning with eco-friendly principles ➤ Scalable Incentive System – Dynamically adjusts rewards based on user engagement and staking volume
Solution
✦ Project Development Process✧ Smart Contract Architecture and Workflow Design➤ Design Philosophy of the Contract System We’ve designed a thoughtfully structured smart contract system to ensure security, scalability, and user experience:➤ Modular Contract ArchitectureFunctionality is divided across five specialized contracts, each responsible for a specific domainAdheres to the principle of separation of concerns for ease of maintenance and upgradesEstablishes clear inter-contract relationships to enhance security➤ User-Centric Workflow DesignStreamlined on-chain interaction steps to minimize user wait time and gas feesComplex logic is encapsulated within the contracts, exposing intuitive interfaces externallyError-prevention mechanisms are in place to protect users from fund loss due to misoperations➤ Security-First Code ImplementationCore functionalities built with OpenZeppelin’s standard librariesStrict access control mechanisms prevent unauthorized actionsReentrancy guards and overflow protections are implementedEmergency pause functionality allows rapid response to potential vulnerabilities✧ Inter-Contract Collaboration Workflow Our smart contract ecosystem is designed to form a fully coordinated framework:➤ SelfVerification ContractReceives and verifies zero-knowledge proofs (ZKPs) from the Self ProtocolImplements one-time identity verification logicStores hashes of verification results rather than personal data to preserve privacyEmits verification events to trigger subsequent processes➤ StakingPool ContractManages the core CELO staking logicImplements minimum staking threshold checks (0.0001 CELO)Optimizes withdrawal processes to protect user assetsSupplies real-time staking data to the reward calculation system➤ VerificationRegistry ContractActs as a central coordinator, connecting other contractsMaintains daily verification records of reusable cup usageImplements time-window management and daily reset mechanismsProvides a public interface for checking verification status➤ RewardController ContractImplements reward logic based on staking amount and APRChecks verification completion and reward eligibilityManages reward distribution time windowsInteracts with the EcoCupToken contract to mint reward tokens➤ EcoCupToken ContractImplements a standard ERC-20 tokenRole-based minting authority controlSupports future governance and ecosystem expansion✧ Carefully Engineered Multimodal AI Prompt System We leveraged Gemini's multimodal capabilities to build an advanced reusable cup verification system. The core lies in our prompt engineering:➤ Prompt Design Process✧ Problem Definition PhaseIdentified common reusable cup usage scenarios through user interviewsCollected sample images of various reusable cup typesAnalyzed frequent misclassification cases and edge scenariosDefined clear identification standards and validation thresholds✧ Multi-Round Optimization IterationsInitial prompt achieved ~65% accuracyFirst optimization added detail-oriented cues, raising accuracy to 75%Second round introduced a structured analysis framework, reaching 85%Final version incorporated a multidimensional evaluation matrix, exceeding 95% accuracy➤ Structured Prompt Framework Our final prompt structure includes the following key elements:Detailed Task Definition – Clearly defines AI objectives and expected outputsKey Feature Checklist – Guides AI to identify reusable cup characteristicsEvaluation Matrix – Provides a 0–10 scoring system across multiple dimensionsNegative Examples – Clarifies invalid verification casesDecision Tree – Guides AI through logical steps for decision-makingConfidence Score Requirement – Asks AI to provide confidence scores for each judgment➤ Multi-Metric Evaluation System Our prompt instructs the AI to evaluate the following dimensions:Whether a reusable cup is clearly visible in the imageWhether the user is actively using the cupWhether the environment suggests a real usage contextPresence of indicators suggesting a disposable cupOverall image quality and clarity➤ Handling Challenging Scenarios Our prompt system is designed to address difficult edge cases:✧ Low-Light EnvironmentsIncludes specific guidance for identifying cups in dim lightingPrompts for contrast-enhancing analysis techniques✧ Similar Container DifferentiationProvides distinguishing traits between reusable and disposable cupsAdds material recognition guidance (glass, metal, silicone, etc.)✧ Partially Visible CupsIntroduces inference logic based on visible portionsSets a minimum visibility threshold for validation✧ Creative Camera AnglesAdds instructions for multi-angle recognitionConsiders atypical usage scenarios in validation criteria✧ Frontend Technology and User Experience➤ Mobile-First Vertical UI Design✧ Vertical Flow UIVertical scrolling single-page app designOptimized for one-handed mobile operationEnables seamless photo capture and upload✧ Integrated Camera AccessDirectly accesses the mobile camera within the appProvides real-time preview and quick capture confirmationEnhances upload experience and reduces wait time✧ Responsive DesignTailwind CSS-based responsive layoutAutomatically adjusts UI elements to device specificationsEnsures consistent experience across screen sizes➤ Intuitive User Journey✧ Simplified Onboarding FlowIntuitive wallet connection processClear guidance through identity verification stepsEasy onboarding for initial staking✧ Optimized Verification FlowOn-screen tips for ideal angles and lighting during photo captureReal-time verification progress and attempt countInstant feedback on results to reduce user uncertainty✧ Transparent RewardsReal-time display of current stake and expected rewardsClear reward claim conditions and time windowsVisual history of reward achievements✧ Technical Challenges and Innovative Solutions➤ Smart Contract Challenges & Solutions✧ Efficient Verification RecordkeepingDesigning a bitmap compression algorithm to store 3 daily verification states in a single uint8Reusing date-based mappings to avoid unbounded storage growthResulted in an ~85% reduction in storage costs✧ Dynamic Time Window ManagementImplementing a UTC-based smart date conversion systemUsing block timestamps to define transition pointsAdding safety checks against timestamp manipulation✧ Gas Efficiency OptimizationA read/write separation model to optimize storage operationsUsed events instead of storage for non-critical dataBatched multiple verification actions into single operations➤ AI Verification Experience Enhancements✧ Real-Time Feedback SystemProvides photo tips based on initial AI analysisVisual indicators show verification progressOffers actionable suggestions instead of generic success/failure✧ Seamless Cross-Network ExperienceAutomatically detects and adapts to user’s networkSmooth transition between mainnet and testnet configurationsClear network indicators and switching options provided✧ Technical Integration and Synergy➤ Celo + Mobile ExperienceFast confirmation times align perfectly with real-time verification needsMobile-optimized transaction handling reduces wait timeLow gas fees make frequent verifications economically viableComplements our vertically designed mobile application➤ Self Protocol + User ExperienceWraps complex zero-knowledge proof logic in intuitive interfacesUses mobile NFC for quick passport scansOne-time identity verification removes repeat frictionFully preserves user privacy by only storing verification results on-chain✧ Future Technical Development➤ Features under development include geolocation verification for enhanced authenticity ➤ Planned social sharing functions to amplify ecosystem impact ➤ Exploring eco-behavior NFT badge systems to encourage long-term engagement ➤ Upcoming merchant integration module to offer real-world discounts at partner cafes