Skip to content

Harithakotha/LedgerSeal

Β 
Β 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

7 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

ChainProof+: Forensic-Grade Blockchain-Based Digital Evidence Integrity System

A comprehensive, enterprise-ready solution for managing digital evidence with blockchain-based integrity verification, wallet-authenticated ownership transfers, and tamper detection. Built on Algorand with real-time verification, role-based access control (RBAC), and decentralized storage options.


🎯 Project Overview

ChainProof+ is a complete forensic evidence management system that leverages blockchain technology to ensure:

  • Immutable records of evidence ownership and custody chain
  • Cryptographic verification of file integrity (SHA-256 + BLAKE2b hashing)
  • Tokenized ownership via Algorand Standard Assets (ASA)
  • Wallet-based authentication with Pera Wallet for transaction signing
  • Role-based access control (Admin, Investigator, Auditor)
  • Smart contract enforcement of access policies and multi-signature approvals
  • AI-enhanced verification for tampering detection and deepfake risk assessment
  • Decentralized architecture with optional IPFS integration for file storage

✨ Key Features

πŸ” Security & Integrity

  • Dual-hash verification: SHA-256 and BLAKE2b hashing for evidence integrity
  • Transaction-based proof: Every transfer recorded on Algorand blockchain
  • Tamper detection: AI heuristics to identify potential file manipulation
  • Access control: RBAC system restricting evidence operations to authorized roles

πŸ’Ό Ownership & Custody

  • ASA tokenization: Each evidence file represented as a unique Algorand token
  • Real-time transfers: Pera Wallet-approved asset transfers with blockchain recording
  • Ownership timeline: Visual history of all custody changes with timestamps
  • Multi-signature approval: Optional 2-3 signature requirements for critical evidence
  • Transaction notes: Evidence metadata embedded in blockchain for full traceability

πŸ“Š Verification & Audit

  • Trust scoring: Automated verification scoring (0-100%) based on integrity + metadata + chain validation
  • Verification logs: Complete audit trail of all verification operations
  • QR certificates: Downloadable forensic certificates with blockchain verification links
  • Chain of custody tracking: Immutable record of evidence movement between stakeholders

🎨 User Experience

  • Drag-and-drop upload: Seamless evidence file ingestion
  • Visual timeline: Graph-based ownership and custody history
  • Real-time dashboard: Live transaction status and blockchain updates
  • Downloadable reports: PDF forensic certificates with QR codes linking to on-chain proof
  • Responsive design: Works on desktop and tablet for field operations

🌐 Integration & Scalability

  • IPFS support (optional): Decentralized file storage while maintaining on-chain hash references
  • Public read access: Evidence list and details publicly queryable; write operations require authentication
  • JWT token-based auth: Session management with role-based permissions
  • Rate limiting: API protection against abuse (100 requests/15 minutes)

πŸ› οΈ Tech Stack

Backend

  • Node.js + Express.js β€” REST API server
  • TypeScript β€” Type-safe backend development
  • SQLite β€” Local database for evidence metadata
  • Algorand SDK β€” Blockchain integration for ASA creation and transactions
  • jsonwebtoken (JWT) β€” Authentication and authorization
  • Multer β€” File upload handling
  • pdf-lib β€” PDF certificate generation
  • qrcode β€” QR code generation for blockchain proof links
  • cors, helmet, morgan, express-rate-limit β€” Security & monitoring

Frontend

  • React 18 + TypeScript β€” UI framework
  • Vite β€” Lightning-fast dev server and build
  • Tailwind CSS β€” Utility-first styling
  • use-wallet-react β€” Pera Wallet integration
  • React Router β€” Client-side navigation
  • @tanstack/react-query β€” Server state management
  • notistack β€” Toast notifications
  • @heroicons/react β€” Icon library
  • AlgoKit Utils β€” Algorand client utilities

Smart Contracts

  • Python/PyTeal (AlgoPy) β€” Algorand smart contract language
  • AlgoKit β€” Development framework and deployment

