Track, verify, and prove your environmental commitment using Zero-Knowledge Proofs on Moca Network
GreenID is a decentralized identity system for environmental impact verification. Users can:
- ๐ Track carbon footprint: Annual COโ emissions, renewable energy usage, travel impact
- ๐ Generate Green Scores: Algorithm-based environmental rating (0-100)
- ๐ Issue on-chain credentials: Verifiable proof stored on Moca Network blockchain
- โ Verify with Zero-Knowledge Proofs: Prove compliance without exposing sensitive data
Real-world use case: Organizations can prove environmental commitments (e.g., "Our average Green Score > 70") to partners, investors, or regulators without revealing individual employee data.
- Main App: https://greenid.coinsspor.com
- Admin Panel: https://greenid.coinsspor.com/admin
Demo credentials: Use AIR Kit login (no setup required)
- Input annual COโ emissions (kg)
- Track renewable energy usage (%)
- Monitor travel-related emissions
- Real-time Green Score calculation with visual indicators
- Issue verifiable credentials via AIR Kit SDK
- Immutable blockchain storage on Moca Network
- Portable identity: Use credentials across platforms
- No seed phrases: AIR Kit manages Abstract Accounts
- Privacy-first: Prove statements without revealing exact data
- Example: Verify "Green Score > 70" without showing score = 86
- Compliance checks: โ Compliant / โ Non-Compliant
- On-chain verification: Trustless and transparent
- Live statistics: Total credentials, verifications, average score
- Activity monitoring: Recent issuance and verification events
- Auto-refresh: Updates every 5 seconds
- System health: Backend status, AIR Kit connection, ZK proof availability
- React 18 with TypeScript
- Vite (Lightning-fast build tool)
- AIR Kit SDK (@mocanetwork/airkit)
- React Router (Multi-page navigation)
- Lucide React (Beautiful icons)
- Modern CSS with animations and glass morphism
- Node.js 20 + Express.js
- JWT Authentication (RS256 signing)
- JWKS endpoint for public key distribution
- RESTful API design
- CORS enabled for cross-origin requests
- Moca Network (Sandbox environment)
- AIR Kit SDK for credential management
- Abstract Accounts for seamless user experience
- Zero-Knowledge Proofs for privacy-preserving verification
Node.js >= 18.x
npm >= 9.x# Navigate to server directory
cd server
# Install dependencies
npm install
# Generate RSA key pair (if not exists)
openssl genpkey -algorithm RSA -out private.key -pkeyopt rsa_keygen_bits:2048
openssl rsa -pubout -in private.key -out public.key
# Create .env file
cat > .env << 'EOF'
PORT=8787
HOST=127.0.0.1
PARTNER_ID=your-partner-id-here
PRIVATE_KEY_PATH=./private.key
PUBLIC_KEY_PATH=./public.key
EOF
# Start server
node index.jsBackend will start on: http://127.0.0.1:8787
# Navigate to frontend directory
cd frontend
# Install dependencies
npm install
# Update vite.config.ts with your domain (if deploying)
# For local development, default settings work
# Start development server
npm run devFrontend will start on: http://localhost:5173
# Build frontend
cd frontend
npm run build
# Serve with PM2 (recommended)
pm2 start npm --name "greenid-frontend" -- run dev
# Or use serve
npx serve dist -l 5173| Method | Endpoint | Description | Auth Required |
|---|---|---|---|
| GET | /health |
Health check | No |
| GET | /api/stats |
System statistics | No |
| GET | /api/demo-users |
Demo user profiles | No |
| POST | /auth/partner-jwt |
Generate partner JWT | No |
| GET | /.well-known/jwks.json |
Public keys (JWKS) | No |
Request:
curl http://localhost:8787/api/statsResponse:
{
"totalCredentials": 10,
"totalVerifications": 7,
"averageScore": 78,
"totalCO2Tracked": 45000,
"recentActivity": [
{
"timestamp": "2025-10-11T13:19:38.171Z",
"type": "verify"
},
{
"timestamp": "2025-10-11T13:18:02.178Z",
"type": "issue",
"score": 86,
"co2": 2000
}
]
}Request:
curl -X POST http://localhost:8787/auth/partner-jwt \
-H "Content-Type: application/json" \
-d '{"scope":"issue"}'Response:
{
"token": "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6ImdyZWVuaWQta2V5LTEifQ..."
}- Visit https://greenid.coinsspor.com
- Click "Login with AIR"
- AIR Kit modal opens automatically
- Complete authentication (email/social)
- Abstract Account created (no seed phrase needed!)
- Annual COโ Emissions: Total yearly carbon output in kg
- Renewable Energy Usage: Percentage of energy from renewable sources
- Travel Emissions: Carbon from transportation in kg
Or use Quick Demo profiles:
- ๐ Eco Warrior (Score: 95) - Low emissions, high renewables
- ๐ฅ Green Commuter (Score: 75) - Moderate emissions, good renewables
- ๐ฅ Average Joe (Score: 50) - Average emissions, low renewables
- Click "Calculate Green Score"
- Algorithm processes inputs
- Score displayed with color coding:
- ๐ข 80-100: Excellent
- ๐ก 60-79: Good
- ๐ 40-59: Fair
- ๐ด 0-39: Needs Improvement
- Click "Issue Green Credential"
- AIR Kit modal shows credential details
- Confirm to write to blockchain
- Success animation displays
- Credential now stored on Moca Network!
- Click "Verify My Credential"
- AIR Kit generates Zero-Knowledge Proof
- System checks compliance (e.g., "Score > 70")
- Result: โ Compliant or โ Non-Compliant
- Verification logged in admin panel
Abstract Account Management:
- Users get blockchain wallets without managing private keys
- No seed phrases or complex setup
- Email/social login via AIR Kit
Credential Issuance:
- Green Scores stored as verifiable credentials on Moca blockchain
- Immutable and tamper-proof
- Portable across platforms
JWKS Authentication:
- Backend uses public/private key pairs
- Partners authenticate via JWT tokens
- Public keys published at
/.well-known/jwks.json
Privacy-Preserving Verification:
Traditional: "My Green Score is 86" โ (reveals exact data)
With ZK Proof: "My Green Score > 70" โ
(proves statement without revealing exact value)
Use Cases:
- Corporate ESG reporting without exposing individual data
- Regulatory compliance checks
- Partner qualification verification
- Privacy-first carbon credit markets
Why Moca Network?
- โ Developer-friendly AIR Kit SDK
- โ Built-in ZK proof capabilities
- โ Sandbox for testing
- โ Production-ready infrastructure
- โ Excellent documentation
Access: https://greenid.coinsspor.com/admin
-
๐ Real-Time Stats Cards:
- Total credentials issued
- Total verifications completed
- Average Green Score across users
- Total COโ tracked (in tons)
-
๐ Activity Log:
- Recent credential issuances
- Recent verifications
- Timestamps and scores
- Color-coded by type
-
๐ Auto-Refresh:
- Updates every 5 seconds
- Toggle on/off
- Manual refresh button
-
โ System Health:
- Backend status
- AIR Kit connection
- Blockchain network (Moca Sandbox)
- Zero-Knowledge Proof availability
| Profile | Green Score | Annual COโ | Renewable Energy | Travel Emissions | Badge |
|---|---|---|---|---|---|
| ๐ Eco Warrior | 95 | 2,000 kg | 90% | 500 kg | Platinum |
| ๐ฅ Green Commuter | 75 | 4,000 kg | 60% | 1,200 kg | Gold |
| ๐ฅ Average Joe | 50 | 8,000 kg | 20% | 2,500 kg | Silver |
Try them: Click demo pills on main app to auto-fill data!
- ๐ Animated star background for cosmic environmental theme
- โจ Glass morphism UI with backdrop blur effects
- ๐ Glow effects on interactive elements
- ๐ Animated progress bars and score displays
- ๐ญ Smooth transitions and fade-in animations
- ๐ฏ Color-coded scoring for instant visual feedback
- ๐ฑ Responsive design (desktop optimized)
# Install PM2 globally
npm install -g pm2
# Start backend
cd server
pm2 start index.js --name "greenid-backend"
# Start frontend
cd ../frontend
pm2 start npm --name "greenid-frontend" -- run dev
# Save configuration
pm2 save
# Setup auto-start on system boot
pm2 startup# Create service file
sudo nano /etc/systemd/system/greenid-backend.service
# Add configuration (see server/README for full config)
# Enable and start
sudo systemctl enable greenid-backend
sudo systemctl start greenid-backendDocker support planned for future releases.
- โ Private keys never exposed in frontend
- โ CORS configured properly
- โ JWT tokens with expiration
- โ Environment variables for secrets
- โ HTTPS recommended for production
- ๐ Never commit
.envfiles - ๐ Never commit
private.keyfiles - ๐ Rotate keys periodically
- ๐ Use HTTPS in production
- ๐ Validate all inputs
# Check if port is in use
lsof -i :8787
# Check logs
pm2 logs greenid-backend# Clear cache and reinstall
rm -rf node_modules package-lock.json
npm install- Check browser console for errors
- Ensure
BUILD_ENV.SANDBOXis set correctly - Verify network connection
- Check backend is running:
curl http://localhost:8787/health - Verify AIR Kit initialization
- Check browser console for errors
This project was built for the Moca Network Proof of Build Buildathon.
Future improvements:
- Docker containerization
- Multi-language support
- Mobile responsive design
- More verification rules
- Historical tracking
- Carbon offset marketplace integration
MIT License - See LICENSE file for details
- Moca Network for the AIR Kit SDK and blockchain infrastructure
- Proof of Build Buildathon for the opportunity
- Open source community for amazing tools and libraries
- Live Demo: https://greenid.coinsspor.com
- Admin Panel: https://greenid.coinsspor.com/admin
Built with ๐ for a sustainable future