ProxyPay is a location-based transaction validation system that prevents fraudulent credit card transactions by verifying the cardholder's phone location against the transaction location. This hackathon project demonstrates how geospatial validation can enhance payment security while maintaining user privacy.
-
Backend API (Flask/Python)
- β
Transaction validation endpoint (
/api/transaction/validate) - β
Card registration endpoint (
/api/card/register) - β Geospatial distance calculation using Haversine formula
- β Swagger API documentation
- β Mock user location database
- β
Transaction validation endpoint (
-
Frontend POS Simulator (HTML/JS)
- β Transaction form with location input
- β Preset location buttons (Harvard, MIT, NYC, SF)
- β Real-time geolocation integration
- β API integration with backend
- β Responsive UI with modern design
-
Geospatial Validation Engine
- β Distance calculation between phone and transaction locations
- β Configurable distance thresholds (default: 0.25 miles)
- β Validation logic with detailed reasoning
Based on the detailed app description, you need to implement:
- Mobile App (React Native/Expo) - HIGH PRIORITY
- Cryptographic Security Layer - HIGH PRIORITY
- Real-time Communication System - MEDIUM PRIORITY
- Push Notification System - MEDIUM PRIORITY
- Metrics Dashboard - LOW PRIORITY
-
Device Keypair Generation
- Implement ECDSA P-256 keypair generation in mobile app
- Store private key in secure keystore (Android Keystore/iOS Secure Enclave)
- Export public key to server during registration
-
Digital Signatures
- Implement canonical JSON signing for transaction proofs
- Include
transaction_noncein signed payload to prevent replay attacks - Add signature verification in backend API
-
Device Attestation (Mock for Hackathon)
- Create mock attestation system for demo purposes
- Document that attestation is mocked for hackathon
- Plan for real attestation (Play Integrity/App Attest) for production
-
React Native/Expo Setup
- Initialize Expo project with TypeScript
- Install required dependencies:
react-native-keychain,expo-location,expo-crypto - Set up navigation and basic UI structure
-
Core Mobile Features
- GPS location collection with high accuracy
- QR code scanning for transaction nonces
- Keypair generation and secure storage
- Transaction proof generation and signing
- API integration with backend
-
Mobile UI Components
- Card registration screen
- Transaction approval interface
- Location permission handling
- Biometric confirmation for suspicious transactions
-
Backend WebSocket Server
- Add Socket.IO to Flask backend
- Implement real-time transaction broadcasting
- Handle mobile app connections
-
Frontend WebSocket Client
- Update POS simulator to use WebSocket
- Real-time transaction status updates
- Automatic mobile app notification
-
POS Transaction Creation
- Generate unique transaction nonces
- Broadcast transaction to connected mobile apps
- Display QR code with transaction details
-
Mobile App Response
- Auto-detect nearby transactions
- Generate location proofs with signatures
- Send proofs to backend for verification
-
Backend Push Service
- Integrate FCM (Firebase Cloud Messaging) for Android
- Add APNs support for iOS
- Implement push notification triggers
-
Mobile Push Handling
- Handle incoming push notifications
- Display transaction confirmation dialogs
- Process user approval/denial responses
-
Backend Metrics Collection
- Log transaction decisions and timing
- Track false-accepts avoided
- Measure time-to-confirm
- Count UX clicks per flow
-
Dashboard UI
- Create React dashboard for metrics visualization
- Display privacy metrics and data minimization
- Show success rates for each flow type
-
Demo Scenarios
- Co-located transaction (auto-approve)
- Different locations (push confirmation)
- Phone missing (fallback authentication)
-
Privacy Documentation
- Create privacy slide explaining data minimization
- Document retention policies
- Show user control options
# New endpoints to implement:
POST /api/register-device # Device registration with public key
POST /api/prove-location # Location proof submission
POST /api/confirm-transaction # Push confirmation handling
GET /api/metrics # Metrics dashboard datamobile-app/
βββ src/
β βββ components/
β β βββ LocationTracker.tsx
β β βββ QRScanner.tsx
β β βββ TransactionApproval.tsx
β βββ services/
β β βββ CryptoService.ts
β β βββ LocationService.ts
β β βββ APIService.ts
β βββ screens/
β β βββ RegisterScreen.tsx
β β βββ HomeScreen.tsx
β β βββ SettingsScreen.tsx
β βββ utils/
β βββ KeyManager.ts
β βββ Attestation.ts
// Example signature payload structure
interface LocationProof {
card_token: string;
transaction_nonce: string;
transaction_id: string;
location: { lat: number; lon: number };
timestamp: string;
attestation: string;
signature: string;
}- POS creates transaction at Harvard Campus
- Mobile app detects nearby transaction
- Generates location proof with signature
- Backend verifies distance < 15m β ACCEPT
- Transaction approved instantly
- POS creates transaction at Harvard Campus
- Mobile app is 500m away (different location)
- Backend returns CONFIRM_REQUIRED
- Push notification sent to mobile app
- User taps "Approve" β ACCEPT
- POS creates transaction
- No mobile app response within 30 seconds
- POS shows PHONE MISSING
- Fallback to manual verification
- Transaction approved with FALLBACK_AUTH
- False-accepts Avoided: Compare naive vs secure validation
- Time-to-Confirm: Measure transaction processing time
- UX Clicks: Count user interactions per flow
- Privacy Metrics: Data retention and minimization stats
- Success Rates: ACCEPT/CONFIRM/FLAG/FALLBACK counts
# Backend setup
cd backend/api
pip install -r requirements.txt
python app.py
# Frontend setup
cd frontend
# Open transaction-simulator.html in browser
# Mobile app setup (when ready)
cd mobile-app
npm install
expo start- Replay Attack Prevention: Include transaction nonces in signatures
- GPS Spoofing Mitigation: Use device attestation + sensor fusion
- Privacy Protection: Ephemeral location data, minimal data collection
- Secure Key Storage: Platform keystore integration
- Set up React Native/Expo project for mobile app
- Implement cryptographic signing in mobile app
- Add WebSocket support to backend for real-time communication
- Create transaction nonce system in POS simulator
- Build mobile app UI for transaction approval
- Working mobile app with location proof generation
- Real-time POS simulator with WebSocket integration
- Secure backend with signature verification
- Demo scenarios showing all three flows
- Metrics dashboard with privacy information
- Demo script and presentation slides
Deadline: October 5, 2025 at 7:00 AM
Current Status: Basic backend and POS simulator complete, mobile app and security layer needed