Infrastructure

  • Algorand TestNet β€” Blockchain network (configurable for MainNet)
  • Docker (optional) β€” Containerization support

πŸ“¦ Project Structure

ledgerseal/
β”œβ”€β”€ projects/
β”‚   β”œβ”€β”€ chainproof-backend/          # Express API server
β”‚   β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”‚   β”œβ”€β”€ blockchain/          # Algorand integration
β”‚   β”‚   β”‚   β”œβ”€β”€ services/            # Business logic
β”‚   β”‚   β”‚   β”œβ”€β”€ controllers/         # API endpoints
β”‚   β”‚   β”‚   β”œβ”€β”€ routes/              # Route definitions
β”‚   β”‚   β”‚   β”œβ”€β”€ middleware/          # Auth & RBAC
β”‚   β”‚   β”‚   β”œβ”€β”€ verification/        # Verification engine
β”‚   β”‚   β”‚   β”œβ”€β”€ utils/               # Hashing & utilities
β”‚   β”‚   β”‚   └── config/              # Database setup
β”‚   β”‚   └── package.json
β”‚   β”‚
β”‚   β”œβ”€β”€ ledgerseal-frontend/         # React web app
β”‚   β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”‚   β”œβ”€β”€ pages/               # Page components
β”‚   β”‚   β”‚   β”œβ”€β”€ components/          # Reusable components
β”‚   β”‚   β”‚   β”œβ”€β”€ services/            # API client
β”‚   β”‚   β”‚   └── utils/               # Helpers
β”‚   β”‚   └── package.json
β”‚   β”‚
β”‚   └── ledgerseal-contracts/        # Smart contracts
β”‚       β”œβ”€β”€ smart_contracts/
β”‚       β”‚   └── ledger_seal/
β”‚       β”‚       β”œβ”€β”€ contract.py      # RBAC contract
β”‚       β”‚       └── deploy_config.py
β”‚       └── pyproject.toml
β”‚
└── README.md

πŸš€ Setup & Installation

Prerequisites

  • Node.js v20+ and npm v9+
  • Python 3.10+ (for smart contracts)
  • AlgoKit CLI (install guide)
  • Pera Wallet extension (for transaction signing)

Quick Start

1. Clone & Install Dependencies

git clone <repository-url>
cd ledgerseal

# Install backend dependencies
cd projects/chainproof-backend
npm install

# Install frontend dependencies
cd ../ledgerseal-frontend
npm install

# Install contract dependencies (optional)
cd ../ledgerseal-contracts
pip install -r requirements.txt  # or poetry install

2. Configure Environment

