Skip to content

sanjeevi0078/trustroot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TrustRoot 🌿

Blockchain-Powered Forest Guardian Platform with Satellite Verification

TrustRoot is a comprehensive platform that connects forest guardians with carbon credit buyers through transparent, verifiable satellite monitoring and smart contract-based payments.

🌟 Features

For Forest Guardians

  • 📱 Mobile App - Easy evidence upload with GPS verification (React Native/Expo)
  • 🛰️ Satellite Monitoring - Automated NDVI health checks via Google Earth Engine
  • 💰 Smart Payments - Health-gated payments released automatically on-chain
  • 📊 Dashboard - Track earnings, health scores, and verification history

For Corporates

  • 🌍 Carbon Credits - Purchase verified ERC-1155 carbon credits
  • 📈 Impact Tracking - Real-time forest health monitoring
  • Transparency - All verifications recorded on Polygon blockchain

For Administrators

  • 🔍 Verification Dashboard - Review guardian submissions
  • 📡 Oracle Management - Configure satellite monitoring thresholds
  • 🎛️ Smart Contract Control - Emergency pause, role management

🏗️ Architecture

TrustRoot/
├── frontend/          # React + Vite web dashboard
├── mobile/            # React Native (Expo) guardian app
├── backend/           # Flask API + Satellite service
├── smart-contracts/   # Solidity contracts (Hardhat)
└── database/          # PostgreSQL schema

🚀 Quick Start

Prerequisites

  • Node.js 18+
  • Python 3.9+
  • PostgreSQL (optional, uses mock data otherwise)

1. Start the Backend

cd backend
pip install -r requirements.txt
python app.py

Backend runs on http://localhost:5000

2. Start the Frontend

cd frontend
npm install
npm run dev

Frontend runs on http://localhost:5173

3. Start the Mobile App (Optional)

cd mobile
npm install
npx expo start

Scan QR code with Expo Go app.

4. Smart Contracts

cd smart-contracts
npm install
npx hardhat compile
npx hardhat test
npx hardhat run scripts/deploy.js --network amoy

🛰️ Satellite Integration

TrustRoot uses Google Earth Engine for automated vegetation monitoring:

Metric Source Threshold
NDVI Sentinel-2 ≥0.6 = Healthy
Cloud Cover Sentinel-2 <20% required
Frequency Automatic Every 2 weeks

Status Classification:

  • 🌿 HEALTHY (NDVI ≥ 0.6) - Full payment released
  • ⚠️ DEGRADED (0.3 ≤ NDVI < 0.6) - Warning issued
  • 🔴 CRITICAL (NDVI < 0.3) - Payment withheld

📱 Mobile App Features

The TrustRoot Guardian mobile app provides:

  • 📸 Camera Integration - Capture and upload evidence photos
  • 📍 GPS Verification - Automatic location tagging
  • 📴 Offline Mode - Queue uploads for later sync
  • 🔔 Push Notifications - Payment and health check alerts
  • 🛰️ Satellite View - Real-time NDVI display

🔗 Smart Contracts

BlueCarbon.sol (Unified Contract)

  • ERC-1155 carbon credit tokens
  • Guardian Registry with role-based access
  • Plot Management with GPS coordinates
  • Health Verification oracle integration
  • Payment System with health-gated releases
  • Emergency Controls (pause, withdraw)

Network: Polygon Amoy Testnet

📊 API Endpoints

Satellite Service

GET  /satellite/status           # Service health
GET  /satellite/check/:lat/:lng  # Check NDVI at location
POST /satellite/check/batch      # Batch check plots
GET  /satellite/trend            # Historical NDVI

Health Oracle

GET  /oracle/status              # Oracle configuration
POST /oracle/check               # Record health check
GET  /oracle/plots               # Registered plots

🛠️ Environment Variables

# Backend
FLASK_ENV=development
DATABASE_URL=postgresql://...
POLYGON_RPC_URL=https://rpc-amoy.polygon.technology
WALLET_PRIVATE_KEY=your_key_here

# Frontend  
VITE_API_URL=http://localhost:5000
VITE_MAPBOX_TOKEN=your_mapbox_token

# Google Earth Engine (optional)
GEE_SERVICE_ACCOUNT=your@account.iam.gserviceaccount.com
GEE_PRIVATE_KEY_PATH=./gee-credentials.json

📄 License

MIT License


Built with 💚 for a greener future

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors