Inspiration

More and more people keep their money in stablecoins: remote workers paid in USDC, travellers, people saving in dollars. But the shops around them, from a chai stall in Bengaluru to a café in Bangkok, take payment through local QR codes in local currency, and none of them takes USDC. Spending crypto at a shop today means getting a special crypto card, handling a seed phrase, or cashing out through an exchange first. I wanted paying with USDC to feel like paying with UPI: scan, tap, done.

What it does

GlobalPay is one wallet that turns the bank card already in your pocket into the key to your crypto.

  1. Your card is your key. Tap your own contactless debit or credit card on your Android phone to register it. The app keeps only a salted hash and the last 4 digits; the card number is never stored or sent.
  2. Scan the shop's QR. Any Indian UPI QR or Thai PromptPay QR. You see the price in USDC at the live rate.
  3. Tap and approve. Tap the same card, touch the fingerprint sensor, and the phone signs one gasless NEAR transaction.
  4. The shop gets local currency. The merchant is paid in rupees or baht and changes nothing: no new app, no crypto.

If the payout to the shop fails, the contract refunds your USDC.

How I built it

  • Settlement contract (Rust, near-sdk 5). USDC (NEP-141) arrives through ft_transfer_call with a quote the backend signs with ed25519. The contract verifies the signature on-chain (env::ed25519_verify), checks the payer, amount, expiry and one-time use, records the payment and logs a NEP-297 event. After the payout, settle sends the USDC to the treasury, or refund returns it to the payer.
  • Gasless payments. The phone signs a NEP-366 meta transaction. The GlobalPay relayer submits it and pays the gas, so users never need to hold NEAR.
  • Sign-in without a seed phrase. NEP-413 signed messages with the phone's ed25519 key, sealed by its fingerprint hardware where available.
  • Backend (TypeScript, Fastify, Prisma, PostgreSQL). It parses UPI and PromptPay QRs, prices USDC from Coinbase's public rate feed, signs quotes, relays meta transactions, indexes contract events and runs the payouts.
  • App (Flutter). QR scanning, NFC/EMV card reading, fingerprint approval, and live payment status with nearblocks links.
  • I built it with Claude Code as my coding assistant.

Challenges I ran into

  • Bank cards don't expose their keys to apps. EMV chips keep their cryptographic keys secret, so the app can't get a signature from the card. I made the card a possession factor instead: the app reads the card number (or the tag's UID) over NFC and compares a salted hash. A production version would bind the card through issuer tokenisation.
  • The emulator has no NFC. To demo the full flow, testnet builds offer a demo card. The real NFC reading code is built and tested.
  • NEAR Intents has no testnet, so I wrote my own settlement contract that holds the USDC until the local payout is confirmed.
  • A payout can end in "unknown". A payout whose outcome is unknown is never settled or refunded automatically; it waits for an operator to check.
  • QR edge cases. Testing found that a UPI QR with a repeated payee field could show one payee in the app while the backend paid another. The app now reads QR fields exactly like the backend.

Accomplishments that I'm proud of

  • Real payments on NEAR testnet, all visible on nearblocks: a ₹500 UPI payment approved with the card key, a ฿100 PromptPay payment, and a failed payout that was refunded.
  • One contract serves every currency: adding rupees needed no contract change.
  • 72 contract tests, 585 backend tests and 513 app tests passing.

What I learned

  • How NEP-366 meta transactions let an app hide gas completely.
  • How EMV cards talk over NFC, and what they will and won't reveal to an app.
  • That the hard part of crypto payments isn't the chain. It's the boundary with real money: payouts, uncertain outcomes and refunds.

What's next

  • Paying at bank card terminals with your phone, through a card-emulation partner.
  • More stablecoins after USDC.
  • More countries' QR networks: Vietnam's VietQR, Indonesia's QRIS and Brazil's Pix.
  • Real payout partners, then mainnet.

Testnet only: the UPI and PromptPay payout partners and KYC are simulated, and no real money moves.

Built With

Share this project:

Updates

Submission history