Blockchain-based medical payments for patients who need care now, but cannot pay everything upfront.
MediFi is an XRPL-powered healthcare financing prototype that lets patients pay medical bills in installments while hospitals receive instant full payment through a liquidity provider layer.
In many developing countries, patients delay or skip treatment because of one simple barrier: upfront payment.
- Healthcare costs are often too high to pay in a single transaction.
- Families may have income, but not enough immediate liquidity.
- Hospitals still need full settlement before delivering care.
- Traditional credit access is slow, expensive, or unavailable.
MediFi bridges that gap with a decentralized payment flow on XRPL:
- Patients repay medical expenses in installments without interest.
- Hospitals receive instant full payment.
- Liquidity providers cover the upfront cost.
- Borrowing eligibility is protected with Zero-Knowledge Proofs.
- Identity is verified through the project’s IUD verification layer.
- Patient installment payments with no interest.
- Instant hospital settlement through XRPL-integrated payment logic.
- Liquidity provider funding system for upfront treatment coverage.
- Secure identity verification (IUD) before financing is approved.
- Zero-Knowledge Proof flow for borrowing eligibility.
- Vault system for fund management and controlled settlement.
The project is split into a web app, an API layer, and a ZK prover pipeline that handles private eligibility checks.
Patient Browser (Next.js / React)
|
v
Frontend UI + Identity Flow (IUD)
|
v
Backend API (Node.js / Express)
|
+--> XRPL Integration (payments, settlement, ledger checks)
|
+--> ZK Prover (RISC Zero zkVM)
|
+--> Vault / Liquidity Orchestration
|
v
Hospitals receive instant settlement
Liquidity providers absorb the upfront cost
Patients repay over time
- Frontend: React / Next.js interface for patients, hospitals, and liquidity providers.
- Backend: API and business logic, including XRPL transaction orchestration.
- XRPL: Payment rails for settlement and repayment tracking.
- Vault mechanism: Manages liquidity and treatment funding flows.
- ZK Proof layer: Generates and verifies proof of eligibility without exposing private data.
- Patient logs in to the MediFi app.
- Identity verification (IUD) confirms the patient profile.
- ZK Proof validation checks borrowing eligibility privately.
- Liquidity provider funds the treatment amount.
- Hospital gets paid instantly in full.
- Patient repays over time in smaller installments.
- XRPL for payment orchestration and settlement.
- TypeScript for frontend and backend logic.
- React / Next.js for the user interface.
- Node.js / Express for the API layer.
- RISC Zero zkVM for Zero-Knowledge Proof generation and verification.
- xrpl SDK for ledger and payment integration.
- zod and standard validation tooling for input safety.
git clone <your-repo-url>
cd <repo-folder>pnpm installCreate a .env file at the repository root. You can start from .env.example and fill in your values.
cp .env.example .envMinimum required variables:
PORT=3001
XRPL_NODE_URL=wss://s.altnet.rippletest.net:51233
PROTOCOL_WALLET_SEED=...
PROTOCOL_WALLET_ADDRESS=...
MLP_ISSUER_ADDRESS=...
NEXT_PUBLIC_BACKEND_URL=http://localhost:3001The ZK prover depends on Rust and the RISC Zero toolchain.
curl https://sh.rustup.rs -sSf | sh -s -- -y
source "$HOME/.cargo/env"
cargo install rzup --locked
rzup install rust
rzup install r0vm(cd XRPL-Hackathon/zk && cargo build -p medifi-zk-host --release)source "$HOME/.cargo/env"
pnpm dlx tsx src/app.tsIn a second terminal:
pnpm devMediFi is designed to make healthcare financing more inclusive and practical.
- Financial inclusion: patients can access care without needing full upfront cash.
- Access to healthcare: treatment is no longer blocked by immediate affordability.
- Real-world DeFi utility: blockchain is used for a concrete, high-impact use case.
- Transparency + privacy: XRPL settlement and ZK proofs help combine trust with confidentiality.
- Expand to more countries and currencies.
- Integrate with real hospitals and clinical billing systems.
- Improve risk models for borrowing eligibility.
- Add richer liquidity provider analytics and vault controls.
- Harden identity verification and on-chain auditability.
- [Nada] - Technical aspects
- [Sammie] - Pitch / Presentation
Built during an XRPL hackathon in about 36 hours, MediFi focuses on rapid prototyping, strong UX, and a real-world payment flow that can help unlock healthcare access with blockchain infrastructure.
pnpm dev
pnpm dlx tsx src/app.ts
cd XRPL-Hackathon/zk && cargo build -p medifi-zk-host --releaseThis project was created for hackathon/demo purposes. Add your preferred license before public release.