Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Yes, and once you get the programmer to realize this, it all makes sense.

The ledgers are not the source of truth. No: this is a journaled filesystem; the transaction log is the ultimate source of truth. When you detect faults you recover from the journal, if something isn't completely written into the journal then it does not exist. The zero-sum property exists on every individual transaction and each transaction has an ID and the ledgers point at these IDs for auditing purposes.

So why have the zero sum property? Well, for one thing, it creates a uniform access model, I can't just credit my account, I have to debit someone else's account and they can have rules that might prohibit me from doing so. By carefully setting up these accounts you can also do what's sometimes called "behavior anomaly detection."

So for instance normal financial cards kind of work by opening up your entire wallet to a cash register and asking the cash register to pull out exactly the amount that you owe, understandably this might not be desirable if you are tracking some in-game-gold transactions in an internet game. You can get as elaborate as you want but think for example of a quick-consistency-check rule saying that “accounts starting 4xxx (player balances) never transfer directly to each other, instead users are expected to put the exact sum of money plus a little 5% padding into one of their 5xxx accounts and then give someone else a token permitting them to withdraw from that account." Stuff like that. A developer tries to code something up that doesn't go through this process and runs into errors in testing and has to conform their code’s behavior to the less risky process so that nobody is ever opening their entire wallet to a griefer.



The zero sum property also makes it really easy to just add up along (any subset of) each column and find most errors. Not so important now when everything's stored in a computerized database anyway, but a lot more relevant to actual books with actual writing in them.




Consider applying for YC's Winter 2026 batch! Applications are open till Nov 10

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: