Inspiration
The inspiration for this project came from two main reasons: one being the great potential of the Midnight blockchain and a deep-seated interest in biomedical engineering. We saw a gleaming light in the world of modern medicine; we already have the technology to edit genes and treat/cure cancers but we still fail to connect the patients to their rightful trials because of a lack in trust. Seeing the 2024 healthcare data breaches, we came to the realization that the only way to protect patient data in the future is to never have collected it in the first place.
What it does
Veil is a "Privacy-First" clinical trial discovery engine. It allows a patient to upload their sensitive medical records to their own browser. Locally, an AI (Gemini 2.0 Flash) extracts their health profile and matches them against over 50,000 live trials from ClinicalTrials.gov. Once a match is found, Veil generates a Zero-Knowledge Proof (ZK-SNARK) on the Midnight blockchain. This allows a trial coordinator to see a "Verified Eligible" checkmark for a patient without ever seeing that patient’s raw medical data, psychiatric history, or identity.
How we built it
We build the app using a modern stack made for privacy and efficiency: AI Layer: Google Gemini 2.0 Flash for local extraction and eligibility screening. Blockchain: Midnight Network, utilizing Compact for our smart contracts to handle the zero-knowledge logic. Frontend: React and TypeScript, integrated with the Lace Wallet for on-chain proof submission. Data: A direct integration with the ClinicalTrials.gov V2 API to ensure every trial shown is real and currently recruiting.
Challenges we ran into
This was our first hackathon, meaning that the learning-curve was very very steep. We hit immediate roadblocks including learning how to use Git and Github itself, handshake between Midnight and our circuits, etc. We missed many hours of sleep to make progress within this project and had to resort to AI at times to help reduce workload.
Accomplishments that we're proud of
We are incredibly proud that we have successfully built a full "Patient Journey." Most blockchain projects come to halt at a simple "vault" but we were able to find a discovery engine that actually finds trials. Successfully generating our first proof on the Midnight main network is a precious moment we will never forget.
What we learned
We learned that "Privacy by Design" isn't just a buzzword—it's an architectural choice that requires rethinking the entire data flow. Most importantly, we learned about the grit required to ship a product. As beginners, we survived on caffeine and pure determination, even pulling an all-nighter to ensure that our vision for a more private medical future actually made it to the finish line.
What's next for Veil
Beyond this hackathon, we want to expand this product to medical firms all around the world and create a greater urgency for privacy within the industry. We also plan to be able to expand on the specificity of location options so that patients can find trials even nearer without having to reveal their exact address. The end goal is to turn Veil into the industry standard for trustless clinical recruitment.
Built With
- api
- claude
- css
- gemini
- html
- javascript
- typecript