{"id":30504960,"url":"https://github.com/yudis-bit/cognitive-routing-protocol","last_synced_at":"2025-08-25T14:15:15.405Z","repository":{"id":309989674,"uuid":"1038003803","full_name":"Yudis-bit/Cognitive-Routing-Protocol","owner":"Yudis-bit","description":"Next-gen routing protocol for DePIN dynamic, predictive, and incentive-aligned. Built to make networks faster, smarter, and harder to break.","archived":false,"fork":false,"pushed_at":"2025-08-15T00:33:15.000Z","size":8,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-08-15T02:26:33.311Z","etag":null,"topics":["ai-networking","blockchain","cognitive-routing","decentralized-infrastructure","decentralized-network","depin","layer1","mesh-networking","network-simulation","predictive-routing","routing-protocol","self-optimizing-network","staking-mechanism","trustscore","web3","web4"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Yudis-bit.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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-08-14T13:16:01.000Z","updated_at":"2025-08-15T00:33:18.000Z","dependencies_parsed_at":"2025-08-15T02:26:35.116Z","dependency_job_id":"68f6efc2-8cf5-4976-beaa-509beeff4dd3","html_url":"https://github.com/Yudis-bit/Cognitive-Routing-Protocol","commit_stats":null,"previous_names":["yudis-bit/cognitive-routing-protocol"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/Yudis-bit/Cognitive-Routing-Protocol","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Yudis-bit%2FCognitive-Routing-Protocol","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Yudis-bit%2FCognitive-Routing-Protocol/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Yudis-bit%2FCognitive-Routing-Protocol/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Yudis-bit%2FCognitive-Routing-Protocol/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Yudis-bit","download_url":"https://codeload.github.com/Yudis-bit/Cognitive-Routing-Protocol/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Yudis-bit%2FCognitive-Routing-Protocol/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":272077795,"owners_count":24869310,"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","status":"online","status_checked_at":"2025-08-25T02:00:12.092Z","response_time":1107,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["ai-networking","blockchain","cognitive-routing","decentralized-infrastructure","decentralized-network","depin","layer1","mesh-networking","network-simulation","predictive-routing","routing-protocol","self-optimizing-network","staking-mechanism","trustscore","web3","web4"],"created_at":"2025-08-25T14:15:10.345Z","updated_at":"2025-08-25T14:15:15.166Z","avatar_url":"https://github.com/Yudis-bit.png","language":"Python","readme":"# Cognitive Routing Protocol (CRP)\r\n\r\n[![Project Status: Prototype Complete](https://img.shields.io/badge/status-prototype_complete-brightgreen.svg)](https://github.com/Yudis-bit/Cognitive-Routing-Protocol)\r\n[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)\r\n\r\nThis repository contains the complete architecture and functional prototype for the **Cognitive Routing Protocol (CRP)**, a Layer-0/Layer-1 enhancement protocol designed to fundamentally reshape the efficiency, resilience, and profitability of Decentralized Physical Infrastructure Networks (DePIN).\r\n\r\n---\r\n\r\n## Key Findings from the Prototype\r\n\r\nThe Python prototype in this repository has successfully validated the core hypothesis of CRP. A comparative analysis between a \"Dumb Router\" (using Dijkstra's algorithm) and a \"Cognitive Router\" (using Reinforcement Learning) demonstrated:\r\n\r\n* **Adaptive Routing:** The Cognitive Router successfully learned to **dynamically avoid a congested network link**, using it less than **0.1%** of the time, compared to the Dumb Router which was stuck in congestion nearly **40%** of the time.\r\n* **Performance Gains:** By avoiding these bottlenecks, the Cognitive Router achieved **~22% lower average latency** for successful packet deliveries, proving its ability to optimize for overall network health.\r\n* **Full Analysis:** The complete comparative simulation can be run via the `simulations/run_cognitive_sim.py` script.\r\n\r\n## Full Project Architecture\r\n\r\nThe protocol is designed with two primary components working in tandem:\r\n\r\n1.  **Off-Chain AI Core (Python):**\r\n    * A discrete-event simulation environment for modeling a DePIN.\r\n    * A **Cognitive Node** agent equipped with a Reinforcement Learning model (Multi-Armed Bandit) to make intelligent, adaptive routing decisions.\r\n\r\n2.  **On-Chain Trust Layer (Solidity):**\r\n    * A `NodeRegistry` smart contract on an Ethereum-compatible blockchain to handle the economic and trust logic.\r\n    * Its core functions include node registration, a staking mechanism for collateral, and an on-chain reputation system (`TrustScore`) to incentivize good behavior.\r\n\r\n## Tech Stack\r\n\r\n* **Simulation \u0026 AI Core**: Python 3.10+\r\n* **Smart Contracts**: Solidity ^0.8.20\r\n* **Contract Development Environment**: Hardhat\r\n* **Blockchain Interaction**: Web3.py\r\n* **Dependencies**: OpenZeppelin Contracts\r\n\r\n## Getting Started\r\n\r\nTo run this project locally, you'll need to set up both the simulation and contract environments.\r\n\r\n### 1. Running the Python Simulation\r\n\r\n1.  **Navigate to the simulation folder:**\r\n    ```bash\r\n    cd simulation\r\n    ```\r\n2.  **Create and activate a virtual environment:**\r\n    ```bash\r\n    # Example for Windows\r\n    python -m venv venv\r\n    .\\venv\\Scripts\\activate\r\n    ```\r\n3.  **Run the comparative simulation:**\r\n    This script will run the Dumb Router vs. the Cognitive Router and display the final performance analysis.\r\n    ```bash\r\n    python simulations/run_cognitive_sim.py\r\n    ```\r\n\r\n### 2. Working with the Smart Contracts\r\n\r\n1.  **Navigate to the contracts folder:**\r\n    ```bash\r\n    cd contracts\r\n    ```\r\n2.  **Install Node.js dependencies:**\r\n    ```bash\r\n    npm install\r\n    ```\r\n3.  **Compile the contracts:**\r\n    This command will check for errors and generate the necessary ABI files.\r\n    ```bash\r\n    npx hardhat compile\r\n    ```\r\n4.  **(Optional) Deploy to a testnet:**\r\n    You can configure `hardhat.config.js` with your RPC URL and private key to deploy the contract.\r\n\r\n## Completed Roadmap\r\n\r\n* [x] **Phase 0: Architecture \u0026 Whitepaper** - Conceptual design and vision.\r\n* [x] **Phase 1: Simulation Environment** - Modular testbed development in Python.\r\n* [x] **Phase 2: \"Dumb\" Router (Baseline)** - Dijkstra's algorithm implementation for benchmarking.\r\n* [x] **Phase 3: Cognitive Node (AI Core)** - AI agent implementation with a Multi-Armed Bandit model.\r\n* [x] **Phase 4: Integration \u0026 Comparative Analysis** - Validation of CRP's performance benefits.\r\n* [x] **Phase 5: On-Chain Component Design (Solidity)** - Smart contract architecture for trust and staking.\r\n\r\n## Contributing\r\n\r\nContributions are welcome. Please fork the repository, create a dedicated feature branch for your work, and submit a pull request.\r\n\r\n## License\r\n\r\nThis project is licensed under the MIT License.","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyudis-bit%2Fcognitive-routing-protocol","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyudis-bit%2Fcognitive-routing-protocol","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyudis-bit%2Fcognitive-routing-protocol/lists"}