This is our group project demonstrating how UPI payments could potentially work in completely offline environments (like basements or rural areas without internet).
The idea is that if you send someone money offline, your phone encrypts the payment and passes it via Bluetooth to nearby phones (a mesh network). The payment "hops" from phone to phone until someone walks into an area with internet, at which point their phone quietly uploads the transaction to the server to settle the payment.
This repository contains the backend server and a web dashboard that simulates this entire process.
-
Mesh Network Simulation & Dashboard We didn't use real Bluetooth hardware for this project. Instead, we built a mesh network simulator in core Java. We also built a simple HTML dashboard where you can see virtual phones gossiping payment packets to each other in real-time.
-
Cryptographic Security Since offline payments have to hop through random strangers' phones, security was a big concern. We implemented a hybrid encryption system using Java's built-in cryptography libraries (AES-256-GCM and RSA-OAEP). This ensures that the people carrying your transaction data cannot read the amount or tamper with the receiver details.
-
Duplicate Transaction Prevention (Idempotency) A major challenge we solved was concurrency. If two different phones happen to upload the exact same payment to the server at the exact same millisecond, the system might charge the sender twice. We solved this "duplicate storm" by building a thread-safe idempotency engine using Java's
ConcurrentHashMapand SHA-256 hashing to safely drop duplicate uploads.
- Java: Core logic, multithreading, concurrency, and cryptographic functions.
- HTML/CSS: Used for the frontend simulation dashboard.
You just need Java installed on your system.
On Windows:
mvnw.cmd spring-boot:runOn Mac/Linux:
./mvnw spring-boot:runOnce the server starts up, open your web browser and go to: http://localhost:8080
From the dashboard, you can create a test payment, run the gossip simulation to pass the packet around, and then force the "bridge" phones to upload it to the server.
This is an educational group project created for learning purposes.