Last updated 5 months ago
Developers lack reference DApps on how to use Compact for privacy-first screening, such as in the medical domain where user data must remain confidential.
A reference DApp demonstrating Compact private calculations, range checks, and selective disclosure, showing how to process patient data with reusable extensible patterns for other use cases.
Please provide your proposal title
Privacy-First Medical DApp Powered By Compact
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?
Developers lack reference DApps on how to use Compact for privacy-first screening, such as in the medical domain where user data must remain confidential.
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
Apache 2.0. Fully open source.
Please choose the most relevant theme and tag related to the outcomes of your proposal
Identity & Verification
What is useful about your DApp within one of the specified industry or enterprise verticals?
Screening flows are everywhere (in health, finance, government, compliance, AI, and more) but they usually require users to hand over sensitive data to companies that may store or repurpose it for analytics, marketing, or general data collection. At the same time, genuine organizations still need a reliable way to verify whether someone meets specific criteria without risking privacy concerns. Our reference DApp shows how Compact and Midnight bridge that gap: users keep their data private while proving eligibility, and organizations see only the minimum information needed to make a decision. While the DApp focuses on medical use case, the same pattern directly applies to financial loan pre-qualification, research study eligibility, and so many other workflows where decision logic must remain private yet verifiable.
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 build a reference DApp that performs an eligibility screening for a basic surgical procedure. The user fills out a simple form containing weight, height, age, two consent statements, and a selected list of allergens. These inputs determine whether they meet the surgery eligibility requirements: normal BMI range, age between 18–60, correct consent phrases, and no latex allergy. All inputs are private by default, and only the final eligibility result is revealed.
Under the hood, our solution will use a Compact smart contract composed of multiple circuits: for BMI calculation, for range checks, for consent validation, and for allergen detection. We use opaque ADTs to keep the patient form hidden, a witness to provide private inputs, and selective disclosure to reveal only the eligibility boolean and a short reason code. The contract showcases core Compact patterns: private computation, Boolean logic, list operations, and selective disclosure suitable for high-privacy domains like medical and finance.
We will include a demo UI that lets a user fill a form, sign with the Lace (Midnight) wallet, and submit the transaction to run the eligibility circuit. The test plan covers: verifying each circuit with sample inputs, confirming witness handling, ensuring the disclosed fields match expectations, and checking that the ledger only shows the allowed outputs (eligibility + reason) while all sensitive data remains fully confidential. The final repo will include tests showcasing these privacy features end-to-end.
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)?
Our repository will be organized to prioritize learnability. We will provide a top-level README explaining the contract architecture, how opaque types and witnesses work, how each circuit (BMI, age, consent, allergens) is composed, and how selective disclosure is implemented. Additional docs will walk developers through extending the form such as adding new fields like a name or medical history, adding new circuits to the screening logic, and modifying what is revealed through explicit disclosure. Tutorials will include how to run the contract locally, execute tests, inspect ledger outputs, and understand which parts of the data remain private. Clear test instructions and inline comments will highlight Compact patterns developers can reuse in their own DApps.
We target beginner to mid-level Compact developers, those who have completed the Hello World example and are searching for a realistic, end-to-end reference demonstrating core language features. We will measure impact through Github stars and forks, which directly indicate whether developers are reusing and adapting the patterns. If timing and coordination allow, we will also attempt to upstream this medical reference DApp into create-mn-app so new builders can use it as a selectable template.
Please describe your proposed solution and how it addresses the problem
We propose a reference DApp that fills the gap in practical Compact examples by implementing a full privacy-first medical screening workflow, an ideal use case because it naturally exercises core Compact features such as private computations, range logic, list evaluation, selective disclosure, and opaque data handling. Developers will see an end-to-end pattern: a real Compact contract, a witness-based private input flow, a working UI with Lace (Midnight) wallet interaction. The accompanying documentation and tests act as a step-by-step guide, showing how each component fits together, giving devs a complete example they can run, study, and extend to their own domains.
Please define the positive impact your project will have on Midnight ecosystem
Our reference DApp strengthens the Midnight ecosystem by lowering the barrier for new developers and expanding the catalog of privacy-centric use cases. By offering a comprehensible example, with a real Compact contract, UI flow, wallet integration, and clear documentation, we make it easier for builders to understand how programmable privacy actually works in practice. High-quality reference material is what drives sustained developer adoption in any ecosystem, and Midnight is no exception. As privacy becomes the next major frontier for innovation across many sectors, providing a clean, reusable template accelerates experimentation and helps developers confidently take their early steps in the world of privacy-preserving applications using Midnight.
Medical DApps in particular represent one of the strongest real-world cases where data must be inherently private while still being shareable across institutions and borders. Patient records, diagnoses, and treatment histories cannot be exposed, yet the ability to selectively reveal information to authorized clinicians, insurers, and researchers is critical for effective care. Programmable privacy enables this exact balance: globally interoperable data exchange without sacrificing confidentiality. Eligibility screening, such as determining whether a patient qualifies for certain treatments, insurance coverage, or clinical trials, is only one of many practical use cases in this domain, and Midnight’s privacy-first architecture has the potential to be the leading platform that supports these workflows.
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?
Our team at Bamboo Labs has a proven track record on blockchain projects shown by our successful completion of all milestones for the Deep Funding grant (https://deepfunding.ai/proposal/sign-language-translator-ai-slta/)) (the public site has not yet reflected the actual completion status). This provides verifiable proof of accountability in executing grant-funded technical deliverables. In terms of feasibility, Bamboo Labs is composed of seasoned software engineers who have already explored Compact, validated its core primitives, and confirmed that the proposed workflow is feasible to implement within Midnight’s architecture. The community can review our LinkedIn profiles and GitHub to further validate our capability and technical credibility.
Please provide a cost breakdown of the proposed work and resources
We propose a total budget of 10,000 USDM, allocated as 4,000 USDM for Milestone 1 (smart contract development), 4,000 USDM for Milestone 2 (UI and wallet integration), and 2,000 USDM for Milestone 3 (documentation, tutorials, and testing). The funds will be used to compensate the two Bamboo Labs engineers for their technical development hours. Regular updates on project progress, milestone completions, and demos will be shared through Bamboo Labs’ social channels to maintain transparency and Midnight community engagement.
How does the cost of the project represent value for the Midnight ecosystem?
We believe this project delivers strong value to the Midnight ecosystem by introducing new developers to the possibilities of programmable privacy. The medical use case teaches fundamental Compact patterns while inspiring developers to rethink how applications can handle sensitive data responsibly. As privacy-oriented platforms like Midnight gain traction, supporting educational developer materials is critical to sustaining ecosystem growth. The proposed budget is allocated solely for code development by a proven, grant-winning team, fully aligning with the Midnight category’s goal of producing reusable and complete reference DApps.
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
Bamboo Labs consists of two core contributors for this project:
LinkedIn: https://www.linkedin.com/in/fitra-rahmani
GitHub: https://github.com/khasyah-fr
With 3 years of full-stack and Web3 development experience, Khasyah will lead the Compact smart contract implementation and front-end integration.
LinkedIn: https://www.linkedin.com/in/khresna-pandu/
GitHub: https://github.com/KhresnaPanduI
With 3 years of experience in research and AI engineering, Pandu will help develop the Compact smart contract and produce clear, developer-focused documentation and tutorials.