Inspiration
We started from the case for Medicare for All. Everyone should be able to get care, with no one turned away.
Today, getting help with a hospital bill means going through three separate processes for insurance, the hospital’s own financial assistance, and charity. Each one has its own forms. Many patients give up partway, or never learn what they qualify for. We wanted the help to arrive at the moment the bill does, and to need nothing from the patient except a card.
What it does
OpenCare runs one hospital bill through every source of help, in order, and shows the patient a single bill that shrinks at each step.
From one CareCard tap to a smaller bill
- The visit is billed. Hospital staff ring up the visit on the OpenCare kiosk, an iPhone app, and the patient taps their NFC CareCard. The bill also appears on the patient’s own Nessie account.
- Insurance pays its share. Deterministic math applies the plan’s deductible, coinsurance, and out-of-pocket maximum.
- Hospital assistance reduces the balance. OpenCare checks the patient against every assistance policy the hospital offers, such as charity care, a self-pay discount, and a catastrophic cap. It prepares an application for each policy that fits. Each reduction comes off what the previous one left, so nothing is counted twice.
- The community fund takes up what’s left. The remaining balance becomes a fund request. Everyone is eligible. A fixed, published need formula only decides who is seen first. It uses income against the poverty line, cost burden, insurance status, and wait time, and never uses protected attributes or diagnoses.
- A caseworker decides. Gemini writes a short brief covering the bill’s path, why the request ranks where it does, and any flags. Every number in the brief is checked against the case. The caseworker also sees 90 days of the patient’s Nessie activity as monthly totals. They approve the full balance or part of it, or decline.
- The hospital gets paid, and the chain records it. Approval pays the hospital from the fund’s Capital One Nessie account. Our program on Solana devnet records the approval once per case, only for an attested hospital and within the published grant limit. It then marks the case paid with a fingerprint of the Nessie payment. A memo receipt carries the same fingerprint so anyone can match the bank record to the public one.
- The patient sees the result. They sign in on their own phone with a card tap or their account ID and see what was paid and what’s left. They can pay the rest from their own Nessie checking, or spread it over an interest-free plan of 3, 6, or 12 months through a recurring Nessie bill.
Anyone can audit the money
The public ledger lists each paid case with its hospital, month, amounts, and receipt. Declines appear only as totals by reason. Patient names stay private.
The Verify page shows the fund program’s rules and decisions. A daily anchor seals the queue, the ledger, and the fund’s bank books in one devnet memo. A live check shows whether the two rails agree.
Donors can give devnet SOL or USDC by QR code through Solana Pay or through a shareable Blink, priced using Pyth’s on-chain SOL/USD feed.
How we built it
- App. One Next.js 16 App Router and TypeScript app on Vercel. It holds the landing page, public ledger, Verify page, caseworker desk, patient portal, and API route handlers.
- Server logic. One workspace package per lane:
core,ai,payments, andcontracts. The route handlers stay thin. - Data. Tiger Data Postgres. Transactions, row locks, and unique idempotency keys enforce money state. The fund ledger is a TimescaleDB hypertable, and a continuous aggregate feeds the dashboard.
- AI. Gemini on Vertex AI writes the caseworker brief, the patient’s plain-language bill explanation, and the policy application text. A rule or template fallback backs every step.
- Banking with Capital One Nessie. The fund, every hospital, every donor, and every patient has a Nessie account.
- Hospitals are merchants, payouts are purchases, and donations arrive as deposits or transfers.
- The patient’s hospital bill is a Nessie bill that shrinks as each payer posts. Their payment and payment plan come from their own checking.
- Hospitals refund the fund by transfer.
- We use 90 days of deposits to cross-check stated income.
- Rules and proof on Solana devnet.
opencare_fundis our Anchor program in Rust. It holds the fund’s rules, hospital attestations, and one account per case. The server encodes its instructions by hand, so the web app needs no Anchor client.- Memo receipts link individual payouts to their bank records. Daily Merkle-root anchors seal the queue, ledger, and books.
- Solana Pay and Solana Actions (Blinks) handle donations, with Pyth’s SOL/USD price read on chain.
- Reconciliation. A route matches every payout, receipt, donation, and transfer across both rails, one to one.
- Hardware. NTAG NFC stickers in CareCards, read by a native SwiftUI kiosk app with Core NFC.
- Landing page. Three.js with rigged, compressed GLB portraits.
- Teamwork. Four people, each with an AI coding agent in its own lane. The agents coordinated on a GitHub issue used as a message board, with a preflight check before every push and merge. That added up to almost 300 commits in 36 hours.
Challenges we ran into
- Never paying twice on two rails. Double clicks, refreshes, and retries must not repeat a Nessie payout or a Solana receipt. We claim each grant atomically and record an idempotency key before calling Nessie. We sign the Solana transaction and save it before broadcasting, so a retry resends the same bytes. Anything uncertain is reconciled on the next read. On chain, each case’s account can only be created once.
- Nessie’s sandbox keeps whole dollars only. It silently drops cents, so a payment of $64.20 is stored as $64. Our records keep the exact approved cents, and the payout code and reconciliation account for what Nessie actually moved.
- Nessie never deletes anything. Re-seeding our demo history left 120 payouts that no longer have a grant. Reconciliation shows them as voided demo history so they remain visible.
- The price feed moved under us. At 5 AM, Pyth’s public price API started answering “unauthorized,” so we read the SOL/USD price account directly on chain.
- Rules change. One bill was larger than our first published grant limit, and the program refused it. We published a new rules version on chain, and each grant records the version it was approved under.
- Keeping Gemini honest. Every number in a brief or explanation must match the case data. If a number fails that check, the template appears instead.
- Prompt injection. Instructions hidden in a visit description, a policy, or a hardship note get flagged for the caseworker and change nothing.
- NFC on iPhone. Safari can’t read NFC tags from a web page, so we built a native kiosk app that reads the CareCard and opens the right screen.
- How public is public? We argued about what a real community fund could show. We settled on per-case amounts and receipts with patient data kept private, and declines shown only as totals.
Accomplishments that we're proud of
- One physical CareCard tap takes a bill to its final balance, with a sandbox payout and a public receipt behind it.
- All 306 paid grants match their Nessie payout and Solana receipt, checked live on the Verify page.
- A patient can prove their place in line from one public fingerprint of the whole queue, without seeing anyone else’s data.
- A person approves every grant. The formula only sets the order, and the AI only explains.
- The tampered request in the demo queue is flagged and moves nowhere.
What we learned
- Most of the work in moving money is in handling timeouts, retries, and the question “Did that go through?”
- AI is most useful here when it writes for the person making the decision and every number is checked against the case.
- Shared lanes and a message board let four humans and four agents ship in parallel without stepping on each other.
What's next for OpenCare
- Turn on the fund’s reserved Nessie account. It’s built but off in the demo. With it on, approvals move there before the hospital is paid, so “available” and “reserved” become real balances.
- Move fund oversight to shared governance. Move the program’s authority to a Squads multisig and the fund rules to Realms governance. Attest hospitals through the Solana Attestation Service and give donors compressed-NFT receipts.
- Add real hospital financial-assistance policies and appeals for declined requests.
- Pilot with one nonprofit hospital. Running its required community-benefit spending through the fund would give it an auditable record of every dollar.
Built With
- anchor
- capital-one-nessie
- core-nfc
- gemini
- next.js
- nfc
- postgresql
- pyth
- react
- rust
- solana
- solana-actions
- solana-pay
- swift
- swiftui
- three.js
- tiger-data
- timescaledb
- typescript
- vercel
- vertex-ai

