{"id":27910597,"url":"https://github.com/romanian-solana-developer-program-c3/greengait","last_synced_at":"2026-05-09T04:31:15.245Z","repository":{"id":291604809,"uuid":"975632437","full_name":"Romanian-Solana-Developer-Program-C3/GreenGait","owner":"Romanian-Solana-Developer-Program-C3","description":"🍃GreenGait is a Web3-powered rewards platform that transforms your physical movement into digital value. By wearing a smart shoe device, each step you take is securely recorded and converted into blockchain-based tokens, enabling you to earn as you walk — one step at a time.🍃","archived":false,"fork":false,"pushed_at":"2025-05-05T15:25:15.000Z","size":67,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-05T16:27:32.813Z","etag":null,"topics":["anchor-framework","eco-friendly","green-energy","green-tech","health","iot","rust","smart-contracts","smart-shoes","solana","sustainability","wearable-devices","web3"],"latest_commit_sha":null,"homepage":"https://arena.colosseum.org/hackathon/project","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Romanian-Solana-Developer-Program-C3.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-04-30T16:26:01.000Z","updated_at":"2025-05-05T15:25:18.000Z","dependencies_parsed_at":"2025-05-05T16:37:50.592Z","dependency_job_id":null,"html_url":"https://github.com/Romanian-Solana-Developer-Program-C3/GreenGait","commit_stats":null,"previous_names":["romanian-solana-developer-program-c3/greengait"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Romanian-Solana-Developer-Program-C3%2FGreenGait","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Romanian-Solana-Developer-Program-C3%2FGreenGait/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Romanian-Solana-Developer-Program-C3%2FGreenGait/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Romanian-Solana-Developer-Program-C3%2FGreenGait/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Romanian-Solana-Developer-Program-C3","download_url":"https://codeload.github.com/Romanian-Solana-Developer-Program-C3/GreenGait/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252659232,"owners_count":21784166,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["anchor-framework","eco-friendly","green-energy","green-tech","health","iot","rust","smart-contracts","smart-shoes","solana","sustainability","wearable-devices","web3"],"created_at":"2025-05-06T09:44:25.222Z","updated_at":"2026-05-09T04:31:15.239Z","avatar_url":"https://github.com/Romanian-Solana-Developer-Program-C3.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🍃 GreenGait 🍃\n\n**GreenGait** is a Web3 rewards platform that transforms physical activity into real digital value using the Solana blockchain. With a secure, Wi-Fi-enabled wearable device (ESP32), every step you take is cryptographically signed and submitted to the blockchain – all in real time.\n🏃 + ✅ → 💰 on-chain.\n\n---\n\n## Table of Contents 📁\n\n1. [**Architecture Overview**](#-architecture-overview)\n2. [**Features Implemented**](#-features-implemented)\n3. [**Security Architecture**](#-security-architecture)\n4. [**Project Structure**](#-project-structure)\n5. [**Example Flow**](#-example-flow)\n6. [**How to Run Locally**](#-how-to-run-locally)\n7. [**What's Next?**](#-whats-next)\n8. [**Author**](#-author)\n\n---\n\n## 🌐 Architecture Overview\n\n🔹 **ESP32-WROOM-32D**\nA microcontroller that simulates steps via a button. Sends step data via MQTT over TLS using mutual certificate authentication.\n\n🔐 **TLS Mutual Authentication**\nSecure communication using custom client certificates and a trusted CA, protecting against unauthorized devices.\n\n🧠 **Rust Backend Validator**\nReceives messages via MQTT, validates authenticity (HMAC + timestamp), then logs valid steps on-chain via a Solana smart contract.\n\n⛓️ **Solana Anchor Program**\nDeployed on Devnet. Uses Program Derived Addresses (PDAs) to store step data per user per day. Tokens are minted automatically every 3 steps.\n\n📡 **EMQX Broker (Google Cloud VPS)**\nA hardened MQTT broker with TLS, ACL rules, and certificate-based access control.\n\n🖥️ **Frontend Interface**\nVisualizes your step history and blockchain rewards in a simple dashboard.\n\n---\n\n## ✅ Features Implemented\n\n* ✅ **ESP32 device** with WiFi + MQTT + TLS client auth\n* ✅ **TLS mutual authentication** via custom certificates\n* ✅ **HMAC-SHA256** signature generation on device\n* ✅ **JSON payload** with: `steps`, `timestamp`, `nonce`, `signature`\n* ✅ **Rust backend**:\n\n  * MQTT TLS client\n  * HMAC \u0026 timestamp validation\n  * PDA-based step tracking and token minting\n* ✅ **Solana Anchor program** with `log_step` instruction\n* ✅ **Solana Devnet** deployment and testing\n\n---\n\n## 🔐 Security Architecture\n\n* HMAC-SHA256 signed payloads (shared secret)\n* Timestamp validation to prevent replay attacks (±30s)\n* TLS mutual authentication (ESP32 ↔ EMQX ↔ backend)\n* EMQX Broker enforces certificate-based access and ACL rules\n* Backend runs on a hardened Google Cloud VPS with TLS\n* PDA ensures unique, tamper-proof on-chain logs per `(user, day)`\n\n---\n\n## 📁 Project Structure\n\n```\nGreenGait/\n├── backend/              # Rust backend (MQTT client, validation, blockchain interaction)\n├── solana_program/       # Anchor smart contract + TypeScript tests\n├── solana/               # CLI scripts, account utilities, program deploy\n├── frontend/             # (WIP) UI for displaying step history and rewards\n├── firmware/             # ESP32 Arduino code (WiFi, MQTT, HMAC)\n├── docs/                 # Arch-Diagram + PPT Presentation + Logo\n└── README.md             # You're here!\n```\n\n---\n\n## 🔁 Example Flow\n\n1. Press the button → ESP32 sends a signed JSON payload\n2. EMQX broker securely forwards it to the backend\n3. Backend verifies the HMAC + timestamp → logs it on-chain\n4. If steps are divisible by 3, a token is minted\n5. Frontend displays user stats (WIP)\n\n---\n\n## 🛠 How to Run Locally\n\n### 1. Flash the ESP32\n\nUpload `ESP32.ino` from `firmware/` using Arduino IDE.\nMake sure `certificates.h` contains:\n\n* `ca.crt`\n* `client.crt`\n* `client.key`\n\n### 2. Start the Rust Backend\n\n```bash\ncd backend\ncargo run\n```\n\nMake sure these files exist in `certs/`:\n\n```\nca.crt\nclient.crt\nclient.key\nstepmint-validator.json (Solana keypair)\n```\n\n### 3. Run the Solana Tests\n\n```bash\ncd solana_program\nanchor build\nanchor test\n```\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"test.png\" alt=\"Tests\" width=\"850\"\u003e\n  \u003cbr\u003e\n  \u003cem\u003eTests\u003c/em\u003e\n\u003c/p\u003e\n\n### 4. Deploy the Solana Program\n\n```bash\nanchor deploy\n```\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"deploy.png\" alt=\"Deploy\" width=\"850\"\u003e\n  \u003cbr\u003e\n  \u003cem\u003eDeploy\u003c/em\u003e\n\u003c/p\u003e\n\n---\n\n## 🌟 What's Next?\n\n* [ ] 🧠 PDA optimization\n* [ ] 💎 NFT/token design for major milestones\n* [ ] 🎨 Dashboard UI with wallet connection and real-time stats\n* [ ] 🔄 ESP32 OTA firmware delivery\n* [ ] 🛡️ Replay prevention \u0026 abuse detection\n* [ ] 🔋 Connection with energy harvesting system\n* [ ] 🛰️ GPS Accuracy\n* [ ] 🗄️ User Database\n\n---\n\n## 👤 Author\n\n**Robert Panța**\n\nMSc Student in Cybersecurity at Technical University of Cluj-Napoca\n\n* 📧 [LinkedIn](https://www.linkedin.com/in/robert-panta/)\n* 🌐 [GitHub](https://github.com/RobCyberLab)\n\n---\n\n\u003e 🍃 *GreenGait – where every step counts… on-chain, securely, and sustainably.*\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fromanian-solana-developer-program-c3%2Fgreengait","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fromanian-solana-developer-program-c3%2Fgreengait","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fromanian-solana-developer-program-c3%2Fgreengait/lists"}