A blockchain based patient record system but also considers research aspects
Detailed Project Description – Charak
The Charak project is a decentralized platform designed to securely manage and share medical records with full control in the hands of the patient. Recognizing the limitations of traditional healthcare data systems—such as fragmentation, centralization, lack of interoperability, and security vulnerabilities, this solution leverages blockchain technology, cryptographic hashing, and IPFS-based storage to ensure data privacy, integrity, and transparency.
Patient Onboarding and Identity Management
When a patient registers on the system, they enter their Aadhaar number, which is hashed using SHA256, and the first 10 digits of the hash are used to generate a unique PatientID. The system simultaneously allocates a dedicated Ethereum wallet address (via Ganache) to the patient, which serves as their identity on the blockchain. The patient is then prompted to provide basic medical information such as age, height, blood group, and allergies. All these actions are secured and recorded on Node.js
Access Control & Authorization
Doctors and insurance providers must request access from patients to either view previous records or upload new ones. This ensures that the patient remains the sole authority to grant or deny access, aligning with modern data privacy principles.
Medical File Handling & Blockchain Storage
Once a doctor is granted access:
The medical file is sent to the Node.js backend server.
The server generates a SHA256 hash of the file for data integrity.
The file is uploaded to IPFS via Pinata, a decentralized file storage platform.
Pinata returns a CID (Content Identifier), which points to the specific version of the file stored on IPFS.
The backend stores the file hash, CID, and associated PatientID on the blockchain using smart contracts.
This setup guarantees that the actual medical data is not stored on-chain, preventing blockchain bloat and ensuring data efficiency while maintaining cryptographic verification.
Role-Based Access & Security
Patients: Full access and control over their data, permissions, and audit logs.
Doctors/Insurers: Can only access data upon receiving explicit patient consent.
Admin: Has access to file hashes and CIDs only, not to the content or sensitive patient metadata.
Technology Stack
Frontend: Next.JS
Backend: Node.js for API communication and data handling
Smart Contracts: Solidity (compiled and deployed using Truffle)
Local Blockchain: Ganache (for development and testing)
File Storage: IPFS (via Pinata SDK)
Cryptographic Hashing: SHA256 for identity and file verification
Web3 Integration: web3.js to interact with smart contracts
Advantages
Security: Immutable records and cryptographic proof of data integrity.
Privacy: Patient controls all access.
Decentralization: Removes reliance on central servers.
Auditability: All interactions are recorded transparently on the blockchain.
Charak Progress Report – 24 Hours Breakdown Hours 0–6: Ideation & Setup • Team brainstorming: Finalized the idea to build a decentralized medical record management system (Charak) addressing privacy, transparency, and patient control. • Tech stack finalized: o Smart Contracts with Solidity. o Blockchain network via Ganache. o File storage using IPFS (Pinata). o Backend with Node.js. o Frontend with Next.js. • Environment setup: o Installed Truffle, Ganache, Node.js and required libraries. o Created basic file structure for smart contracts, frontend, and backend. Hours 6–12: Smart Contract Development & IPFS Integration • Smart Contract (Charak.sol) completed: o Functions for registering patient info. o Storing SHA256 file hash, IPFS CID, and patientID. o Role-based access control (patient, doctor, admin). • Tested contracts locally using Truffle and Ganache. • Integrated IPFS using Pinata SDK in backend. • Backend setup: o File upload API in Node.js. o SHA256 hash generation implemented. Hours 12–18: Frontend, Wallet Integration & Patient Flow • Created registration page for patients: o Inputs: Aadhaar, OTP, medical info. o SHA256 hash of Aadhaar generated to derive unique PatientID. • Implemented automatic wallet assignment using Ganache accounts. • Connected frontend with Web3.js for contract interactions. • Implemented logic to let patients: o Grant/deny access to doctors. o View uploaded hashes and CIDs. • Basic UI designed using Chakra UI. Hours 18–24: Doctor Flow, Final Integration & Testing • Built doctor request flow: o View/upload request sent to patient. o Conditional logic for access approval. • Once approved: o File uploaded via frontend. o Sent to Node.js server. o Server generates SHA256 hash and stores file on Pinata. o CID + hash + patientID sent to smart contract. • Final integration between: o Smart contracts ↔️ Node.js backend ↔️ React frontend. • Final testing & bug fixes: o Role-based access verified. o Hash & CID visibility is restricted to authorized users. o Admin view restricted to CID and hash only. • Prepared presentation/demo flow for submission.
None