DEV Community

PV-J
PV-J

Posted on

Why UPI Fraud Is a Temporal Logic Problem (and How PLCs Solved It 50 Years Ago)

UPI fraud detection is probabilistic and post-authorization. The money moves, then a model scores it 0.73 and a fraud analyst looks at it in two days.

That's a power plant that checks the boiler after it explodes.

In 1981, IEC 61131 defined the PLC. The core principle: a hard fault gets a hard response. No probability. No score. The interlock trips, and the machine stops. Same input → same output → every time → forever.

I applied that principle to UPI payment events.

fraud-watchdog is a ~300+ line Python library that checks three axes for every payment:

Axis What it checks Example trip
Velocity Dwell times, transaction rate Payment confirmed in 4 s after "arrest" call
Sequence Required event order Screen-off → resume without re-auth
Context Time-of-day, device state 18 s burst at 3 AM, outside user's active window

8 scenarios. 6 tripped. 2 passed. Zero false positives.

No ML. No GPU. No cloud. Runs on a ₹6,000 phone.

Video: [https://youtu.be/AGleG9RFQz0]

Repo: [https://github.com/PV-J/fraud-watchdog]

Phase 2 is community-driven. File an issue with your own scam scenario and I'll add it.

Top comments (0)