🌱 Revolutionizing Carbon Credit Management with Blockchain & Real-Time Market Integration 💹
🚀 Quick Start • ✨ Features • 🏗️ Tech Stack • 📸 Screenshots • 📚 Documentation
CarbonChain is a full-stack blockchain platform that transforms how blue carbon credits are registered, verified, and traded. Built for mangrove restoration projects, it combines cutting-edge technology to create a transparent, efficient, and real-time carbon credit marketplace.
- 🌊 Blue Carbon Focus - Specialized for mangrove and coastal ecosystem restoration
- ⛓️ Blockchain-Powered - Immutable records on Aptos blockchain
- 💹 Real-Time Pricing - Live market data from Binance API (updates every second!)
- 🤖 AI-Driven - Automated satellite imagery analysis and carbon calculations
- 📊 Impact Tracking - Comprehensive environmental and community benefit monitoring
- 🔒 Secure & Transparent - Multi-stage verification with blockchain audit trail
- Project Registration - Complete onboarding workflow with site details
- AI Image Analysis - Automated satellite and site image processing
- Carbon Calculation - Precise CO₂ sequestration estimates
- Multi-Stage Verification - Internal → Third-Party → Legal compliance
- Blockchain Deployment - Immutable project records on Aptos
- Smart Contracts - Production-ready Aptos Move contracts
- GeoNFT Minting - Location-bound NFTs for verified sites
- Token Management - Fungible carbon credit tokens
- Transfer & Retirement - Complete lifecycle management
- Event Emission - Real-time blockchain event tracking
- Real-Time Pricing - Binance API integration with 1-second updates
- Market Sentiment - Bullish/Bearish indicators based on crypto markets
- Dynamic Valuation - Portfolio values update with live market data
- Price Fluctuation - Visual indicators for market movements
- Crypto Correlation - 20% correlation to BTC price movements
- Environmental Metrics - CO₂ sequestration, biodiversity, water quality
- Community Benefits - Jobs created, families supported, income generated
- Progress Tracking - Restoration progress, carbon sequestration rates
- Real-Time Monitoring - Live data updates and visualizations
- Comprehensive Reports - Detailed impact analysis
React 18.0 - Modern UI framework
TailwindCSS - Utility-first styling
Aptos Wallet SDK - Blockchain wallet integration
Binance Service - Real-time market data
Python 3.9+ - Core language
FastAPI 0.104 - High-performance API framework
SQLAlchemy - ORM for database operations
Pydantic - Data validation
Aptos SDK - Blockchain integration
Aptos Move - Smart contract language
Carbon Registry - Main contract module
GeoNFT System - Location-bound NFTs
Token Management - Fungible credit tokens
Binance API - Real-time cryptocurrency prices
Satellite Imagery - Environmental monitoring
AI/ML Services - Image analysis & carbon calc
- Python 3.9 or higher
- Node.js 14 or higher
- npm or yarn
git clone https://github.com/Nishat2006/Carbonchain.git
cd Carbonchaincd backend
pip install -r requirements.txt
python main.pyBackend will run on http://localhost:8000
cd carbon-assessment
npm install
npm startFrontend will run on http://localhost:3000
# Start both servers at once
START_ALL.bat- Open
http://localhost:3000in your browser - Create a new carbon credit project
- Upload site images for AI analysis
- Complete verification workflow
- Deploy to blockchain
- Monitor impact on dashboard
- Trade on marketplace with live pricing
Carbonchain/
├── backend/ # Python FastAPI Backend
│ ├── main.py # Main API application
│ ├── models.py # Database models
│ ├── schemas.py # Pydantic schemas
│ ├── database.py # Database configuration
│ ├── requirements.txt # Python dependencies
│ └── services/ # Business logic modules
│ ├── binance_price_service.py # Real-time pricing
│ ├── aptos_integration.py # Blockchain integration
│ ├── blockchain_service.py # Smart contract interactions
│ ├── image_analysis.py # AI image processing
│ ├── carbon_calculator.py # CO₂ calculations
│ ├── verification_service.py # Verification workflow
│ └── marketplace_service.py # Trading functionality
│
├── carbon-assessment/ # React Frontend
│ ├── src/
│ │ ├── components/ # React components
│ │ │ ├── InitialAssessment.js
│ │ │ ├── BlockchainRegistry.js
│ │ │ ├── SmartContracts.js
│ │ │ ├── CarbonMarketplace.js
│ │ │ ├── ImpactDashboard.js
│ │ │ └── WalletConnect.js
│ │ ├── services/ # Frontend services
│ │ │ ├── binanceService.js # Market data service
│ │ │ └── aptosWallet.js # Wallet integration
│ │ └── App.js # Main application
│ └── package.json # Node dependencies
│
├── aptos-contracts/ # Aptos Move Smart Contracts
│ ├── sources/
│ │ ├── carbon_credit.move # Main registry contract
│ │ └── carbon_registry.move # Enhanced CRUD contract
│ ├── Move.toml # Move package configuration
│ ├── deploy_registry.bat # Windows deployment
│ └── deploy_registry.sh # Linux/Mac deployment
│
├── START_ALL.bat # Quick start script (Windows)
├── start_both.bat # Alternative startup
├── start_backend.bat # Backend only
├── start_frontend.bat # Frontend only
├── QUICK_START.md # Quick start guide
└── README.md # This file
Create .env file in backend/ directory:
DATABASE_URL=sqlite:///./carbon_registry.db
APTOS_NODE_URL=https://fullnode.testnet.aptoslabs.com/v1
APTOS_MODULE_ADDRESS=your_contract_address_hereCreate .env.local file in carbon-assessment/ directory:
REACT_APP_API_URL=http://localhost:8000
REACT_APP_APTOS_NODE_URL=https://fullnode.testnet.aptoslabs.com/v1
REACT_APP_CONTRACT_ADDRESS=your_contract_address_herePOST /api/projects - Create new project
GET /api/projects - List all projects
GET /api/projects/{id} - Get project details
PUT /api/projects/{id} - Update project
DELETE /api/projects/{id} - Delete project
POST /api/blockchain/deploy - Deploy smart contract
POST /api/blockchain/mint-nft - Mint GeoNFT
POST /api/blockchain/tokenize - Create carbon tokens
GET /api/marketplace/listings - Get all listings
GET /api/marketplace/statistics - Market statistics
GET /api/marketplace/live-prices - Real-time prices
GET /api/marketplace/portfolio-value/{credits} - Calculate value
POST /api/verification - Create verification record
PUT /api/verification/{id} - Update verification status
Full API documentation available at http://localhost:8000/docs
- Update Frequency: 1 second
- Data Source: Binance Public API
- Crypto Tracked: BTC, ETH, BNB, APT
- Correlation: 20% to BTC price movements
- Features:
- Live price updates
- 24h high/low tracking
- Market sentiment analysis
- Volume monitoring
- Dynamic portfolio valuation
Carbon Price = Base Price × (1 + BTC Change % × 0.2)
Market Value = Carbon Credits × Current Price
- Aptos CLI installed
- Testnet account with APT tokens
cd aptos-contracts
# Windows
deploy_registry.bat
# Linux/Mac
./deploy_registry.shaptos move run --function-id 'YOUR_ADDRESS::registry::initialize'cd backend
pytestcd carbon-assessment
npm testVisit http://localhost:8000/docs for interactive API documentation
- Complete backend API (20+ endpoints)
- React frontend with 6 components
- Real-time Binance price integration
- Aptos blockchain smart contracts
- AI image analysis simulation
- Carbon credit calculations
- Multi-stage verification workflow
- GeoNFT minting
- Token management
- Marketplace with live pricing
- Impact dashboard
- Database operations (CRUD)
- File upload handling
- Real AI/ML model integration
- Advanced satellite imagery analysis
- Multi-chain support (Ethereum, Polygon)
- Mobile app (React Native)
- Advanced analytics dashboard
- Automated reporting
- Multi-language support
- Integration with carbon registries (Verra, Gold Standard)
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
Developed by: Nishat , Manas , Parth , Kunjan
Contact: GitHub
- Aptos Foundation - For blockchain infrastructure
- Binance - For real-time market data API
- FastAPI - For excellent Python web framework
- React Team - For powerful frontend library
- Open Source Community - For amazing tools and libraries



