News for hackers. Stuff that matters.
Re:Eagle Cash by louwhopley on Friday January 01, 2021 @03:43AM (#25601789)
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.

Re:Eagle Cash by sargun on Friday January 01, 2021 @04:14AM (#25601909)
How 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?

Re:Eagle Cash by lmz on Friday January 01, 2021 @05:20AM (#25602223)
Those 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...

Re:Eagle Cash by texse on Friday January 01, 2021 @07:45AM (#25602877)
Technically 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.

Re:Eagle Cash by wyattpeak on Friday January 01, 2021 @05:17AM (#25602210)
Atomic 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.

Re:Eagle Cash by sargun on Friday January 01, 2021 @05:57AM (#25602359)
What protocol guarantees that there is an atomic transaction, in the presence of faults, in such a system?