Transparent • Verifiable • Fraud-Resistant
This project implements an end-to-end registry for Green Hydrogen (H₂) credits.
It ensures that every kilogram of H₂ produced from renewable energy is:
- ✅ Measured by trusted IoT sensors
- ✅ Signed with cryptographic proofs
- ✅ Minted into digital credits
- ✅ Transferred / Retired with owner signatures
- ✅ Anchored into immutable blockchain blocks with Merkle roots
- ✅ Auditable via Sparse Merkle Tree proofs & optional on-chain anchoring
- 🔑 Ed25519 signatures for all events, transfers, and retirements
- ⏱️ Non-overlapping production windows (prevents double counting)
- 📎 Evidence uploads (CSV/logs tied to events via SHA-256)
- 📦 Block closing → Merkle root over all transactions
- 🌳 State root proofs (Sparse Merkle Tree for balances)
- 🛒 Marketplace to list/buy credits
- 📊 Reports: retirement feed for compliance & ESG audits
app.py→ Flask server exposing all API endpointsapi_tester.py→ Original E2E tester (phase 1/2/3)showcase_cli.py→ Judge-friendly CLI (step-by-step with clear prints)api_tester_pretty.py→ Optional verbose tester (compact JSON previews)
├─ .env
├─ .env.example
├─ CreditAnchor.abi.json
├─ README.md
├─ anchor_block.py
├─ anchor_data.md
├─ anchor_deploy.py
├─ anchor_verifier.py
├─ api_tester.py
├─ app.py
├─ client_phase1.py
├─ evidence/
│ ├─ … evidence CSV files
├─ phase1_full_report.md
├─ phase2/
│ ├─ smt_state.py
│ ├─ proof_state_account.py
│ └─ tester_phase2_state.py
├─ phase3/
│ ├─ market_demo.py
│ └─ test_market.py
├─ showcase_cli.py
├─ transaction_verify.py
└─ utils.py
# 1. Clone the repo
git clone https://github.com/realmCode/hackout.git
cd hackout
# 2. Install dependencies
pip install -r requirements.txt
# 3. Start the server
python app.py- Python 3.9+
- Libraries:
flask,requests,cryptography,python-dotenv - Optional:
web3(if anchoring to Ethereum)
python showcase_cli.py --base http://127.0.0.1:5000- Produces step-by-step banners (easy to follow live)
- Preserves exact signature flow from
api_tester.py
python api_tester.py --base http://127.0.0.1:5000- Full verification including on-chain anchor (if RPC/contract provided)
GET /api/v1/health→ Server healthPOST /api/v1/accounts→ Create account (producer/buyer/verifier)POST /api/v1/sensors→ Register sensorPOST /api/v1/evidence/upload→ Upload run evidencePOST /api/v1/events→ Submit signed eventPOST /api/v1/credits/mint→ Mint creditsPOST /api/v1/credits/transfer→ Owner-signed transferPOST /api/v1/credits/retire→ Owner-signed retirePOST /api/v1/blocks/close→ Close block → Merkle rootGET /api/v1/blocks/latest→ Inspect latest blockGET /api/v2/state/root→ Global state root (SMT)GET /api/v2/state/proof/<id>→ Account proofPOST /api/v1/market/offers→ List creditsPOST /api/v1/market/buy→ Buy creditsGET /api/v1/reports/retirements→ Retirement report
- Sensor signs event → ensures tamper-proof production data
- Evidence uploaded → hash bound to event
- Server verifies signature + overlap window
- Mint credits → digital units of Green H₂
- Close block → credits activated under Merkle root
- Transfers / Retires → owner-signed, immutable record
- Sparse Merkle proofs → balances independently verifiable
- Marketplace → trade credits fairly
- Reports → regulators/auditors can confirm claims
- ⚡ Faster, more transparent distribution of public funds
- 🛡️ Reduces risk of fraud and misappropriation
- 🌍 Increases uptake of green hydrogen projects via clear value & traceability
Copyright (c) 2025 Nandish Chauhan (realmCode)
All rights reserved.
Permission is hereby granted to view this repository and its source code
for educational and reference purposes only.
Commercial use, redistribution, modification, or creation of derivative works
is strictly prohibited without explicit written permission from the author.
For licensing inquiries, please contact: 202451040@iiitvadodara.ac.in.
👉 Front End It's buggy.