A verified, decentralized carbon credit marketplace enabling carbon offset projects to mint tokenized RWAs on Soroban, with corporations purchasing and permanently retiring credits for carbon offset claims.
Tokenize, trade, and retire carbon credits with absolute provenance on Stellar.
- Architecture: See docs/ARCHITECTURE.md
- Smart Contracts: See contracts/README.md
- Backend API: See backend/README.md
- Frontend: See frontend/README.md
carbonledger-bounty/
├── contracts/ # Soroban smart contracts (Rust)
│ ├── Cargo.toml
│ ├── carbon_registry/ # Project registry & verification
│ ├── carbon_credit/ # Credit minting & retirement
│ ├── carbon_marketplace/ # Secondary trading
│ └── carbon_oracle/ # Satellite monitoring & price feeds
├── backend/ # NestJS API server
│ ├── package.json
│ ├── prisma/
│ │ └── schema.prisma # Database models
│ └── src/
│ ├── auth/ # JWT + wallet auth
│ ├── projects/ # Project registration
│ ├── credits/ # Batch minting & retirement
│ ├── marketplace/ # Listing management
│ ├── retirements/ # Retirement history
│ ├── oracle/ # Monitoring updates
│ └── stats/ # Platform metrics
├── frontend/ # Next.js 15 application
│ ├── package.json
│ ├── app/
│ │ ├── page.tsx # Landing & explorer
│ │ ├── projects/ # Projects directory
│ │ ├── marketplace/ # Trading interface
│ │ ├── buy/ # Purchase flow
│ │ ├── retire/ # Retirement UI
│ │ ├── audit/ # Public audit trail
│ │ ├── dashboard/ # User dashboard
│ │ └── verify/ # Verifier workspace
│ ├── components/ # Reusable UI components
│ ├── lib/ # Utilities (Freighter, Soroban, API)
│ └── styles/ # Design system
├── docs/ # Documentation
│ ├── ARCHITECTURE.md
│ ├── DEPLOYMENT.md
│ └── API.md
└── scripts/ # Build & deployment helpers
- Project Registration: Carbon developers register projects after third-party verification (Verra, Gold Standard)
- Credit Minting: Projects mint tokenized carbon credits with unique serial numbers (prevents double-counting)
- Marketplace Trading: Corporations and investors buy credits using USDC; prices determined by methodology + vintage year
- Irreversible Retirement: Credits permanently burned to claim carbon offsets; immutable on-chain record prevents re-selling
- Provenance Trail: Full audit history from mint → transfer → retirement with satellite-verified monitoring data
- Oracle Integration: Monitoring data from satellite sources validates credit claims; prices benchmarked against real-world carbon markets
- No Double-Counting: Serial number registry on-chain prevents same credit from being issued twice
- Permanent Retirement: Retirement is cryptographically irreversible; retired credits cannot be transferred or un-retired
- Verified Projects: Only third-party verifiers can approve projects; monitoring data refreshed annually
- Full Transparency: Public audit explorer shows every mint, trade, and retirement event
- Node.js 18+ (backend & frontend)
- Rust & Cargo (smart contracts)
- PostgreSQL 14+ (database)
- Freighter wallet (browser extension)
# Clone the repository
git clone https://github.com/Carbon-Ledger-stellar/carbonledger-bounty.git
cd carbonledger-bounty
# Setup environment
cp .env.example .env
# Edit .env with your keys and network settings
# 1. Deploy smart contracts to testnet
cd contracts
cargo install stellar-cli
stellar contract build
stellar contract deploy --network testnet # (generates contract IDs)
# Update .env with contract addresses
# 2. Start backend
cd ../backend
npm install
npx prisma migrate deploy
npm run dev # Runs on http://localhost:3001
# 3. Start frontend
cd ../frontend
npm install
npm run dev # Runs on http://localhost:3000See docs/DEPLOYMENT.md for production deployment to Stellar testnet/mainnet.
| Contract | Purpose | Key Functions |
|---|---|---|
carbon_registry |
Project registration & verification | register_project(), verify_project(), get_project() |
carbon_credit |
Mint, track, retire credits | mint_credits(), retire_credits(), get_retirement_history() |
carbon_marketplace |
List, buy, sell credits | list_credits(), purchase_credits(), bulk_purchase() |
carbon_oracle |
Monitoring data & price feeds | submit_monitoring(), get_credit_price() |
GET /api/v1/projects— Browse all projectsPOST /api/v1/projects/register— Register new project (developer only)PUT /api/v1/projects/:id/verify— Verify project (verifier only)
GET /api/v1/marketplace/listings— Browse marketplacePOST /api/v1/marketplace/purchase— Buy creditsGET /api/v1/credits/batch/:id— Get batch infoPOST /api/v1/credits/retire— Retire credits (irreversible)GET /api/v1/credits/serial/:serial— Lookup by serial number
GET /api/v1/retirements— Retirement historyGET /api/v1/retirements/:id— Get retirement certificateGET /api/v1/stats/platform— Platform metrics
POST /api/v1/oracle/monitoring— Submit satellite data (verifier only)GET /api/v1/oracle/status/:projectId— Monitoring freshness
- Emerald/green accent colors (carbon theme)
- Charcoal backgrounds with frosted glass panels
- Real-time transaction status tracking
- Responsive grid layouts for mobile/desktop
Project Developer:
- Register project (name, location, methodology, vintage year)
- Await third-party verification
- Mint credit batch (automatically gets serial numbers)
- Option: List on marketplace or hold for retirement claims
Corporate Buyer:
- Browse marketplace by methodology/vintage/price
- Purchase credits using USDC (Freighter wallet)
- Option: Trade on marketplace or retire immediately
- Generate shareable retirement certificate with beneficiary name & QR code
Public Auditor:
- Search any serial number → trace mint → retirement
- Verify monitoring data freshness (satellite imagery links)
- Export audit report (CSV)
@nestjs/core(framework)@prisma/client(ORM)@stellar/stellar-sdk(Stellar integration)jsonwebtoken(JWT auth)
next(framework)@stellar/freighter-api(wallet)@stellar/stellar-sdk(Stellar SDK)swr(data fetching)jspdf+html2canvas(PDF generation)
soroban-sdk(latest stable)
- Serial Number Uniqueness: Enforced on-chain; overlap detection prevents double-counting
- Irreversible Retirement: Retirement state is cryptographically immutable
- JWT Auth: Backend uses RS256 signatures (Stellar keypair validation)
- Role-Based Access: Developers can only mint from their projects; verifiers can only approve assigned projects
- Audit Trail: All state transitions logged to PostgreSQL + on-chain storage
- Contracts: Add functions to
/contracts/carbon_*/src/lib.rs; update types in types module - Backend: Add endpoint in
/backend/src/*/controller.ts; logic in service; update Prisma schema if needed - Frontend: Add page or component; integrate via
/lib/api.tsusing SWR
# Smart contracts
cd contracts
cargo test
# Backend
cd ../backend
npm run test
# Frontend
cd ../frontend
npm run testThis is a reference implementation for the Stellar Community Challenge. Contributions welcome! See CONTRIBUTING.md for guidelines.
MIT
Built with ❤️ on Stellar.