This document details a healthcare system leveraging Zero-Knowledge Proofs (ZKPs) to securely verify blood pressure readings while maintaining patient privacy.
- Role-Based Access Control: Strict access control for Administrators, Doctors, and Insurance Providers.
- Secure Blood Pressure Verification: ZKP implementation ensures only the validity of blood pressure readings (within a specified range) is revealed, not the actual values.
- Privacy-Preserving Claims System: Insurance claims are processed while protecting sensitive patient data.
- Intuitive Dashboards: Dedicated dashboards for Admins (user management), Doctors (patient registration and claim submission), and Insurance Providers (claim verification).
- Node.js: v14 or higher
- MongoDB: v4.4 or higher
- Ganache: Local blockchain emulator (for development)
- MetaMask: Browser extension for interacting with Ganache.
- Git: Version control system.
- Circom: For compiling ZKP circuits.
-
Clone and Install Dependencies:
git clone <repository_url> cd <project_directory> npm install cd backend && npm install cd ../frontend && npm install npm install -g circom
-
ZKP Circuit Setup:
cd circuits circom bloodPressureRange.circom --r1cs --wasm --sym
-
Backend Setup:
cd backend node scripts/setup-complete.js // Compiles circuit, generates keys, sets up the ZKP system node scripts/setup-roles.js // Deploys contracts; **Note the contract address displayed.**
-
Environment Configuration: Update the
.env
file with the contract address obtained from step 3. Also note the account addresses and their assigned roles. -
Ganache Setup:
- Download and install Ganache.
- Create a new workspace.
- Keep Ganache running throughout the process.
-
MetaMask Configuration:
- Add the Ganache network to MetaMask:
- Network Name: Ganache
- RPC URL:
http://127.0.0.1:7545
- Chain ID: 1337
- Currency: ETH
- Import accounts from Ganache in the following order:
- Admin
- Doctor
- Insurance Provider
- Add the Ganache network to MetaMask:
-
Start the Application:
- Start MongoDB.
- In the backend directory:
node server.js
- In the root directory:
npm start
(to start the frontend)
Account # | Role | Permissions |
---|---|---|
1 | Admin | User management |
2 | Doctor | Patient registration, claim submission |
3 | Insurance Provider | Claim verification |
Important: Maintain the order of accounts from Ganache (Admin, Doctor, Insurance Provider).
-
ZKP Test:
cd backend && node scripts/test-zkp.js
-
Doctor Workflow:
- Log in as the Doctor (Account #2).
- Submit claims with varying blood pressure values (e.g., 130, 150). Observe eligibility based on the defined range.
-
Insurance Provider Workflow:
- Log in as the Insurance Provider (Account #3).
- Review submitted claims.
- Verify proofs using the "Verify Proof" button. Note that the actual blood pressure values remain hidden.
- MetaMask Connection: Ensure Ganache is running, network settings in MetaMask are correct, and the appropriate account is selected.
- MongoDB Connection: Verify MongoDB is running, the connection string in
.env
is accurate, and database permissions are correctly configured. - ZKP Verification: Re-run
setup-complete.js
, check circuit compilation logs, and review proof generation parameters.
- Zero-Knowledge Proofs: Fundamental for data privacy.
- Role-Based Access Control: Limits access based on roles.
- JWT Authentication: Secure authentication mechanism.
- Encrypted Data Storage: Protects data at rest.
- (Future) Two-Factor Authentication: Enhanced