4 ms·
Similar to many Mastercard/Visa cards. The electronic chip on the card is capable of actually storing the balance and then syncing it back when it reaches a ter
by louwhopley 6y ago
Similar to many Mastercard/Visa cards. The electronic chip on the card is capable of actually storing the balance and then syncing it back when it reaches a terminal machine that’s connected to the internet.
In my experience, many (most) chip-card based transport systems for busses or trains (eg tap n go) operates in this offline mode where it only syncs when you go to the kiosk to top it up.
It uses cryptographic methods to securely store and update the balance. The chip itself is an embedded processor.
- sargun 6y agoHow do you solve the FLP problem? e.g. Kiosk->Device: Give me $100 Device: Subtract $100 from myself Device->Kiosk: Send $100 (fail) Alternatively, what if this happens the other direction?
- wyattpeak 6y agoAtomic transactions, as with any database. After sending the money, confirm that it arrived. If it didn't, undo the subtraction. That said, shoddy implementations of these systems often do fail in numerous ways. As an end-user, you really just have to live with it.
- sargun 6y agoWhat protocol guarantees that there is an atomic transaction, in the presence of faults, in such a system?
- lmz 6y agoThose cards typically store the last few transactions (e.g. [0] is an Android app that can display transit card usage history), so it should be possible to code idempotency into the card firmware. [0]: https://play.google.com/store/apps/details?id=com.codebutler.farebot https://play.google.com/store/apps/details?id=com.codebutler...
- texse 6y agoTechnically FLP impossibility only applies to deterministic algorithms, not randomized ones, otherwise no consensus protocol would work. So you could imagine a complicated technical solution that could work (eg. treating everything as a big Raft cluster and using Raft's membership changes every time a device is connected / disconnected). In practice the solution is to realize that failures are rare (especially compared to events like the soldier simply misplacing the card), and to have a trusted human available to resolve any issues that do occur.