🛡️ AEGIS — Zero-Knowledge Medical Escrow

"Health-verified money movement with zero medical data exposure on Midnight Blockchain."


💡 The Inspiration

When someone is fighting a serious illness, the last thing they should worry about is losing their privacy.

Today, to get insurance reimbursements or financial aid, patients are forced to disclose sensitive diagnoses (such as cancer or mental health records) and itemized bills to dozens of intermediaries. At the same time, health insurers lose over $100 billion annually to double-dipping fraud because strict privacy laws prevent them from cross-checking claim records across hospital silos.

Patients are trapped in an impossible dilemma:

Surrender your medical privacy, or forfeit the financial aid you need to survive.


🚀 The Solution: What We Built

We built AEGIS using Midnight Blockchain's dual-state privacy architecture to act as a cryptographic trust shield between patients, hospitals, and insurers:

  • 100% Private Claim Settlements: Patients prove their medical bill is authentic and policy-covered in under two seconds—without revealing patient identity, diagnosis, or exact bill amount to the public ledger.
  • Cross-Insurer Anti-Replay Protection: A deterministic one-way nullifier prevents the exact same hospital bill from ever being claimed twice across different insurers.
  • CuraCredit Confidential Loans: Patients qualify for emergency medical credit by proving their Debt-to-Income ratio is within policy limits (DTI ≤ 40%) inside a zero-knowledge circuit, without sharing bank statements or salary slips.

⚙️ Technical Architecture & How It Works

AEGIS leverages Midnight's Compact smart contract framework to enforce mathematical guarantees without data surveillance:

1. 🔐 Dual-State Privacy Enclaves

Private data—including patient private keys, raw diagnosis codes, itemized charges, and Merkle witness paths—is evaluated strictly inside client-device RAM.

Only cryptographic commitments reach the Midnight consensus ledger.

2. 🌳 ZK Merkle Proofs for Policy Coverage

The hospital issues a signed attestation leaf, while the patient proves in zero-knowledge that their diagnosis belongs to the insurer's authorized coverage Merkle tree.

The diagnosis code itself is never written on-chain.

3. 🔑 Deterministic Spent Nullifiers

When a claim is settled, AEGIS registers a one-way nullifier:

nullifier = H("aegis:nullifier" ‖ invoiceId)

This permanently marks the invoice as spent across all participating insurers without revealing the invoice UUID.

4. 💰 Coarse-Tier Privacy Envelopes

To prevent deanonymization via unique bill figures (e.g., $84,912.43 acting as a statistical fingerprint), payouts are bound to coarse tiers:

  • ≤ $50k
  • ≤ $100k
  • ≤ $300k

This ensures financial privacy while maintaining protocol solvency.


🌟 The Vision

AEGIS replaces weeks of invasive claims bureaucracy with instant cryptographic trust:

Public enough to audit with mathematical certainty, and private enough to protect human dignity.

Built With

  • compact
  • cryptography
  • css3
  • decentralized-finance
  • defi
  • fintech
  • gdpr
  • healthcare
  • hipaa-compliant
  • html5
  • javascript
  • medical-escrow
  • merkle-tree
  • midnight-network
  • node.js
  • nullifiers
  • privacy
  • smart-contracts
  • vite
  • web3
  • webcrypto
  • zero-knowledge-proofs
  • zk-snarks
  • zkir
Share this project:

Updates

Submission history