Skip to content
OffPay

OffPay

Tap Now, Chain Later — Offline USDC Payments

Created on 10th May 2026

•

OffPay

OffPay

Tap Now, Chain Later — Offline USDC Payments

The problem OffPay solves

Digital payments fail without internet — UPI, mobile wallets, and crypto all need connectivity. In rural markets, crowded festivals, and underground transit, millions can't transact during outages.

OffPay enables fully offline USDC payments via NFC tap-to-pay. Lock USDC into an on-chain vault on Polygon, pre-sign bearer vouchers, and pay by tapping phones — no internet on either side. Settlement auto-triggers when connectivity returns.

How it works

  1. Lock funds — Deposit USDC into OfflineVault on Polygon
  2. Pre-sign vouchers — Android app signs bearer vouchers using device's secp256k1 key
  3. Tap to pay — NFC HCE transfers signed voucher instantly to receiver phone or ESP32 reader
  4. Verify locally — Receiver verifies ECDSA signature + nonce + digest offline
  5. Auto-settle — Pending vouchers batch-settle on-chain via settleBearerBatch

Key features

  • Unified Android wallet — sender + receiver in one app, NFC HCE tap-to-pay
  • ESP32 POS terminal — RC522 NFC + Bluetooth bridge to merchant phone
  • P2P mesh replication — Google Nearby Connections gossips vouchers for redundancy
  • On-chain settlement — double-spend protection via usedVouchers mapping
  • Sybil-resistant handshake — ECDSA challenge-response for mesh peer auth
  • Key backup — PBKDF2 + AES-GCM encrypted backup with server-side pepper

Challenges we ran into

Voucher digest byte-identity across 5 platforms

The keccak256 hash must be identical in Solidity, JavaScript, Kotlin (sender), Kotlin (verifier), and C++ (ESP32). A single byte mismatch breaks signature recovery. We matched ABI encoding, EIP-191 prefix, and Keccak-256 (NOT NIST SHA3) across all five.

ESP32 Keccak-256 vs SHA3-256

mbedtls on ESP32 only provides NIST SHA3 (different padding from Ethereum's Keccak). We shipped a standalone Keccak-256 implementation — using the library's sha3 would silently break all signatures.

Offline double-spend prevention

Without a blockchain at tap-time, we combine:

  • Per-payer monotonic nonces (client-side + on-chain)
  • Pre-flight locked balance checks before settlement
  • On-chain usedVouchers mapping as safety net
  • Mesh claimAndWait so two backups don't settle the same voucher

Unified app architecture

Consolidated separate customer and merchant apps into one wallet handling NFC HCE send, NFC reader receive, ESP32 Bluetooth bridge, and mesh replication — single APK, single cryptographic identity.

NFC payload constraints

Android HCE APDU frames have strict size limits. Voucher JSON had to be carefully serialized to fit single-tap exchanges while preserving all cryptographic fields.

Tracks Applied (2)

Internet of Things

OffPay bridges physical and digital worlds through a custom ESP32-based NFC reader terminal: ESP32 with on-device secp2...Read More

Blockchain / Cybersecurity

OffPay is a blockchain-native offline payment system on Polygon. It uses an OfflineVault smart contract to lock USDC, is...Read More

Discussion

Builders also viewed

See more projects on Devfolio