Skip to content

mastaan66/Evidence-Protection-System

Repository files navigation

🛡️ Blockchain-Based Evidence Protection System

🔗 Introduction

The Blockchain-Based Evidence Protection System is a secure and immutable platform designed to store and verify legal evidence using blockchain technology. It ensures data integrity, prevents tampering, and allows authorized personnel (lawyers, judges, law enforcement) to securely access evidence with transparency and accountability.

🚀 Features

Immutable Storage – Evidence is securely stored on the blockchain, preventing tampering.
Smart Contracts – Automates evidence verification, reducing manual errors.
Role-Based Access – Only authorized entities can view or verify the evidence.
Transparent Audit Trail – Tracks every action on evidence in a verifiable manner.
Secure File Uploads – Stores text, images, videos, and other legal documents with cryptographic hashing.

🏗️ Tech Stack

  • Frontend: React.js + Tailwind CSS + Framer Motion
  • Backend: Node.js + Express.js
  • Blockchain: Solidity (Ethereum/Polygon) + Web3.js
  • Storage: IPFS (InterPlanetary File System) for decentralized storage
  • Database: PostgreSQL / Firebase (optional for metadata storage)

🔥 How It Works

  1. Upload Evidence – Users submit evidence files, which are encrypted and stored on IPFS.
  2. Generate Hash – A unique cryptographic hash is created for each piece of evidence.
  3. Smart Contract Verification – Hash is recorded on the blockchain to ensure immutability.
  4. Role-Based Access Control – Only verified users can retrieve and validate the evidence.
  5. Tamper Detection – Any change to the original file results in a hash mismatch, indicating tampering.

📜 Smart Contract Overview

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

contract EvidenceStorage {
    struct Evidence {
        string ipfsHash;
        address uploader;
        uint256 timestamp;
    }

    mapping(string => Evidence) public evidences;
    
    function addEvidence(string memory _hash) public {
        require(bytes(evidences[_hash].ipfsHash).length == 0, "Evidence already exists");
        evidences[_hash] = Evidence(_hash, msg.sender, block.timestamp);
    }
    
    function verifyEvidence(string memory _hash) public view returns (address, uint256) {
        require(bytes(evidences[_hash].ipfsHash).length != 0, "Evidence not found");
        return (evidences[_hash].uploader, evidences[_hash].timestamp);
    }
}

🎯 Installation & Setup

# Clone the repository
git clone https://github.com/yourusername/blockchain-evidence-system.git
cd blockchain-evidence-system

# Install dependencies
npm install  # For frontend
npm run install-backend  # For backend

# Start the development server
npm start  # For frontend
npm run start-backend  # For backend

🛠️ Deployment

  1. Deploy the smart contract on Ethereum/Polygon using Hardhat or Truffle.
  2. Update the contract address in the frontend config.js file.
  3. Deploy the frontend using Vercel, Netlify, or Firebase Hosting.

🎨 UI Preview

App UI

🛡️ Security Measures

  • AES Encryption for evidence files before uploading to IPFS.
  • Role-Based Authentication for lawyers, judges, and officials.
  • Blockchain Validation ensures that stored evidence remains untampered.

🤝 Contributing

We welcome contributions! 🚀 Feel free to submit PRs, suggest features, or report bugs.

📜 License

MIT License - Free to use and modify.

✨ Contributors

👤 Sk Mastan - GitHub | LinkedIn


🚀 Secure. Transparent. Immutable. Blockchain-Powered Evidence Protection! 🔥

About

database optimization

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published