Skip to content
Trunal2005Public

About

🌊 Decentralized Blue Carbon Credit Issuance, Verification & Trading Platform (ERC-1155)

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

Β 

History

9 Commits

Folders and files

Repository files navigation

BlueCred 🌊🌱

Decentralized Blue Carbon Credit Registry, Issuance & Retirement Protocol
Tokenizing high-impact coastal ecosystem conservation (Mangroves, Seagrass & Salt Marshes) on EVM Blockchains.

Next.js Solidity Polygon Amoy Ethereum Sepolia Appwrite Tailwind CSS License: MIT


πŸ“Œ Protocol Overview

BlueCred is an end-to-end decentralized environmental finance protocol engineered to tokenize, verify, and trade Blue Carbon credits. Coastal marine ecosystemsβ€”mangroves, tidal marshes, and seagrass meadowsβ€”sequester carbon up to 10 times faster than mature tropical forests and store it for millennia.

Traditional voluntary carbon markets face chronic challenges:

  • ⚠️ Double Counting: The same credit sold across multiple registries.
  • ⚠️ Lack of MRV Transparency: Opaque measurement, reporting, and verification protocols.
  • ⚠️ Broker Friction: High intermediary margins eroding capital flowing to local coastal communities.

BlueCred resolves these structural bottlenecks by anchoring project provenance, acreage GIS data, and carbon credit tokens directly on-chain as ERC-1155 multi-tokens, combining verifiable decentralized settlement with real-time geospatial tracking and cloud metadata storage.


πŸ–₯️ Platform Interface & Live Application

🏠 Decentralized Registry Homepage

Interactive gateway for project developers, verifiers, and institutional carbon credit buyers with Web3 wallet connectivity and role selection.

BlueCred Decentralized Registry Homepage

πŸ›’ Liquid Carbon Credit Marketplace

Instant on-chain purchasing and trading of verified blue carbon tokens (BCT) with transparent pricing, available supply, and ecosystem filters.

BlueCred Marketplace

πŸ” Expand to View Additional Modules (Impact Analytics & Supplier Onboarding)

πŸ“Š Real-Time Impact & Carbon Offset Analytics

Tracking aggregate carbon credits issued, verified conservation acreage, and historical issuance trends rendered via Chart.js.

BlueCred Impact Dashboard

πŸ“ Conservation Project Submission Wizard

Multi-step onboarding form for conservationists to register projects, input GIS coordinates, submit MRV documentation, and calculate potential carbon sequestration.

BlueCred Project Submission Wizard


🌿 Blue Carbon Asset Classes

BlueCred specializes in tokenizing the three primary coastal blue carbon ecosystems:

Mangrove Forests Seagrass Meadows Tidal Salt Marshes
Mangrove Ecosystem Seagrass Ecosystem Saltmarsh Ecosystem
High-Density Carbon Sequestration
Dense root systems sequestering up to 1,000 tonnes of carbon per hectare in underwater sediment.
Marine Biodiversity Hotspots
Extensive seabed nurseries preventing ocean acidification and trapping organic carbon for centuries.
Coastal Defense & Buffer
Tidal wetlands buffering shorelines against storm surges with continuous peat sediment storage.

πŸ›οΈ System Architecture

flowchart TD
    subgraph STAKEHOLDERS["πŸ‘₯ Protocol Stakeholders"]
        P["🌱 Project Proponents<br>(Conservationists)"]
        V["πŸ›‘οΈ Independent Verifiers<br>(Certifying Authorities)"]
        B["🏒 Corporate Buyers<br>(ESG & Institutional)"]
        A["πŸ” Public Auditors<br>(Transparency Observers)"]
    end

    subgraph CLIENT["πŸ’» Application Layer (Next.js 15)"]
        UI["Web3 DApp Interface"]
        MAP["GIS Geospatial Mapping<br>(Leaflet / OpenStreetMap)"]
        WALLET["Wallet Connect<br>(RainbowKit / Wagmi v2)"]
        CERT["Cryptographic Certificate Generator<br>(jsPDF / html2canvas)"]
        CHARTS["Impact & Analytics Engine<br>(Chart.js)"]
    end

    subgraph BACKEND["☁️ Metadata & Storage Layer (Appwrite Cloud)"]
        AUTH["Role-Based Authentication"]
        DB_PROJ["Projects Database<br>(GIS, Acreage, MRV Docs)"]
        DB_TX["Transaction Ledger<br>(Purchase Logs, Burn Proofs)"]
        BUCKET["Decentralized Storage Bucket<br>(Satellite Imagery, Field Audits)"]
    end

    subgraph BLOCKCHAIN["⛓️ EVM Settlement Layer (Polygon / Sepolia)"]
        SC["BlueCred ERC-1155 Contract<br>(BlueCred.sol)"]
        MINT["mint(address, uint256, uint256)"]
        BURN["burn(address, uint256, uint256)"]
        EXPLORER["On-Chain Verification<br>(PolygonScan / Etherscan)"]
    end

    P -->|1. Submit Project & Coordinates| UI
    UI -->|Persist Metadata & Documents| BACKEND
    V -->|2. Audit MRV & Approve| UI
    UI -->|3. Trigger Token Minting| SC
    SC -->|Mint ERC-1155 Credits| MINT
    B -->|4. Purchase Credits via Web3| WALLET
    WALLET -->|Settle Order| SC
    B -->|5. Retire & Burn Credits| BURN
    BURN -->|Immutable Proof| EXPLORER
    BURN -->|6. Generate Verifiable Certificate| CERT
    A -->|Monitor Global Sequestration| CHARTS
