MangroveKUB
MangroveKUB: A blockchain-powered platform enabling users to utilize KUB tokens in Thailand's coastal areas. Ai-analyzed disaster risks, support mangrove conservation, and earn rewards while funding environmental protection. 🌱🌊 #Web3ForGood #sustainability
Screenshots






Problem Statement
MangroveKUB is an innovative blockchain-based platform that combines environmental conservation with decentralized finance (DeFi) on the Bitkub Chain. The project focuses on protecting and expanding Thailand's crucial mangrove ecosystems through a unique staking mechanism that incentivizes community participation in environmental conservation. This project also aims for KUB tokens utilization to make it the most powerful to restore Mangrove in all coastal areas of Thailand before expanding to global.Key Features: • Interactive Risk Assessment MapReal-time visualization of Thailand's coastal areasDetailed flood susceptibility analysis (Natural Disaster)Storm exposure metrics and natural barrier protection levelsCurrent mangrove coverage data with province-specific environmental insights• KUB Token Staking System (KUB Utilization)Area-specific staking pools for each coastal regionCompetitive APY rewards (3-5% according to the node validators)Transparent pool capacity trackingDirect connection between staking and local conservation effortsSmart contract-based reward distributionCarbon Reduction Certificate to all stakers• Environmental ImpactFunds generated from staking pools directly support:Mangrove restoration projectsLocal conservation initiativesCommunity-based environmental programsSustainable coastal developmentEfficient carbon absorptionReal-time tracking of mangrove growth and coverageData-driven growth recommendations for each areaTechnical Infrastructure: Built on Bitkub Chain (Testnet), the platform integrates Web3 wallets (Reown) with an OpenLayers-based mapping system for real-time data visualization and secure smart contract implementation.User Benefits: • Earn passive income through staking • Contribute to environmental conservation • Track impact through transparent reporting • Participate in local environmental initiatives • Access detailed environmental risk assessmentsTarget Users: • Environmental conscious investors • Local community members • Conservation organizations • DeFi participants • Environmental researchers • Policy makersImpact Goals: • Increase mangrove coverage in Thailand's coastal areas • Reduce flood and storm damage risks to all nearby areas • Create sustainable funding for conservation • Engage communities in environmental protection • Demonstrate the viability of blockchain for environmental causesFuture Development: The project aims to expand its scope through integration with carbon credit markets, expansion to other regions, enhanced monitoring systems, community governance implementation, and partnerships with environmental organizations.Conclusion: MangroveKUB represents a bridge between blockchain technology and environmental conservation, creating a sustainable model where financial incentives align with ecological preservation. By allowing users to stake KUB tokens in specific geographical areas, the project creates a direct link between digital assets and real-world environmental impact. The platform's interactive map serves as both an educational tool and an investment interface, helping users understand environmental risks while facilitating their participation in conservation efforts.
Solution
How MangroveKUB Was Built Core Technologies: • React with TypeScript for robust frontend development • OpenLayers (ol) for advanced interactive mapping capabilities • Wagmi and Viem for Web3 integration • Bitkub Chain (Testnet) for blockchain infrastructure • @reown/appkit and @reown/appkit-adapter-wagmi for wallet connectivity • Python's scikit-learn for AI risk assessment modelingMap Implementation: We built the interactive map using OpenLayers with multiple sophisticated layers: • Base Layer: CartoDB light basemap for clean visualization • Risk Layer: Custom-styled vector layer showing flood susceptibility • Province Layer: Interactive boundaries with hover effects • Mangrove Layer: Point-based visualization of existing mangrove areas from Landsat Data (GlobalMangrove Watch) • Growth Suggestion Layer: Areas recommended for mangrove developmentAI Risk Assessment Implementation: We developed a sophisticated risk assessment system using machine learning:Random Forest Model ArchitectureImplemented RandomForestRegressor from scikit-learnFeatures included:Historical flood dataElevation dataDistance to coastlineExisting mangrove densitySoil compositionRainfall patternsStorm frequency dataTidal informationModel Training ProcessUtilized extensive environmental and historical dataImplemented cross-validation techniquesRegular model retraining with new dataFeature importance analysis for transparencyRisk Assessment MetricsFlood Susceptibility (0-1 scale)Based on historical flood data and geographical featuresWeighted by mangrove presence and densityStorm Exposure (0-1 scale)Calculated from historical storm patternsConsiders coastal proximity and elevationNatural Barrier Protection (0-1 scale)Evaluates existing mangrove effectivenessIncludes soil stability and coastal morphologyTechnical Features:Dynamic Risk VisualizationCustom color-coding system for risk levelsReal-time data renderingInteractive hover and click eventsSmooth transitions between statesComplex Data IntegrationMultiple GeoJSON data sources:MangroveGrowthSuggestion.jsonthailandWithName.jsonDisasterFloodArea_Premium.jsonMangrove_Thailand_Only.jsonCentroid calculations for mangrove pointsArea calculations for coverage statisticsUI/UX InnovationsBackdrop filter effects for modern glass morphismCustom animations for state transitionsResponsive design for all screen sizesIntuitive popup system for data displayBlockchain IntegrationSeamless wallet connection through AppKitCustom KUB token staking interface (Utilizing & Fundraising)Real-time wallet state managementProvince-specific staking poolsTechnical Challenges & Solutions:Map Performance Challenge: Handling multiple vector layers with complex interactions Solution: Implemented efficient layer management and feature filteringData Visualization Challenge: Representing multiple risk factors simultaneously Solution: Developed a layered approach with opacity management and interactive featuresBlockchain Integration Challenge: Connecting geographical areas to staking pools Solution: Created a mapping system linking coordinates to smart contract addressesAI Model Integration Challenge: Integrating ML predictions with real-time map data Solution: Developed efficient data pipeline and caching systemUnique Implementation Details:Risk Assessment Integrationconst getRiskColor = (risk: number): string => { if (risk < 0.2) return 'rgba(51, 255, 87, 0.6)'; if (risk < 0.4) return 'rgba(173, 255, 47, 0.6)'; if (risk < 0.6) return 'rgba(255, 255, 0, 0.6)'; if (risk < 0.8) return 'rgba(255, 165, 0, 0.6)'; return 'rgba(255, 0, 0, 0.6)'; };Machine Learning Pipelinefrom sklearn.ensemble import RandomForestRegressor rf_model = RandomForestRegressor( n_estimators=100, max_depth=15, min_samples_split=5, random_state=42 ) def calculate_risk_score(predictions): flood_risk = predictions['flood_susceptibility'] storm_risk = predictions['storm_exposure'] protection = predictions['natural_barrier'] return 0.4 * flood_risk + 0.4 * storm_risk - 0.2 * protectionGeographical Data Processingconst getCentroid = (coordinates: number[][]) => { let sumX = 0, sumY = 0; coordinates.forEach(coord => { sumX += coord[0]; sumY += coord[1]; }); return [sumX / coordinates.length, sumY / coordinates.length]; };Partner Technologies Benefits: • OpenLayers: Provided robust mapping capabilities and custom styling options • Wagmi: Simplified Web3 integration and state management • AppKit(ReOwn): Streamlined wallet connection process • Bitkub Chain: Offered efficient and cost-effective blockchain infrastructure • Scikit-learn: Enabled sophisticated risk assessment modelingNotable Optimizations:PerformanceImplemented custom feature filteringUsed setTimeout for delayed initializationCreated efficient memory managementOptimized ML prediction cachingUI EnhancementCustom popup positioning systemDynamic style calculationsSmooth animations without performance impactData ManagementEfficient GeoJSON parsing and cachingCustom coordinate transformation systemOptimized vector layer renderingStreamlined ML prediction pipelineThe project demonstrates the successful integration of blockchain technology, machine learning, and geographical data visualization to create an innovative environmental DeFi platform. The combination of RandomForestRegressor for risk assessment with real-time blockchain interactions provides a robust foundation for incentivizing mangrove conservation through staking mechanisms.
Hackathon
ETHGlobal Bangkok
2024