Create .env file in projects/chainproof-backend/ with the following variables:

  • ALGOD_SERVER, ALGOD_PORT, ALGOD_TOKEN β€” Algorand node connection (use PureStake or LocalNet)
  • INDEXER_SERVER, INDEXER_PORT, INDEXER_TOKEN β€” Algorand indexer endpoint
  • DEPLOYER_MNEMONIC β€” 25-word seed phrase for smart contract deployment
  • JWT_SECRET β€” Secret key for JWT token signing (use a strong random string)
  • USE_IPFS (optional) β€” Set to true to enable IPFS file storage
  • IPFS_API_URL (optional) β€” IPFS node endpoint (default: Infura gateway)
  • VITE_API_BASE_URL β€” Frontend API base URL (default: http://localhost:3001/api)

See .env.example for reference structure.

3. Start Development Servers

Backend (from projects/chainproof-backend/):

npm run dev
# Runs on http://localhost:3001

Frontend (from projects/ledgerseal-frontend/):

npm run dev
# Runs on http://localhost:5173

4. Test the Application

  1. Open http://localhost:5173 in your browser
  2. Click wallet icon β†’ Connect with Pera Wallet
  3. Go to Settings β†’ Select role β†’ Login with Wallet Role
  4. Navigate to Upload β†’ Upload evidence file
  5. View on Dashboard β†’ Click evidence card β†’ See Ownership Timeline
  6. Try Transfer Ownership β†’ Approve in Pera Wallet β†’ Verify on-chain

πŸ”‘ Core Workflows

Evidence Registration

  1. User uploads file via drag-and-drop
  2. Backend computes SHA-256 + BLAKE2b hashes
  3. Algorand creates ASA token (1 unit, non-divisible)
  4. Transaction recorded with evidence metadata in note field
  5. Evidence stored in database with asset ID reference

Ownership Transfer

  1. User selects evidence and new owner address
  2. Frontend constructs ASA transfer transaction
  3. Pera Wallet prompts for approval and signature
  4. Backend verifies transaction on-chain
  5. Custody record created with transaction ID
  6. Evidence ownership updated in database

Verification

  1. User provides evidence ID and optional file
  2. Backend recomputes hashes if file provided
  3. AI heuristics analyze for deepfake/tampering risk
  4. Trust score calculated (0-100%)
  5. Verification result stored with risk level
  6. User can download forensic certificate with QR code

πŸ“ API Endpoints

Authentication

  • POST /api/auth/login β€” Login with wallet address & role β†’ receive JWT token

Evidence (Public Read)

  • GET /api/evidence β€” List all evidence
  • GET /api/evidence/:id β€” Get evidence details
  • GET /api/evidence/:id/history β€” Get ownership timeline
  • GET /api/evidence/:id/certificate β€” Download forensic PDF

Evidence (Protected Write)

  • POST /api/evidence/register β€” Upload & register new evidence (Investigator+)
  • POST /api/evidence/verify β€” Verify evidence integrity (Investigator+)
  • POST /api/evidence/:id/transfer β€” Initiate ownership transfer (Investigator+)
  • POST /api/evidence/:id/transfer/approve β€” Approve multi-sig transfer (Admin/Investigator)

πŸ” Role-Based Access Control (RBAC)

Role Upload Verify Transfer Approve
Admin βœ… βœ… βœ… βœ…
Investigator βœ… βœ… βœ… βœ…
Auditor ❌ βœ… ❌ ❌

πŸš€ Future Scope

Planned Enhancements

  • Mobile Application β€” Native iOS/Android app using React Native for field evidence collection with offline support
  • Advanced AI Integration β€” Integrate leading AI models for facial recognition, forgery detection, and metadata analysis
  • Distributed Evidence Network β€” Multi-node blockchain deployment for enhanced redundancy and geographic resilience
  • Regulatory Compliance Modules β€” Support for GDPR, HIPAA, and jurisdiction-specific evidence handling standards
  • Automated Chain-of-Custody Reporting β€” Generate compliant forensic reports with automated notifications
  • Evidence Encryption at Rest β€” AES-256 encryption for stored evidence with key management services
  • Integration with Law Enforcement Systems β€” Direct API integration with major law enforcement databases and case management systems
  • Advanced Analytics Dashboard β€” Trends, anomaly detection, and predictive analysis for evidence patterns
  • Blockchain Explorer UI β€” Custom explorer for easy transaction verification and audit trails
  • Multi-Chain Support β€” Extend blockchain support to Ethereum, Polygon, and other networks for institutional choice

πŸ“š Project Documentation

For detailed information, refer to:


🀝 Contributing & Support

This is a production-ready forensic evidence management system. For issues, feature requests, or contributions, please follow the standard Git workflow.


πŸ“„ License

Proprietary β€” ChainProof+ Evidence Management System


🎯 Next Steps

  1. Deploy smart contracts to Algorand TestNet/MainNet
  2. Set up production Algorand API endpoints
  3. Configure IPFS for decentralized file storage
  4. Integrate advanced AI tampering detection APIs
  5. Deploy frontend to web hosting
  6. Conduct security audit for production use

About

Made with Algorand Blockchain.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • TypeScript 67.1%
  • Python 30.4%
  • CSS 1.2%
  • Other 1.3%