project screenshot 1
project screenshot 2
project screenshot 3
project screenshot 4
project screenshot 5
project screenshot 6

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

MangroveKUB

Created At

ETHGlobal Bangkok

Project Description

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 Map

  • Real-time visualization of Thailand's coastal areas
  • Detailed flood susceptibility analysis (Natural Disaster)
  • Storm exposure metrics and natural barrier protection levels
  • Current mangrove coverage data with province-specific environmental insights

• KUB Token Staking System (KUB Utilization)

  • Area-specific staking pools for each coastal region
  • Competitive APY rewards (3-5% according to the node validators)
  • Transparent pool capacity tracking
  • Direct connection between staking and local conservation efforts
  • Smart contract-based reward distribution
  • Carbon Reduction Certificate to all stakers

• Environmental Impact

  • Funds generated from staking pools directly support:
    • Mangrove restoration projects
    • Local conservation initiatives
    • Community-based environmental programs
    • Sustainable coastal development
    • Efficient carbon absorption
  • Real-time tracking of mangrove growth and coverage
  • Data-driven growth recommendations for each area

Technical 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 assessments

Target Users: • Environmental conscious investors • Local community members • Conservation organizations • DeFi participants • Environmental researchers • Policy makers

Impact 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 causes

Future 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.

How it's Made

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 modeling

Map 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 development

AI Risk Assessment Implementation: We developed a sophisticated risk assessment system using machine learning:

  1. Random Forest Model Architecture
  • Implemented RandomForestRegressor from scikit-learn
  • Features included:
    • Historical flood data
    • Elevation data
    • Distance to coastline
    • Existing mangrove density
    • Soil composition
    • Rainfall patterns
    • Storm frequency data
    • Tidal information
  1. Model Training Process
  • Utilized extensive environmental and historical data
  • Implemented cross-validation techniques
  • Regular model retraining with new data
  • Feature importance analysis for transparency
  1. Risk Assessment Metrics
  • Flood Susceptibility (0-1 scale)
    • Based on historical flood data and geographical features
    • Weighted by mangrove presence and density
  • Storm Exposure (0-1 scale)
    • Calculated from historical storm patterns
    • Considers coastal proximity and elevation
  • Natural Barrier Protection (0-1 scale)
    • Evaluates existing mangrove effectiveness
    • Includes soil stability and coastal morphology

Technical Features:

  1. Dynamic Risk Visualization
  • Custom color-coding system for risk levels
  • Real-time data rendering
  • Interactive hover and click events
  • Smooth transitions between states
  1. Complex Data Integration
  • Multiple GeoJSON data sources:
    • MangroveGrowthSuggestion.json
    • thailandWithName.json
    • DisasterFloodArea_Premium.json
    • Mangrove_Thailand_Only.json
  • Centroid calculations for mangrove points
  • Area calculations for coverage statistics
  1. UI/UX Innovations
  • Backdrop filter effects for modern glass morphism
  • Custom animations for state transitions
  • Responsive design for all screen sizes
  • Intuitive popup system for data display
  1. Blockchain Integration
  • Seamless wallet connection through AppKit
  • Custom KUB token staking interface (Utilizing & Fundraising)
  • Real-time wallet state management
  • Province-specific staking pools

Technical Challenges & Solutions:

  1. Map Performance Challenge: Handling multiple vector layers with complex interactions Solution: Implemented efficient layer management and feature filtering

  2. Data Visualization Challenge: Representing multiple risk factors simultaneously Solution: Developed a layered approach with opacity management and interactive features

  3. Blockchain Integration Challenge: Connecting geographical areas to staking pools Solution: Created a mapping system linking coordinates to smart contract addresses

  4. AI Model Integration Challenge: Integrating ML predictions with real-time map data Solution: Developed efficient data pipeline and caching system

Unique Implementation Details:

  1. Risk Assessment Integration
const 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)';
};
  1. Machine Learning Pipeline
from 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 * protection
  1. Geographical Data Processing
const 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 modeling

Notable Optimizations:

  1. Performance
  • Implemented custom feature filtering
  • Used setTimeout for delayed initialization
  • Created efficient memory management
  • Optimized ML prediction caching
  1. UI Enhancement
  • Custom popup positioning system
  • Dynamic style calculations
  • Smooth animations without performance impact
  1. Data Management
  • Efficient GeoJSON parsing and caching
  • Custom coordinate transformation system
  • Optimized vector layer rendering
  • Streamlined ML prediction pipeline

The 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.

background image mobile

Join the mailing list

Get the latest news and updates