Crypto native tap to pay between wearable and POS
Rozo enables a customer to make payment to a merchant with crypto. To improve the experience, we introduce Tap to Pay via Rozo (not Visa).
The customer and the merchant need to have the supported infrastructure for tap to pay. On the merchants side, it needs POS terminal that follows Rozo protocol.
The tap to pay system is built on the technologies below:
- NFC Data Exchange Format (NDEF)
- Replay protection using counters
- AES encryption and AES-CMAC for security
The point-of-sale (POS) will read a NDEF message when customer tap. The NDEF will change with each use.
Example URL format: https://tap.rozo.ai?d=A3EF40F6D46F1BB36E6EBF2314D4A432&c=F459EEA788E37E44
- d: stands for decrypto. It's the SDM Meta Read Access Key value, decrypt the UID and counter with AES
- c: value and the SDM File Read Access Key value, check with AES-CMAC
- the UID and counter is used on the Rozo service to verify that the request is valid
This repository contains a reference implementation of the Rozo Tap to Pay system, including:
- Crypto modules for encryption and verification
- NFC message handling
- Client device simulator
- POS terminal simulator
- Server-side payment verification
- Node.js (v14 or higher)
- npm or yarn
git clone https://github.com/yourusername/rozo-tap-to-pay.git
cd rozo-tap-to-pay
npm installnode src/demo.jsThis will simulate a complete payment flow including:
- Customer tapping their device
- POS terminal reading the NFC data
- Server verifying the payment
- Replay attack prevention demonstration
npm startThe server will start on port 3000 by default. You can change this by setting the PORT environment variable.
npm testThe implementation includes several security features:
- Encryption: Customer data is encrypted using AES
- Data Integrity: AES-CMAC ensures message integrity
- Replay Protection: Counter mechanism prevents replay attacks
- Secure Keys: Keys should be securely stored (not hardcoded as in this demo)
GET /tap?d=<value>&c=<value>- Verify a tap paymentPOST /generate- Generate new payment parameters for a device
This project is licensed under the MIT License.