AI agent on NEAR · hospital and university bills abroad
Kinwarden pays a family's hospital and university bills abroad under their own country's rules. It deals with the institution, the bank and the forms, and catches fraud. The money waits in a NEAR vault that pays only the verified institution, and only after the family approves the exact payment in their own wallet.
NEAR testnet and a sandbox of simulated hospitals, universities and banks. tUSDC is a test token; no real money moves. Figures come from the recorded test runs.
Why we built this
“When we went to Bangkok for medical treatment, we carried USD 10,000 in cash because nobody told us Pakistan's rules already allowed up to USD 50,000 to be sent straight to the hospital. When the bill passed USD 10,000, we were stuck.”
The rules weren't the problem. Not knowing them, the paperwork, the fees and the time pressure were. Families in Pakistan, China, Egypt, Nigeria, Bangladesh and many other countries with capital controls face the same thing when they pay for care or education abroad.
It works for days, across the hospital, the bank and your family, until every bill is paid and every refund is back.
It talks to the institution
Emails the hospital or university's verified desk, gets the estimate, the deposit deadline and the bank details.
It knows the rules
Checks your home country's regulations: limits, required forms, direct-to-institution rules. Every rule links to its source.
It picks the best route
Compares bank transfer, card and cash on total cost and arrival time, and explains the trade-off in one sentence.
You approve, it handles the rest
Nothing moves until you approve the exact payment in your own wallet. Then it tracks the money, checks the final bill and claims refunds.
On NEAR testnet
The agent runs on NEAR AI Cloud. The family's money sits in a NEAR vault that pays only a verified institution, and only after the family approves the exact payment. Even someone who takes over Kinwarden's server holds a key that can only propose.
The hospital is verified
Only the verifier can enroll an institution's account or authorize an invoice. Neither the agent nor the family can add a payee.
enroll_payee · authorize_invoice
The agent proposes
It names an authorized invoice and an amount. The recipient comes from the verifier's record, and the vault reserves the amount against the family's limits.
propose_payment
The family approves
Their own NEAR wallet signs the exact recipient, token, amount and hash. The agent's key cannot attach the deposit an approval needs.
approve_payment · 1 yoctoNEAR
The vault pays, or gives it back
The enrolled account receives exactly the approved amount. If the transfer fails, the money returns to the family's case once.
ft_transfer
Check it yourself, without a wallet or a key
Reads the public testnet: the receipt, the vault's record, the family's approval, the agent key's permissions, the deployed code and the log anchor.
node scripts/near/verify.mjsNEAR testnet by design: tUSDC is a test token with no value, and the hospitals are fictional, so no real institution receives funds. Every claim and the test that checks it: claim → test map.
The AI proposes. Deterministic code, the NEAR vault and your own wallet decide.
Verified accounts only
Bank details from any email or document are checked against a verified record before money can move.
Untrusted content stays data
Instructions hidden in invoices or look-alike emails are flagged, never followed.
Rules as code
Limits and forms live in versioned rule files, so a policy change is one line, not a new app.
Tamper-evident log
Every action is SHA-256 hash-chained, and the chain's head is anchored on the NEAR vault at each milestone. Any later edit is detected.
A key that can only propose
The agent's NEAR key may call three vault methods. It cannot approve, withdraw, move tokens, add payees or change its own permissions.
Emergency stop
Pause the vault or switch the agent off from your wallet. Pending proposals are released at once.
Each country's regulations are a rules file. The agent stays the same.
→
Pakistan → Thailand · medical treatment
SBP: USD 50,000 per case direct to hospital, Appendix V-68 form, card tax 0.5% from July 2026
→
China → United Kingdom · university fees
SAFE: USD 50,000 yearly quota, above it with proof of tuition, no splitting across relatives' quotas
→
Pakistan → United Kingdom · an offer through an agent
No tuition until the university itself confirms the admission; fees only to its own account
→
China → United Kingdom · a study agent promises guaranteed admission
Same check, plus no buying pounds in relatives' names to dodge the quota
Or upload any hospital or university bill from 13 countries: Kinwarden prices it under your home country's rules at once, and pays only after the bank has verified the institution.