Introduction:
Nigeria faces a critical healthcare shortage, with over 15,000 health professionals leaving the country in the past five years, leaving just 55,000 doctors to serve a population exceeding 200 million. As a result, patients endure long wait times for care, and outdated, paper-based medical records further exacerbate inefficiencies, leading to misdiagnoses and redundant testing when records are incomplete.
This pressing issue inspired the development of medZK—an advanced, privacy-centric healthcare solution leveraging Zero-Knowledge Proofs (zk-SNARKs) and Google's Gemini AI to revolutionize the way medical records are verified and utilized in patient care. MedZK empowers healthcare practitioners by reducing administrative burdens and enabling secure, real-time access to verified patient data, without compromising sensitive information.
Persona:
Meet Dr. Amina, a general practitioner in Lagos, Nigeria. Like many of her colleagues, Dr. Amina struggles with outdated paper records that often lead to delays in patient care. When John, a new patient, arrives at her clinic with incomplete paper records, she faces the risk of prescribing the wrong treatment based on inaccurate or missing information.
Solution Overview:
Using medZK, Dr. Amina can securely verify John’s medical history through zk-SNARK technology without accessing or exposing his private health information. In seconds, the system confirms the accuracy of John's diagnosis, provides treatment recommendations powered by Google Gemini AI, and even suggests updated protocols for managing diabetes—all while preserving John’s privacy.
Impact:
MedZK transforms the healthcare experience, making it faster and more reliable for practitioners like Dr. Amina to provide personalized care, while protecting patient confidentiality. For healthcare systems, it offers a scalable, privacy-preserving EMR solution that integrates advanced cryptography with AI-driven insights. This reduces inefficiencies and empowers practitioners to deliver better care, ultimately addressing a major gap in Nigeria's healthcare infrastructure.
Persona Overview:
Dr. Amina is a 35-year-old general practitioner working in a busy clinic in Lagos. Her clinic sees a high number of patients every day, but it lacks a unified electronic medical records (EMR) system. Paper records are often unreliable and prone to errors, leading to misdiagnoses and delays in patient care. Dr. Amina wants a way to verify patient medical histories quickly, without needing to access personal or sensitive information.
User Journey Story: Dr. Amina’s Experience with Health Record Verification Using ZK-Proofs
Phase 1: The Problem - Inconsistent Medical Records
Situation:
Dr. Amina is treating a new patient, John, who claims to have diabetes. John provides a paper record of his treatment history from a different clinic, but Dr. Amina is unsure whether the information is accurate or up-to-date. She is concerned about the potential risks of prescribing the wrong medication based on incomplete or inaccurate records.
Pain Points:
- Paper records are often outdated or missing key information.
- There is no secure way to verify the authenticity of John's medical history without contacting the other clinic, which could take days (Most often a new record would be opened and John would have to repeat several tests).
Phase 2: Discovering the Solution - ZK-Proof Health Record Verification
Situation:
Dr. Amina's clinic recently adopted a Health Record Verification System that leverages Zero-Knowledge Proofs (ZK-proofs). She is informed that this system can verify the authenticity of John's medical records from another clinic, without revealing his sensitive health information and with Gemini's AI-powered insights, it also provides recommendations on treatment and trends for John’s condition.
Expectation:
Dr. Amina hopes this new system will streamline the verification process, allowing her to focus on treating John instead of dealing with administrative delays.
Phase 3: Initial Interaction - Using the Health Record Verification System
Situation:
Dr. Amina logs into the health verification portal integrated with the clinic’s EMR system. John provides his patient ID and requests verification of his medical history from the other clinic.
Step 1: Dr. Amina enters John’s patient ID into the portal.
Step 2: The system automatically communicates with the external EMR where John's medical record is stored.
Step 3: Using Zero-Knowledge Proof (ZK) technology, the system verifies John's medical history without revealing his detailed medical information.
Step 4: Google Gemini AI generates real-time insights, highlighting potential risks, suggested treatment modifications, and trends in managing diabetes based on up-to-date medical research.
Outcome: Dr. Amina receives a notification on her screen confirming that John's diagnosis and treatment for diabetes are legitimate. Additionally, Gemini AI suggests alternative medication options based on John's medical history and recent research on diabetes management.
Phase 4: Verifying Records Privately and Securely
Situation:
The ZK-proof system displays a confirmation: “John’s medical record from Clinic X is verified. Diagnosis: Diabetes Type 2. Treatment prescribed: Metformin, confirmed.”
How Dr. Amina feels:
- Relieved that the system quickly verified the information.
- Confident in prescribing the correct medication while considering the additional insights from Gemini.
- Comforted knowing that John’s privacy was fully protected and the latest research was integrated into her decision-making.
Phase 5: Successful Treatment Based on Verified Records
Situation:
Dr. Amina now has confidence in John's medical history, enabling her to prescribe the necessary medication. Gemini AI also suggests dietary recommendations and highlights new treatment protocols for diabetes. The process took only a few minutes compared to the days it might have taken to manually verify records from another clinic.
Results:
John receives the right medication without delay. Dr. Amina spends less time on administrative work and more time on patient care.
Phase 6: Reflection on the Experience
Post-Interaction:
Dr. Amina reflects on how much easier and faster it was to verify John’s medical records using the ZK-proof health verification system, and how the AI insights from Google Gemini enhanced her understanding of the latest trends in diabetes care. In the past, she had to deal with lengthy delays, patient frustration, and inaccuracies in health records. Now, with the new system, she can trust the accuracy of medical records and preserve her patients' privacy.
What Dr. Amina values:
- The privacy and security of her patients’ sensitive health data.
- The speed and efficiency of verifying critical medical records.
- The reduction in administrative burden, allowing her to focus on delivering quality care.
Key Takeaways from the Journey:
-For Dr. Amina: The ZK-proof system Gemini AI insights are an invaluable tool for ensuring medical record accuracy, saving time, and maintaining patient privacy, providing personalized patient care based on the latest research all while providing better care.
-For the Patient (John): John feels reassured knowing that his medical history was securely verified without compromising his privacy, resulting in a quick and accurate diagnosis.
-For the Healthcare System: This process improves overall efficiency in the healthcare system, minimizing record inaccuracies and facilitating better patient outcomes across different facilities.
Inspiration
Poor health information systems have been a significant challenge in many sub-Saharan African countries, including Nigeria. Despite the potential benefits of Electronic Medical Records (EMR) in improving patient care and access to data, adoption has been slow in these regions. This project aims to leverage advanced cryptographic techniques like Zero-Knowledge Proofs (ZK) to address issues of privacy and trust in health data sharing, particularly within a fragmented healthcare system. We are inspired by the need for secure, scalable, and privacy-preserving solutions to digitize medical records and enhance healthcare delivery.
What it does
Our solution uses Zero-Knowledge Proofs (ZK), specifically the Groth16 protocol, to create a secure and private health information system. It ensures that sensitive medical data can be accurately verified without revealing the actual information. The system allows users and healthcare providers to:
- Submit medical records securely
- Verify the authenticity of records using zero-knowledge proof
- Use AI-driven insights integrated with Google Gemini for recommendations based on the verified data
How we built it
- Blockchain & ZK: We implemented the GROTH16 ZK-SNARK protocol in a Solidity smart contract to handle the verification of medical records without revealing patient details. This ensures that the verification process is both secure and private.
- EMR Integration: We designed an EMR system to store patient data, ensuring compatibility with existing systems, but with added privacy layers through ZK verification.
- AI Integration: Google Gemini API was integrated for real-time AI-driven analysis and recommendations based on verified medical data, helping healthcare providers make informed decisions.
- Front-End: We developed an interactive web interface where users can input medical details and see proof verification outcomes without compromising their privacy.
Challenges we ran into
- Data Privacy: Ensuring that sensitive medical data remains private while allowing for verifiable computations required careful implementation of zero-knowledge proofs.
- ZK Optimization: Implementing and optimizing the GROTH16 protocol within a Solidity smart contract presented challenges, especially with gas fees and computation times in a blockchain environment.
- EMR Adoption: A key challenge was to design a system that fits into existing healthcare infrastructures in sub-Saharan Africa while ensuring ease of use and reliability.
- AI Integration: Seamlessly integrating AI-driven insights with verified health data requires careful handling to ensure accuracy without compromising privacy.
Accomplishments that we're proud of
- Successfully implemented ZK-SNARK proof verification to protect the privacy of sensitive health information.
- Developed a scalable, privacy-preserving EMR system that can be adopted in resource-constrained environments like Nigeria.
- Integrated AI to provide actionable medical insights while maintaining data integrity and security.
Created a user-friendly interface that makes interacting with zero-knowledge proofs seamless for both healthcare providers and patients.
We have successfully integrated vision capabilities into our project, enabling the retrieval and analysis of medical images and videos. Key accomplishments include:
Image Retrieval: We implemented an endpoint (/record/image/search/{patientId}) that retrieves diagnostic images for a given patient, providing detailed insights such as lesion location, signal heterogeneity, and mass effects from MRI scans.
Video Retrieval: We implemented an endpoint (/record/video/search/{patientId}) that retrieves diagnostic videos for a given patient, providing detailed insights such as lesion location, signal heterogeneity, and mass effects from MRI scans.
AI-Generated Observations: The system analyzes retrieved images and generates AI-powered observations and potential differential diagnoses (e.g., glioma, metastasis) based on the visual characteristics, while cautioning users to seek professional medical interpretation.
Comprehensive Imaging Feedback: For each patient, we deliver a comprehensive diagnostic result, including additional considerations like possible midline shifts, surrounding edema, and recommendations for further investigation, improving clinical decision-making.
This forms the foundation for leveraging advanced image recognition and diagnostic support in medical contexts.
What we learned
- ZK Proofs in Healthcare: Zero-knowledge proofs can protect patient privacy while enabling secure record verification in healthcare.
- Importance of Privacy: In regions where trust in health information systems is low, ensuring privacy through cryptography can drive adoption.
- Challenges of Integration: Integrating advanced technologies like AI and ZK proofs into existing healthcare systems requires thoughtful design to ensure usability and efficiency.
- Global Potential: This solution applies to western and sub-Saharan Africa and can improve healthcare data privacy globally, especially in developing nations.
- Data Store: Learnt to provision a RAG using Google Cloud Agent builder.
- Docker: We learned how to provision Docker images. The application can be built and run with docker-compose.
Update
We are working towards publishing a docker container to Google Container (Qwiklabs).
References
- Adoption of electronic medical records in developing countries—A multi-state study of the Nigerian healthcare system - Akwaowo CD, Sabi HM, Ekpenyong N, Isiguzo CM, Andem NF, Maduka O, Dan E, Umoh E, Ekpin V, Uzoka FM. Adoption of electronic medical records in developing countries-A multi-state study of the Nigerian healthcare system. Front Digit Health. 2022 Nov 21;4:1017231. doi: 10.3389/fdgth.2022.1017231. PMID: 36479191; PMCID: PMC9720323.
Built With
- assembly
- c++
- circom
- circomlibjs
- dialogue-flow-messenger
- docker
- express.js
- gemini
- gemini-api
- google-agent-builder
- groth16
- iden3
- mongodb
- postman
- snarkjs
- solidity
- typescript
- vercel
- vision
- vite
- winston

Log in or sign up for Devpost to join the conversation.