Inspiration

Across much of Africa, hospitals ask for payment before treatment begins, and most families pay out of their own pockets. When a family can't pay, the appeal goes online: a photo, a story and a personal bank account number. Strangers want to help, but the first comment is almost always "Is this real?" Nobody can check whether the bill exists, which hospital it's at, or whether the money ever reached it.

Giving from abroad is worse. Cards issued outside Nigeria are often declined, and GoFundMe supports withdrawals in about 20 countries, of which South Africa is the only one in Africa. So help arrives slowly, or not at all, and genuine families are drowned out by scams.

We asked a simple question: what if the money never went to a person at all, only to the hospital that confirmed the bill, and anyone could check every payment? Ireti (Yoruba for hope) is our answer.

What it does

Ireti is medical fundraising on Bitcoin's Lightning Network. Every campaign is tied to a bill a verified hospital has confirmed, and money can only flow back to that hospital.

  1. A hospital registers with its licence number, issuing authority and country. The country sets the campaign currency: naira, cedis, shillings, CFA francs and the rest of Africa's 54 countries.
  2. Ireti verifies it: we check the licence, call the hospital's main number and test its Lightning address.
  3. A family opens a campaign for a specific bill.
  4. The hospital confirms the bill by ticking three checks (the bill exists, the amount, the patient is treated there). Only then does the campaign go live.
  5. Anyone, anywhere, donates over Lightning in seconds, for almost no fee. Every open page updates live.
  6. The hospital withdraws only to its own verified wallet. Each campaign has its own escrow.
  7. The hospital posts the receipt for the bill, and the family confirms the money arrived.

Anyone can check the public ledger and Ireti's proof of reserves: the escrow wallet must always hold at least what all campaigns are owed.

How we built it

  • App: Next.js 16 (App Router, Server Actions, Cache Components), React 19 and TypeScript. All money logic runs on the server; no secrets reach the browser.
  • UI: Tailwind CSS 4 and shadcn/ui on Radix, with Bitcoin Connect so donors can pay from any Lightning wallet by QR code.
  • Payments: Nostr Wallet Connect (@getalby/sdk) to our own Alby Hub Lightning node (LDK) on Bitcoin's Mutinynet test network. The escrow wallet has narrow, budgeted permissions; a separate wallet stands in for a hospital's own.
  • Ledger: Postgres (Neon) in production and PGlite locally. Database triggers make donations, the audit log and reserve snapshots append-only, and refuse any withdrawal larger than a campaign's balance.
  • Validation: Zod on every form and API, and LNURL checks with @getalby/lightning-tools.
  • Hosting: Vercel for the app; the Lightning node runs on an always-on Oracle Cloud ARM server, with its dashboard never exposed to the internet.
  • Testing: 47 Playwright end-to-end and security checks run the whole flow, and attack it, in a real browser against a production build.

Security was part of the design from day one:

  • Money can't go to a person: payouts go only to the hospital's verified wallet.
  • The ledger can't pay twice, and the database itself blocks overdrafts.
  • Receipt uploads are checked by their actual bytes and served under a sandbox policy.
  • Sign-ins are rate limited per connection and per account (spoofed X-Forwarded-For headers don't bypass it), sessions are signed, and changing an access code signs out other devices.
  • A strict Content-Security-Policy, HSTS and no framing; hospital-supplied Lightning addresses can't reach internal networks.
  • A wrong-network guard refuses invoices from another Bitcoin network, so a test deploy can't touch real money by mistake.

Challenges we ran into

  • Real payments without real money. We ran our own Lightning node on Mutinynet so every payment in the demo is a real Lightning payment, with test coins.
  • Proving the money is there. Reserves only mean something if the ledger can't be quietly edited, so we moved the money rules into the database itself.
  • 54 countries, 54 price tags. Campaigns are priced in local currency but donations arrive in sats, so every payment records both, at the rate of that moment.
  • Hosting a Lightning node for free. We moved the node to an always-on cloud server without losing its channel state.

Accomplishments that we're proud of

  • A complete loop that works today: hospital verification, a confirmed bill, a real Lightning donation, a withdrawal to the hospital's wallet, a public receipt and the family's confirmation.
  • 47 automated attack and flow checks, all passing.
  • A product designed for families in Kaduna that works the same in Dakar, Accra or Nairobi.

What we learned

  • Lightning is ready for small, fast, cross-border gifts. The hard part is trust, not payments.
  • Security is easier to prove when the database enforces it, not only the application code.
  • Nostr Wallet Connect makes it practical to give an app narrow, budgeted access to a wallet.

What's next for ireti

  1. Launch on Bitcoin mainnet with the same per-campaign escrow and public proof of reserves.
  2. Local-currency payouts to hospital bank accounts and mobile money, so hospitals are paid in naira, cedis, shillings or CFA without holding bitcoin.
  3. First partner hospitals, starting here in Kaduna.

Built With

Share this project:

Updates

Submission history