Loading

πŸ”„ Carbon Credit Lifecycle Workflow

flowchart LR
    A["πŸ“ 1. Submission"] --> B["πŸ”Ž 2. MRV Audit"]
    B --> C["⚑ 3. On-Chain Mint"]
    C --> D["πŸ›’ 4. Marketplace"]
    D --> E["πŸ’Ό 5. Acquisition"]
    E --> F["πŸ”₯ 6. Retirement & Burn"]
    F --> G["πŸ“œ 7. Verifiable Certificate"]

    classDef step fill:#0f172a,stroke:#38bdf8,stroke-width:2px,color:#f8fafc;
    class A,B,C,D,E,F,G step;
Loading
  1. Submission: Project developers pin coastal coordinates, upload satellite evidence, and submit estimated CO2 tonnage.
  2. MRV Verification: Environmental auditors review scientific documentation, confirm non-encroachment, and approve project metrics.
  3. On-Chain Tokenization: The smart contract mints ERC-1155 tokens directly to the verified project repository.
  4. Marketplace Listing: Credits are listed with transparent pricing, provenance history, and verified status.
  5. Corporate Acquisition: Institutional buyers acquire credits directly using Web3 wallets without broker cuts.
  6. Retirement / Burn: When offsetting emissions, credits are permanently burned on-chain to prevent secondary circulation.
  7. Certificate Generation: A tamper-evident cryptographic retirement certificate is generated with transaction hashes for ESG audits.

⚑ Core Capabilities

πŸ›’ 1. Decentralized Marketplace & Project Registry

Browse and filter verified blue carbon assets by ecosystem type (Mangrove, Saltmarsh, Seagrass), acreage, country, and price. Direct wallet interaction ensures peer-to-peer settlement without middleman risk.

πŸ›‘οΈ 2. Verifier & Governance Portal

A gated administrative panel for accredited verifiers and environmental authorities to review project documentation, inspect satellite polygon boundaries, and authorize on-chain credit issuance.

πŸ—ΊοΈ 3. Geospatial Mapping & GIS Tracking

Interactive Leaflet and OpenStreetMap integration allowing stakeholders to inspect coastal project coordinates, geographic boundaries, and project densities globally.

πŸ”₯ 4. Cryptographic Retirement & PDF Certificates

Retire carbon credits on-chain with automatic burn execution. Generates an institutional-grade PDF offset certificate featuring:

  • Unique Verification Token & Certificate ID
  • On-chain transaction hash link to block explorer
  • Timestamped retirement declaration and offset breakdown

πŸ“Š 5. Corporate Portfolio & Global Impact Analytics

Comprehensive buyer dashboards tracking cumulative holdings, active credits, historical retirements, and ecosystem contribution metrics rendered via Chart.js.


⛓️ Smart Contract Specifications

The core protocol smart contract (BlueCred.sol) is built using OpenZeppelin ERC-1155:

Attribute Specification
Standard ERC-1155 Multi-Token Standard
Compiler Solidity 0.8.28
Network Deployments Polygon Amoy Testnet & Ethereum Sepolia
Primary Functions mint(to, id, amount, data) Β· burn(from, id, amount) Β· uri(id)
Contract Artifact contracts/BlueCred.sol

Verified Deployments

Network Contract Address Block Explorer
Polygon Amoy 0x920149b1e18f8d524ea443802e08837a955595c0 View on PolygonScan
Ethereum Sepolia 0x8599207114b98e239136aa6174e245409b77c5fd View on Etherscan

πŸ“ Repository Structure

