🔧 CarbonCore Developer Wiki

Complete Technical Documentation for Blockchain-Based Carbon Market Platform

📚 Platform Overview

CarbonCore.Earth is a comprehensive blockchain-based platform for streamlined creation, validation, and trading of carbon credits and CDR certificates. Built on Ethereum with smart contracts, the system provides complete transparency throughout the entire lifecycle of carbon sequestration projects.

Core Principles:

📖 Technical Guides

Comprehensive developer documentation in minimalist text format (Courier monospace, black on white):

💡 Tip: All guides are in plain text format, optimized for terminal viewing and easy searching. Open in any text editor or use cat guide-XX.txt in terminal.

🗂️ Architecture Stack

Blockchain Layer

  • Network: Ethereum Mainnet
  • Contracts: Solidity
  • Web3: Ethers.js
  • Standards: ERC-20, ERC-721

Frontend

  • Core: HTML5, CSS3, ES6+
  • Mapping: Leaflet.js
  • Wallets: MetaMask, WalletConnect
  • Architecture: Modular services

Backend & Data

  • Database: AWS RDS PostgreSQL
  • Serverless: AWS Lambda
  • API: REST via API Gateway
  • Auth: JWT tokens

Infrastructure

  • Cloud: AWS (US-East-1)
  • Storage: IPFS, S3
  • Payments: Paypal/USDT/USDC
  • Email: AWS SES

📜 Smart Contract Infrastructure

Sepolia Testnet Addresses:

UserUID: 0xdc06fD25E479D570310bA0D3b555974d6841c076
UID-based user identity and profile management
RoleManager: 0x60569F3910459056dA97076b49013BF9AB843102
Role-based access control (Landowner, Expert, VVB, Government)
TerritoryRegistry: 0x2Bb231045BcC27ec9925bB7453976c517162a5A7
Territory registration and verification workflow
CarbonCreditFactory: 0x20ACB9DA5a312903822A46DD77728112e9735cC0
Project creation and automated token issuance
TerritoryTokenFactory: 0xfC69CbCc115eB28DE6d8f3C3c5A1C19984FD4f93
ERC-20 token deployment for each territory project
RequestManager: 0xE52950D4Baa78C2caE0970F282701350f3681ee0
Onboarding requests and workflow management
OTCMarketInterface: 0xDAde447FCC8B2480c76cc8E0be23eb5772966C21
OTC marketplace for carbon credit trading
OTCMarketIndex: 0xd154C16A5d1fB9CE16B88F0c76593D1C28Bd046e
Order indexing and search functionality

🔄 Complete Project Lifecycle

Stage 1: Territory Registration

1. User creates UID profile (UserUID contract)
2. Register territory with geographic boundaries (TerritoryRegistry)
3. Submit onboarding request (RequestManager)
4. Status: PENDING + Pending

Stage 2: Verification Process

5. Admin generates invoice → COMPLETED + UnderExpertise
6. User pays → COMPLETED + Pending
7. Admin confirms payment → REVISION + Pending
8. Expert claims territory → REVISION + UnderExpertise
9. Expert submits verification with CO2 data → REVISION + ExpertVerified
10. Admin confirms expertise → APPROVED + ExpertVerified
11. VVB validation → APPROVED + GovernmentVerified
12. Admin final approval → COMPLETED + GovernmentVerified

Stage 3: Token Generation

13. Create project via CarbonCreditFactory.createProject()
14. Automatic ERC-20 token deployment via TerritoryTokenFactory
15. Daily token issuance via issueCredits() (callable by anyone)
16. Tokens sent to UID-based beneficiary
17. Status: HAS_ACTIVE_PROJECT

🪙 Token Economics

Token Calculation Formula:

Annual CO2 Absorption = Territory CO2 rate (kg/year)
Daily Token Rate = Annual CO2 / 365 days
Token Precision = 18 decimals (ERC-20 standard)

Example: Territory 24 (Honduras Forest)

Annual CO2: 94,000,000 kg/year
Daily Rate: 257,534 tokens/day
Token Symbol: CCT24-2025
Contract: Unique ERC-20 per project

Issuance Rules:

🛠️ Key Service Modules

UnifiedTokenManager

Single solution for all token operations with automatic decimal detection:

// Parse amounts with correct decimals
await tokenManager.parseAmount(amount, tokenAddress);

// Format for display
await tokenManager.formatAmount(wei, tokenAddress);

// Check balance
await tokenManager.getBalance(tokenAddress, walletAddress);

// Approve tokens
await tokenManager.approve(tokenAddress, spender, amount);

MetadataService

Deal metadata management through CommentManager:

// Get order metadata
await MetadataService.getOrderMetadata(orderId);

// Structure for RFQ
{
  "metadataType": "RFQ",
  "requirements": { ... },
  "contactPreferences": { ... }
}

TerritoryDetailsService

Universal details window accessible from all modules:

// Show details from any module
window.TerritoryDetailsService.showDetails(territoryId);

// Available from: territory list, token management, map, deals

🎯 14-Stage Status System

Category Status Description
1Initial AppraisalNew territory submitted
2Awaiting PaymentInvoice generated
3Payment VerificationPayment submitted
4Under Technical ExpertisePayment confirmed
5Active Expert AppraisalExpert engaged
6Pending Expertise ConfirmationExpert completed
7Under VVB ValidationSent to VVB
8Ready for Credit IssuanceVVB completed
9Issuance-Ready (Active)Can create project ✅
10Active Carbon ProjectHas tokens 🪙
11Renewal RequiredExpiring soon
12RejectedFailed verification
13InactiveDeactivated
14Territory ModifiedSplit/Merge/Extend

📡 REST API Endpoints

Public Endpoints (No Auth):

GET  /projects              - List all carbon projects
GET  /projects/{id}         - Get project details

Admin Endpoints (JWT Required):

POST /admin/login           - Admin authentication
GET  /admin/validate         - Validate JWT session
GET  /admin/projects         - Admin project list
POST /admin/projects         - Create new project
PUT  /admin/projects/{id}    - Update project
DELETE /admin/projects/{id}  - Delete project
GET  /admin/transactions     - View all transactions
GET  /admin/project-types    - List project types

🔐 Security & Best Practices

Critical Rules:

  • No browser storage (AWS multi-workstation)
  • All config in config.js only
  • Real data or nothing
  • Fail visibly for debugging

Security Mechanisms:

📞 Developer Resources

Documentation:

Support:

📧 Email: info@carboncore.earth
📧 Technical: dev@carboncore.earth
💬 Discord: Join developer community