Skip to content

poorvanshi10/neural_blockchain

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🧠 neural_blockchain

Immutable ledger infrastructure for decentralized AI model training.

Python Architecture Status

Traditional blockchains secure financial transactions. neural_blockchain is engineered to secure neural networks. By cryptographically chaining model weight updates, this architecture provides a tamper-proof, verifiable audit trail for Federated Learning systems.

✨ Core Capabilities

  • Zero-Trust AI: Validates machine learning node updates across a decentralized network.
  • Cryptographic Integrity: Custom SHA-256 hashing ensures absolute, mathematically verifiable data immutability.
  • Algorithmic Auditing: Built-in chain validation to detect ledger tampering instantly.
  • Pure Python Foundation: Built entirely from scratch without bloated external blockchain frameworks to ensure maximum execution control.

📖 System Overview

In distributed machine learning (Federated Learning), multiple remote nodes train an AI model collaboratively. This blockchain acts as the central truth mechanism, cryptographically chaining model weight updates to create a tamper-proof, verifiable audit trail.

🛠️ Tech Stack

This infrastructure is built to be lightweight, auditable, and easily deployable.

  • Core Logic: Pure Python 3.10+ (Object-Oriented Design)
  • Cryptography: Native Python hashlib (SHA-256)
  • API / Network Layer: FastAPI (Chosen for high-performance async routing and automatic Swagger UI documentation)
  • Server: Uvicorn (ASGI web server)

📂 Project Structure

neural_blockchain/
├── core/                   # The foundational blockchain engine
│   ├── __init__.py
│   ├── block.py            # SHA-256 cryptographic hashing and block structure
│   ├── ledger.py           # Chain state management and validation logic
│   └── consensus.py        # Proof-of-Work (PoW) and longest-chain algorithms
├── api/                    # The REST API and P2P communication layer
│   ├── __init__.py
│   ├── routes.py           # FastAPI endpoints (/mine, /chain, /nodes/sync)
│   └── schemas.py          # Pydantic models for strict JSON payload validation
├── tests/                  # Integrity and unit testing
│   └── test_crypto.py      # Automated tests for hash functions and tampering
├── main.py                 # ASGI application entry point (Uvicorn)
├── requirements.txt        # Production dependencies
└── README.md               # System documentation

## 🚀 Quick Start (Core Engine)

Run the local validation engine to test the cryptographic linked-list structure and simulate a tampering attack.

```bash
git clone [https://github.com/your-username/neural_blockchain.git](https://github.com/your-username/neural_blockchain.git)
cd neural_blockchain
python blockchain.py

## 🖥️ Live Production Interface

### 1. Interactive API Explorer (Swagger UI)
![API Interface](Screenshot%202026-06-29%20123511.png)

### 2. Live Ledger Execution
![Ledger Response](Screenshot%202026-06-29%20124001.png)

About

A decentralized, modular Proof-of-Work (PoW) ledger engineered to secure distributed machine learning weights and prevent data poisoning in Federated Learning pipelines. Built using pure Python and FastAPI.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors