Last updated 4 months ago
Telemedicine faces rising prescription fraud because digital prescriptions are easy to forge, lack secure verification, and provide no tamper proof audit trail for hospitals.
We will build a zero-knowledge system where doctors issue encrypted prescriptions, patients store them privately, and pharmacies verify authenticity without seeing any medical data.
Please provide your proposal title
Midnight MedicZK: Privacy-Focused Prescription Verification
Please specify how many months you expect your project to last
3
Please indicate if your proposal has been auto-translated
No
Original Language
en
What is the problem you want to solve?
Telemedicine faces rising prescription fraud because digital prescriptions are easy to forge, lack secure verification, and provide no tamper proof audit trail for hospitals.
Supporting links
Does your project have any dependencies on other organizations, technical or otherwise?
No
Describe any dependencies or write 'No dependencies'
No dependencies
Will your project's outputs be fully open source?
Yes
Please provide here more information on the open source status of your project outputs
The project will be fully open source and licensed under the MIT License. All core components, including the ZK prescription proof circuits, Compact smart contracts, and verification toolkits, will be made available through a public GitHub repository throughout the entire project lifecycle. This ensures transparency for the privacy mechanisms, enables community audits, and facilitates easy adoption for future healthcare integrations.
Please choose the most relevant theme and tag related to the outcomes of your proposal
Healthcare
What is useful about your DApp within one of the specified industry or enterprise verticals?
In the Healthcare vertical, "Midnight MedicZK" solves the critical conflict between digital convenience and patient privacy.
Currently, the rise of telemedicine has created a "silent crisis" of prescription fraud, where pharmacies are forced to rely on easily forged PDFs, screenshots, or emails. Existing verification methods require exposing full patient medical history, violating privacy principles.
Our DApp is useful because it utilizes Midnight’s Zero-Knowledge technology to decouple verification from data exposure:
By building on Midnight, we transform prescriptions from static images into programmable, privacy-preserving assets, creating a safer and more efficient standard for the entire healthcare industry.
What exactly will you build? List the Compact contract(s) and key functions/proofs, the demo UI flow, Lace (Midnight) wallet integration, and your basic test plan.
We will develop a comprehensive, end-to-end decentralized application (DApp) consisting of the following four technical components:
1. Compact Contract(s) & Functions
2. Zero-Knowledge Proofs (Key Constraints) We will implement ZK circuits that prove the following statement: "I possess a valid digital signature from a registered Doctor for this prescription hash."
Public Inputs: Doctor's Public Key, Prescription Hash (Nullifier).
Private Inputs (Shielded): Patient Name, Medication Details, Disease Diagnosis.
Output: Boolean (Valid/Invalid).
3. Demo UI Flow (React + TypeScript)
Doctor Portal: A web dashboard where doctors login via wallet, input Rx details, and the system generates a unique hash to send to the patient.
Patient Portal (Vault): A mobile-responsive view where patients see their shielded Rx and click "Generate Proof" to create a QR code for the pharmacy.
Pharmacy Portal: A scanner interface that calls verify_proof() on-chain and returns "Valid" or "Used".
4. Lace (Midnight) Wallet Integration
Connection: All three portals will utilize the Lace wallet dApp connector.
Transaction Signing: Doctors sign to issue; Patients sign to generate ZK proofs; Pharmacies sign to verify (on-chain state check).
5. Basic Test Plan
Circuit Tests: Verify that proofs fail if inputs (e.g., doctor signature) are invalid.
Double-Spend Tests: Attempt to use the same prescription hash twice to ensure the contract blocks it.
Privacy Leaks: Audit logs to ensure no PII (Personally Identifiable Information) is visible on the public testnet.
UI/UX Flow: End-to-end testing of the Patient $\rightarrow$ Pharmacy handover using Lace on the Midnight Devnet.
How will other developers learn from and reuse your repo? Describe repo structure, README contents, docs/tutorials, test instructions, and extension points. Which developer personas benefit, and how will you gauge impact (forks, stars, issues, remixes)?
1. Repository Structure We will maintain a monorepo architecture for easy cloning and deployment:
/compact-contracts: Source code for the prescription verification logic.
/zk-circuits: The privacy-preserving constraint logic (e.g., proof of signature).
/frontend: The React/TypeScript web portals (Doctor, Patient, Pharmacy).
/docs: Comprehensive technical documentation and architecture diagrams.
/tests: End-to-end integration tests for the Midnight Devnet.
2. Learning Materials (README & Docs) Our documentation will be designed for rapid onboarding:
3. Developer Personas Benefiting
4. Measuring Impact We will gauge success through tangible developer engagement metrics:
Please describe your proposed solution and how it addresses the problem

We are proposing to build Midnight MedicZK, a privacy-focused prescription verification prototype designed to eliminate fraud in telemedicine without compromising patient confidentiality. The problem we solve is the "trust crisis" in online healthcare: pharmacies currently rely on easily forged PDFs or screenshots, while genuine verification methods would require exposing sensitive patient history, which violates privacy laws.
Our Approach - The ZKP Pattern: Instead of relying on static documents or centralized databases (which are vulnerable to hacks), we will use Midnight's Compact language to implement a Zero-Knowledge Proof (ZKP) circuit. This circuit will take a doctor’s digital signature and the prescription details as a private input and the verification request as a public input.

The Output: The output will be a cryptographic proof (the ZKP) that confirms the statement: "This user holds a valid, unspent prescription from a licensed doctor" without revealing the medication name, patient diagnosis, or personal identity. This proof is then submitted on-chain and verified instantly by the pharmacy's portal.
Why Unique & Why Midnight/Compact is Essential: The uniqueness lies in the decoupling of verification from data access. Midnight’s Compact contracts provide the necessary primitives to natively construct "Shielded Vaults" where patients retain custody of their data. This functionality is not possible on Ethereum or Solana (where data is public) or traditional Web2 systems (where data is siloed and hackable). By building this, we provide a foundational template demonstrating how the Midnight ecosystem can support HIPAA-compliant, privacy-preserving interactions between patients, doctors, and pharmacies.
Target Audience:
End-Users: Patients who demand full control over their medical data and protection from identity theft.
Institutional Users: Online pharmacies and Hospitals that need a liability-free, instant way to audit prescriptions without handling toxic data.
Developer Persona: Blockchain developers and Healthcare IT engineers. Our repository will serve as the clearest example of how to implement the "Selective Disclosure" pattern for regulated industries.
Please define the positive impact your project will have on Midnight ecosystem
Positive Impact on Midnight
How Success Brings Value
Measuring Impact
What is your capability to deliver your project with high levels of trust and accountability? How do you intend to validate if your approach is feasible?
Why Medinest can deliver this project
Medinest has deep technical and healthcare domain expertise:
Core Technical Capability
Clinical Feasibility
Medinest collaborates with multiple well-known hospitals in Hyderabad to test:
Enterprise Backing
Official partnership with RisenSun Digi, strengthening:
Website: https://risensundigi.com/
Conclusion:
Medinest has the technical, clinical, and operational capability required to deliver a ZK-powered, privacy-preserving prescription verification system in 3 months.
Please provide a cost breakdown of the proposed work and resources
.png)
Resource Allocation Explanation
How does the cost of the project represent value for the Midnight ecosystem?
Low Cost, High Tech Impact For just 8,000 USDM, Midnight receives a fully functional Healthcare ZK Primitive. We are able to deliver this full prototype at such a low cost because we leverage Midnight’s built-in privacy and attestation layers, which drastically reduces development time compared to building from scratch on Ethereum or Solana.
Open Source ROI & Reusability The ZK patterns we are building (specifically "Selective Disclosure") are generic and reusable. A future developer building a "Proof of Salary" or "Proof of Age" DApp can copy approximately 80% of our code, saving the ecosystem thousands of dollars in future R&D time.
Strategic Enterprise Showcase This project delivers a regulation-friendly use case (HIPAA/GDPR compliance) that the Midnight team can use to pitch real-world adoption to enterprise partners in the insurance and medical sectors.
I confirm that the proposal clearly provides a basic prototype reference application for one of the areas of interest.
Yes
I confirm that the proposal clearly defines which part of the developer journey it improves and how it makes building on Midnight easier and more productive.
Yes
I confirm that the proposal explicitly states the chosen permissive open-source license (e.g., MIT, Apache 2.0) and commits to a public code repository.
Yes
I confirm that the team provides evidence of their technical ability and experience in creating developer tools or high-quality technical content (e.g., GitHub, portfolio).
Yes
I confirm that a plan for creating and maintaining clear, comprehensive documentation is a core part of the proposal's scope.
Yes
I confirm that the budget and timeline (3 months) are realistic for delivering the proposed tool or resource.
Yes
I Agree
Yes
Prajwal K - Founder & CEO
LinkedIn: https://www.linkedin.com/in/prajwal-k-901102361/
Amaan Khan - CTO & Lead Researcher
LinkedIn: https://www.linkedin.com/in/amaan-khan-x/
Medinest Technical Team
Medinest has:
Medinest collaborates with multiple well-known hospitals, clinics in India for validation and testing of this prescription system.
Website: https://www.medinest.life/
Email: medinest.life@gmail.com