.
β”œβ”€β”€ assets/                     # Protocol imagery, diagrams & screenshots
β”‚   β”œβ”€β”€ ecosystems/             # High-resolution coastal habitat media
β”‚   └── screenshots/            # Live application interface captures
β”œβ”€β”€ contracts/                  # Solidity smart contracts
β”‚   └── BlueCred.sol            # Core ERC-1155 token contract
β”œβ”€β”€ docs/                       # Engineering & architecture specifications
β”‚   β”œβ”€β”€ backend-setup.md        # Hardhat & Appwrite configuration
β”‚   β”œβ”€β”€ frontend-setup.md       # Client application build guide
β”‚   └── local-setup.md          # End-to-end integration manual
β”œβ”€β”€ frontend/                   # Next.js 15 web client & dApp
β”‚   β”œβ”€β”€ src/app/                # App Router pages & API routes
β”‚   β”‚   β”œβ”€β”€ admin/              # Verifier & administrative portal
β”‚   β”‚   β”œβ”€β”€ certificate/        # Certificate viewer & PDF export
β”‚   β”‚   β”œβ”€β”€ company/            # Corporate portfolio & purchases
β”‚   β”‚   β”œβ”€β”€ impact/             # Global impact & statistics
β”‚   β”‚   β”œβ”€β”€ marketplace/        # Liquid carbon credit exchange
β”‚   β”‚   β”œβ”€β”€ projects/           # Project registry & detail views
β”‚   β”‚   └── submit/             # Project onboarding & GIS wizard
β”‚   β”œβ”€β”€ src/lib/                # Web3, Wagmi, Viem & Appwrite clients
β”‚   └── src/scripts/            # Database initialization scripts
β”œβ”€β”€ scripts/                    # Deployment & migration scripts
β”‚   └── deploy.js               # Contract deployment automation
└── hardhat.config.ts           # Hardhat Viem configuration

βš™οΈ Installation & Development Setup

1. Prerequisites

  • Node.js: v18.x or v20.x LTS
  • npm or pnpm
  • MetaMask or compatible Web3 wallet configured for Sepolia or Polygon Amoy

2. Clone the Repository

git clone https://github.com/Trunal2005/Blue-Cred.git
cd Blue-Cred

3. Install Dependencies

# Install root (smart contract & tooling) dependencies
npm install

# Install frontend dependencies
cd frontend
npm install
cd ..

4. Configure Environment Variables

Root directory (.env):

cp .env.example .env
PRIVATE_KEY=your_deployer_wallet_private_key
SEPOLIA_RPC_URL=https://eth-sepolia.g.alchemy.com/v2/your_key
POLYGON_AMOY_RPC_URL=https://rpc-amoy.polygon.technology/

Frontend directory (frontend/.env.local):

cd frontend
cp .env.example .env.local
NEXT_PUBLIC_APPWRITE_ENDPOINT=https://sgp.cloud.appwrite.io/v1
NEXT_PUBLIC_APPWRITE_PROJECT_ID=your_project_id
APPWRITE_API_KEY=your_admin_api_key
NEXT_PUBLIC_APPWRITE_DATABASE_ID=bluecred-db
NEXT_PUBLIC_APPWRITE_PROJECTS_COLLECTION_ID=projects
NEXT_PUBLIC_APPWRITE_TRANSACTIONS_COLLECTION_ID=transactions
NEXT_PUBLIC_APPWRITE_BUCKET_ID=project-images
NEXT_PUBLIC_SEPOLIA_RPC_URL=https://eth-sepolia.g.alchemy.com/v2/your_key
NEXT_PUBLIC_WALLETCONNECT_PROJECT_ID=your_walletconnect_id

5. Smart Contract Compilation & Deployment

# Compile contracts
npx hardhat compile

# Deploy to target network
npx hardhat run scripts/deploy.js --network sepolia

6. Initialize Appwrite Database

Provision collections, attributes, and file storage buckets automatically:

cd frontend
node src/scripts/init-appwrite.js

7. Run the Application

cd frontend

# Development server
npm run dev

# Production build & run
npm run build
npm run start

πŸ›‘οΈ Security & Best Practices

  • Zero Secret Commits: Private keys and sensitive API tokens are decoupled via .env and strictly guarded by .gitignore.
  • Decentralized Verification: No single entity can unilaterally mint or retire credits without on-chain cryptographic signatures.
  • Audit Provenance: Every credit minted traces back to verified geographic coordinates and timestamped MRV audits.

πŸ“„ License

This project is licensed under the MIT License. See the LICENSE file for details. Source code remains MIT; derived satellite-data figures/screenshots require the CC BY 4.0 attribution documented in the dataset card.

Local CNN training and validation (6 November 2026)

The existing submission workflow now runs genuine local PyTorch inference from ml/artifacts/run1/best.pt. Training used 144 real GMW/WorldCover 2020 reference pairs across disjoint sites (96 train / 24 validation / 24 test), completed 7 epochs and selected epoch 1. Model quality is limited: held-out IoU 0.292, below fixed NDVI 0.321, with substantial false positives. It is not a validated mangrove-area, carbon or certification system.

Next.js migrated to the supported 15.5.29 security release while preserving React 18. The npm audit has zero critical advisories, but high/moderate/low issues and unknown deployed Appwrite permissions remain. Real Chrome tests verify local CNN upload/overlay and service failure behavior; external account/record/tile interactions use explicit fixtures, not production validation. Marketplace listings remain disclosed demonstrations, and blockchain writes default to disabled.

See final validation, technical audit, browser performance report, training guide, integration/startup guide, and zero-cost report. These verified reports qualify earlier architectural/security claims in this README. Additional spend remains β‚Ή0; no billable resources, production deployment, transactions or GitHub push were introduced.

About

🌊 Decentralized Blue Carbon Credit Issuance, Verification & Trading Platform (ERC-1155)

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages