Hacker News new | ask | show | jobs
by lxgr 253 days ago
> But how do they prevent people double spending the same amount?

Both payment cards and merchant terminals (essentially also using embedded or removable smartcards) are tamper-resistant and hold symmetric keys only known to the payment scheme or issuer.

The terminal essentially creates a cryptographic secure channel between two smartcards, and they transactionally agree to decrement the balance on one, and increment the one on the other correspondingly.

The really neat thing is that this theoretically even works without the need for central accounts, and is as such very privacy friendly. (Practically, even just one key leaking would have catastrophic consequences though, and to detect whether that has happened, systems usually aggregate all transactions asynchronously and check money movements for plausibility.)

2 comments

Iiuc, you have to "transfer" the funds from your bank account to the card device (wallet, in a way) from where you can then spend these funds without interaction with the bank? That would work.

Otherwise, without the initial withdrawal from your bank account, you could spend the money twice.

Yes, only the issuer of the stored-value system can “create” funds, and they need to ensure that they do get paid for it without double spending.

That can be done using cash at a machine, with an online-authorized card transaction etc.

That works with a network. But as the period of disconnection grows, the uncertainty grows.
Yes, you’ll definitely want to avoid running such a system completely offline without bounds.