This document describes the NFC handshake, security constraints, and common troubleshooting steps for developers and beta testers.
Overview
- Roles: Writer (sender) and Reader (receiver).
- Format:
payment-request.v1JSON payload with non-sensitive fields only.
Handshake
- Writer prepares
payment-request.v1payload withidand optionalexpiresAt(epoch seconds). - Reader calls
useNfc().startReading()and waits for inbound payload. - On read, the app validates payload using
validatePaymentRequest()which enforces expiry and replay dedupe. - If valid, proceed to presentation/confirm UI. If invalid, surface mapped Spanish error copy.
Security rules
- Forbidden fields: secret, private, seed, token, passphrase, password, privKey, keyPair.
- Replay protection: 5-minute TTL dedupe window; duplicate requests rejected deterministically.
- Clock skew tolerance: 30s default; configurable in validator.
Platform notes
- iOS: Core NFC requires entitlement
com.apple.developer.nfc.readersession.formatsandNFCReaderUsageDescriptionin Info.plist. Only physical devices supported. - Android: Add
android.permission.NFCand handle foreground dispatch. Test on Pixel and Samsung-class devices.
Troubleshooting
- NFC Unavailable: ensure device supports NFC and app has permissions.
- NFC Disabled: ask user to enable in OS settings.
- Timeout: ask users to bring devices closer and retry.