Double-entry bookkeeping as a directed graph
matheusportela.com
matheusportela.com
I get that this is supposed to be a simplification for educational purposes, but I find this is simplification is an oversimplification, since it omits the key point.
and bob is not even doing any bookkeeping. he is bookselling ;-)
Now each year your book loses 1/5th of its value, due to wear and tear (4$ disappearing from your assets-account), this is countered by your depreciation-account (4$ tax write off, every year!)
After 5 years, it is worth $0 according to your books, but you manage to sell it again for $10: your bank account gets debited for $10, while your capital-gains-account gets credited for $10
Perishable and consumable food wouldn't be counted as an asset in the first place. You spend the money - it's credited to your asset account (reducing the value of your cash-in-hand) and then debited from your expense account (reducing the value of your equity - or, in more layperson's lingo, increasing the total sum of the expenses you incurred during that period).
If an office buys snacks on Monday for the office party on Friday, they're not counting it as an asset and depreciating it on their books.
If food production or delivery were part of the core business, it would be one thing, but in the context that OP's talking about, it would be overkill at best (and fraudulent, in extreme cases) to try and count a transient consumable as an asset on their books.
Yeah, and as I said, this makes sense for a company for which food is a relevant part of their business, but in the context OP is asking about, nobody is tracking it this way.
Pretty small so I do the accounting as well, but I think I'd lose my mind if I had to record them into inventory. Then when they leave half the pizzas for the next day, I record that? No way.
-A_cash +A_inventory
-A_inventory + L_expenses
Sure, if your pizza is frozen and consumed in another period, your books will not reflect reality, but so what, when talking about the very basics of accounting you offset that misrepresentation of a simple example by gaining an important pedagogic benefit! Which one, though? What do you gain by denying that pizza is an asset, going so far as calling recognition of an asset as an asset a fraud (but only in extreme cases of 5 pizzas!) and bringing depreciation/core business in?
No, nobody does this. GP is engaging in an exercise in pedantry, under the guise that it serves some pedagogical purpose. Personally, I don't think it's particularly useful to teach people about how things could theoretically be done, when it's much easier to show then how things actually are, but I'm sure there is some accountant nerd out there who is extremely meticulously tracking the total value of the gumballs on the secretary's desk as they are consumed.
An account is fundamentally either an asset or a liability. When you buy something with a credit card, you've incurred a liability, and gained an asset, no matter what you've purchased. If you use a debit card or cash, you're trading one asset for another.
One of the basic asset categories is expenses. That's the confusing part! When you acquire an asset, which is consumed or otherwise has no book value, that's an expense.
So when you buy groceries with a debit card for a hundred bucks, that's a +100 in Expenses:Groceries, and a -100 in Assets:Checking. If you buy the same groceries with a credit card, it's +100 in Expenses:Groceries, and -100 in Liabilities:CreditCard. When you pay off the credit card, that's -100 Assets:Checking, and +100 in Liabilities:CreditCard.
Asset is overloaded here, because Expenses are not included in calculating net assets. It's confusing! I find it even more confusing that Income is a liability, which always gets lower. That's because whoever paid you had a liability to do so, which they met out of assets.
This is also why, when you pull a CSV of a checking account, purchases are positive numbers, and income is negative. A CSV of a credit card will have purchases as negative, and payments as positive. It's the difference between an asset account and a liability account. Again, not to be confused with net liabilities: Income is a liability, but not one you owe anyone, rather the contrary, Income just gets smaller and smaller (ideally! If it isn't getting smaller then your net assets will be shrinking, most of us can't afford that for long).
The main thing is that an account which fluctuates from zero to positive, or accumulates, is an asset account. One which fluctuates from zero to negative, or accumulates negatively, is a liability account. There are times when this matters, notably when you can take a tax deduction for expenses, that's a good example of why they're on the asset side of the books.
Assets + Expenses = Liabilities + Equity + Income
Expenses are not assets. For example, depreciation is not an asset. It is the representation of the life of the asset getting used up. It is an expense, a pure expense. Interest paid on a debt is not an asset. It is a pure expense. There are no word games that turn these into assets, like you might have for a software subscription or a gas bill.
Expenses diminish the business. Unlike assets, they do not represent anything that can be liquidated. Income increases the business. Unlike a liability, it does not represent a claim against the business.
Why aren't expenses and income on the balance sheet? Because they are netted out into retained earnings for the period. Imagine a business that cannot have a liability. Its accounting equation would simplify to:
Assets = Equity.
Income increases equity, expenses decrease it. Is equity a liability? NO. It is a separate account category with a credit balance. Want to look silly? Do as I did when I was a young programmer who knew everything and confuse the two.
People not learning bookkeeping before writing accounting software (which is a lot more software than people expect) make many dumb errors that frustrate users, bookkeepers and accountants. A decent bookkeeping book (e.g. Bookkeeping for Dummies) goes a long way to familiarizing someone with how to handle double entry accounting.
Liability accounts are tracked in reverse and are "credit normal". You increase the value (how much you owe) with a credit to the account and decrease the value (payments you receive) with a debit.
If you get money from somebody you "credit" them for giving you the money. You say "I must give you credit for having done this".
If money goes into your bank-account you don't credit your bank-account because money didn't come from there it went there. If you don't credit the bank account you must be doing something else and that is called "debit". When money goes to your bank-account you "debit" it because now the bank-account is more "indebted" to you. You don't have the cash in your wallet but the bank-account is indebted to you by that amount.
From the view-point of the bank-manager things are of course reverse. When you put money into your bank-account the bank-manager "credits" you-the-account (in their books) for having done so.
I guess a crucial thing to realize is that your bank-account in your books is a different thing from your bank-account in the books of the bank. It seems like there is only one bank-account, but two different parties (you and the bank) each have their own version of that "account" in their book-keeping system.
A double-entry book-keeping system is "subjective" in that it always describes things only from the viewpoint of whoever it is who is doing the book-keeping.
Indeed this is confusing to most people (myself included the first time I dealt with it), since if your phone company says they’re giving you a credit, you're getting money.
- where has it come from/has it forever gone? - where is it now?
So, you start a simple ledger of having $100 in cash with a transaction like this:
Dr "cash" Cr "original funds" $100
Then you spend some of it on food and loan some to Bob: Dr "food expenses" Cr "cash" $25
Dr "loan to Bob" Cr "cash" $20
Bob pays you back $22: Dr "cash" Cr "loan to Bob" $20
Dr "cash" Cr "interest income" $2
You can't write 'Cr "Bob" $22', because... I don't want to get into the principles of accounting, but basically all asset accounts only go one way. You can't have minus two dollars in your pocket, and Bob can't owe you minus two dollars either.Some of the accounts, like "original funds", aren't very useful by themselves, but they are the only way to make sure "money I literally have in my account/pocket", "money I owe people" and "money that people owe me" can all be counted together: if you tally up both kinds of the accounts, the total sum should be the same, just with the opposite "sign".
How would you salvage the article to actually explain the "double" part in detail? Could you do it purely from Bob's (or Alice's) perspective?
- one for the assets/liabilities account involved in sending or receiving the money ($30 credit, bank account) - one for the income/expense account to which the transaction corresponds ($30 debit, "education" expense account)
one of the two entries is a credit and the other a debit
From an individual account perspective, there's a doubling of the number of columns you could enter a transaction's amount into.
This is possible because you (the accountant) are always adding a back-reference from the other account (hence the 'double' in 'double entry').
There's really not much to it. It throws people that are new to it for a loop, I think, because it is a strange way of behaving, and it isn't obvious why you're doing it until you have to track down something that doesn't balance. It's just a disciplined behavior that accountants started using because it allows one to track things that were difficult without it.
If Alice purchases a house worth $100,000 in cash, then 2 (double) accounts will get effected. Her cash account will decrease (Credit) by $100,100 and simultaneously her House equity account (or any other appropriate name such as immovable asset etc) will increase by $100,000 (Debit).
This can be recorded in a 3 column table as
Credit account -- value -- Debit account
Cash -- $100,000 -- House equity
In the above transaction, two accounts were effected. Hence the name double entry. This gives a truer picture of ones assets and liabilities.Note: 1. Debit and credit dont have much to do with increase decrease. 2. A transaction can be modelled to have affect more than 2 account. For example if Alice were to make the purchase with $80,000 loan, then the book keeping could go like
Credit Lender $80,000
Credit Cash $20,000
Debit House Equity $100,000
For the sake of better understanding, if one is uncomfortable with having one record affecting 3 accounts, one can be more robust and split the loan and the purchase into 2 transactions. After all, taking a loan and purchasing a house are 2 different events(transactions). Transaction one ->
Credit Lender $80,000
Debit Cash $80,000
Transaction two ->
Credit Cash $100,000
Debit House equity $100,000
edit 1: attempt at better formattingI'll give a description shot, since I've been doing finance work recently. Other people can feel free to correct.
A company using double entry (as opposed to single) has a "chart of accounts." This means they have a bunch of imaginary accounts for tracking everything, including:
- Assets (e.g. cash on hand.)
- Liabilities (e.g. loans)
- Equity (e.g. investments in the company from outside parties)
- Income/Revenue: (edit: as PopAlongKid kid mentioned, I forgot this one. This could include sales revenue, but also things like interest.)
- Expenses (e.g. team lunch or a flight cost)
Some of these "accounts" may map to actual bank accounts: there is likely a liability account for a credit card or an asset account for the company checking.
Knowing all that, every time money is deposited or withdrawn (a transaction) the "double" references the fact that it's recorded in the journal (a.k.a ledger) of two accounts. (Edit: As bregma mentioned, one records where money is coming from and the other where it's going.) Often, an expense is often recorded in the checking "account" and the and the corresponding expense "account." E.g. a flight may be recorded in a travel expense "account," but you also record that the money came from the checking account. Every transaction is recorded in two places.
Beyond just being more accurate than single entry, this helps with important finance reports like Profit & Loss, since you can now see how money is moving around.
Edit: Now that I'm back on my desktop, these are a couple of useful links for understanding basic double entry bookkeeping: Accounting for Computer Scientists [0] and Accounting for Developers, Part I | Modern Treasury Journal [1]. What is a Sample Chart of Accounts for SASS Companies [2] illustrates some charts, which may be helpful for some folks.
[0] https://martin.kleppmann.com/2011/03/07/accounting-for-compu...
[1] https://www.moderntreasury.com/journal/accounting-for-develo...
This is the real benefit I've encountered. Any time I try to "simplify" financial recording for someone else and avoid double-entry, I inevitably end up wanting to perform a query that would be easy in a double-entry system but is not in any other system.
Some companies may have a larger and more detailed chart of accounts so that they can have very specific breakdowns of things. I've heard of big charts where each of a company's departments have specific accounts and all departmental transactions go there while the rest are lumped into a "Sales, General, and Admin" bucket. (Although I think it's more common to tag transactions with a department code these days?)
That said, categories can be broken down into sub-types beyond Assets/Liabilities/Equity/Income/Expenses. For example, assets are categorized based on how quickly they can be converted to liquid money and if they physically exist. So, under the assets account you may have accounts for current, fixed, and intangible (e.g. trademark or domain name) assets and you would record those appropriately.
Edit: To answer the question more directly, it depends on the company and how they've customized their accounts or guidelines. But, there are general accounting practices that mandate the need for specific things and common questions to be answered, so a lot similar structures and guidance emerge that a company's finance team could use to tell you where something belongs.
That said, there are accounting standards that define the general set of accounts for a particular industry, etc.
But every person having a set of books will want to customize it to some degree.
For instance in a personal set of books, if you want to track every person you pay, you might have accounts, 1 for every single person you have ever paid, ever.
That obviously can get pretty big! Others might not care that their electricity provider changed from Tootie inc. to Turtle inc, so they just have Utilities:Electricity as their account name.
Others might not care at all, and just have a very general "Expenses" account for things like that.
Make sense?
The important part is consistency of using the same accounts for the same transactions.
Makes sense. Probably it's important to keep somewhat of a registers of accounts available to avoid making mistakes and to write directions on where things should go
If you search for example chart of accounts <INDUSTRY YOU CARE ABOUT> you can probably get a sample set to work from.
- Expenses (e.g. team lunch or a flight cost)
- Liabilities (e.g. loans)
- Equity (e.g. investments in the company from outside parties)
- Assets (e.g. cash on hand.)
Not sure why you didn't complete your list by adding "Income".In addition, you can still make the same mistake by hand for both entries. So I’m still not getting how double entries catch mistakes
The error you've described is an "error of original entry" and will be invisible if you only look at the trial balance. It can ultimately be caught when you compare the banking ledger with what's actually in the bank.
Other errors that don't appear in the trial balance can be incredibly hard to detect and in fact, may never be noticed. This is where the real art of bookkeeping is IMO.
The types of errors that do affect the trial balance are things like forgetting to enter a purchase in the purchase ledger but entering the transaction into the banking ledger correctly. Silly errors really, but we can all need help to stop us making those.
$100 appears in your account. That’s one part. The other part depends on why.
* you moved money from another account, the double is -100 in that account.
* you sold stuff, +100 in income.
* you borrowed some money, +100 in ‘debt’.
In a physical book each of these categories would have a left and right column, and each transaction has numbers in one left and one right column. Or in many columns but the sums of left vs right columns must be the same.
You can think of it as “conservation of value”, so you can’t just create money out of thin air in your payment service (credit), without tying it to some account with a corresponding debit.
This originally was intended to protect against typos; eg write a 10 instead of 100, at the end of the day your ledger needs to balance. In software typos are less likely bit it still provides auditability to prevent a large class of bugs from wiping you out.
Double entry bookkeeping is much older than typing, but, yes, its a check against incorrect entries.
Money can not be created out of thin air, and it can not be destroyed. Every movement of money has to be accounted for, which is why it's called "accounting". Double-entry accounting means you have to account for where the money comes from, and you have to account for where it goes, and each of those is a separate entry and it all has to add up to zero.
Where it can become confusing is when money leaves you or comes in from an external source. There are still two entries, but one entry is in one party's books and the other entry is the other's. For example, I get a paycheque and I enter my income in a little book with green paper and DB/CR columns. At the same time, my employer has entered an expense in their book. Double entries.
I agree with your first two paragraphs but not with this last one. When money leaves you or comes in from an external source, there is always some proxy account for that external party in your own books. And the whole situation is mirrored in the accounting system of the external party (unless they are a consumer). Each party records two entries.
Yet accounting is necessary because money is created out of thin air. Money is just the representation of debt, an IOU. There needs to be a record of it in order to know that a debt was created and that a debt was destroyed.
More practically, let's say you give me corn today, and I promise to deliver some of the chickens fed that corn to you after it is ready to for slaughter. Money keeps track of the promise outstanding. We record that promise, or account for it if you will, so that we remember that there is a promise and so that we can later ensure that the promise was delivered upon as agreed. Something that becomes especially important when you realize that promises can be traded on to other people who weren't party to the initial deal. Perhaps you don't really want chicken, but would prefer a watch instead. Luckily the watch maker would like to eat chicken for dinner down the line, so you give him the promise of chicken in exchange for the watch. So on, and so on.
Realistically, double-entry accounting is really quadruple-entry accounting. You record that something was received and you record that a promise was made, then, later on, you record that something was delivered as promised and also record that the promise is no longer outstanding (or in reverse if you are on the opposite end of the transaction). A profit indicates that people still owe you things that you haven't collected upon. A loss indicates that you still owe people things that you haven't yet delivered.
NO.
I mean your employer probably has a set of books, but that's not true in your own local set of books.
In your local set of books you would have something like:
ACME, inc Employment Income $100 DEBIT
Bank Account $100 CREDIT
You are accounting for ACME, Inc's Employment expense in your set of books too.When you send a payment to your Power Company:
Power Company Expense: $100 CREDIT
Bank Account: $100 DEBIT
I mean if you are categorizing expenses you might do something like that. If you aren't, you might title one account "Expenses" and spend it all there, it doesn't really matter what you call the accounts, just that you are consistent. ACME, inc Employment Income $100 DEBIT
in my employment income account that money has not come out of thin air. Remember, money can not be created nor destroyed in this system. Somewhere there is a matching entry something like bregma, services rendered $100 CREDIT
in my employer's books. And that money, in turn, was probably moved in from some other account internally. Mean time the only real movement of "money" was an electronic communication between two banks (my employers and mine), with a matching entry in an account in each.Things like income accounts and expense accounts are not magic sources or sinks for money flows. They're just half of a double entry system with the other half somewhere else.
You almost certainly don't have access to your employer's books.
Also, the ledger entries for "bregma, services rendered" i.e. payroll will be much more complicated than that, there will be taxes, deductions, etc they have to account for as well.
It's how double-entry bookkeeping works. Money can neither be created nor destroyed. On your local books you have an account where money goes and appears to be destroyed, but in reality there is a doubled entry in someone else's books. Just because you're unaware of it does not mean it does not exist.
And it's true that bookkeepers will have splits in their ledger in which one transaction consists of multiple entries, but that's a convenient shortcut for consolidating multiple items each of which is one half of a double entry. It has no bearing on how double-entry bookkeeping works and just needlessly complicates a description of the fundamentals. It has only to do with conventions for recording double-entry bookkeeping, just like using DB and CR to indicate whether entry is moving money into or out of an account.
Sorry, but no. I have no idea why you think double entry means 1 of the entries is in some other persons books that you don't have access to is somehow useful. Double entry is 100% local to a singular set of books.
The point of double entry accounting is to avoid many simple mistakes. If you can't access a 3rd parties books to check, what is the point of double entry accounting, when you only hold a single entry?
I literally have no idea how you think this even remotely makes sense.
> Money can neither be created nor destroyed.
Totally as an aside, money can indeed be created and destroyed, the govt and even banks do it all the time[0]. But I agree practically speaking from an accounting perspective in a singular person/organizations books money isn't created or destroyed it's just moved around. But for double entry accounting, it's 100% not useful to talk about money in some other person's books, it's irrelevant.
0: BOE, Money Creation in the Modern economy an introduction: https://www.bankofengland.co.uk/-/media/boe/files/quarterly-...
When you pay your power company, the money leaves your bank account ("credit") and enters the (abstract) power company expenses, utilities expenses, or whatever account ("debit").
From my perspective as the bank account holder and the person managing my own books, no.
A curious contradiction. How do we resolve it?
If it was important to account for the cash donation, the company would require a receipt in exchange. If it's part of a coverup the receipt may be for something unrelated but at least the books are in good order.
So, of course, in reality money was created (and then destroyed, it being a gift) in order to make the transaction whole. But as far as this magical fairytale land where money can't be created the entry doesn't work. You can't account for nothing.
Let's say it's not a gift. Let's say someone is borrowing $1,000 cash instead. The same applies. There is no corresponding element in trade to account for. It doesn’t balance. Thus, when the cash goes out you need to create money out of thin air to satisfy the other side of the transaction, which is later destroyed when the cash is returned.
Lending would be at least two sets of doubly-recorded transactions.
Right, because transactions are actually two-sided. I give you something, you give me something in return. That's how people work with each other. And, as such, we account for a source and destination because that matches what actually happens.
But often times you only offer a promise. For example, I write some software for you, and in return you offer me food. But I'm not hungry right now, and I certainly don't want food that is going to spoil before I get around to eating it, so instead you promise to give me fresh food sometime in the future when I am hungry.
How do you account for that? You received software services, but gave nothing back in return other than a promise. Well, what if you recorded the promise? Software services in, promise out. You got your software, I get my food, the credit and debit accounts match. Everyone is happy.
Congratulations, you just created money out of thin air! -- And now, later on, I am feeling hungry and am ready to take you up on your food offer. You give me the food, I give back the promise, food out, promise in, I'm fed, debits match credits, and the money is destroyed.
That's exactly why we invented accounting: To keep track of the money being created and destroyed. You wouldn't need accounting if promises never needed to be made. Without promises, you'd have the software services, I'd have the food, and we'd have no reason to think about the transaction ever again. It is the promise that has us wanting to look back to make sure that promises outstanding are made good.
In the case of gifting something, from the perspective of the gifter, they destroyed some value they had on their books and got nothing of value in return. There’s an account type for tracking why your net worth decreased - Expense accounts. The giftee received value and they have an account to track why their net worth increased - Income accounts. If value was objective, then the net worth decrease on one side would exactly equal the net worth increase on the other.
With something like cash, the unit of account and the store of value are the same thing - so 100 USD objectively the same value in everyone’s ledger. But say you were gifted a painting. The gifter may have valued this painting at 100 USD, while the giftee actually thinks it’s worth 50 USD. If the gifter didn’t tell them the price, there would be no way of knowing they recorded different numbers. So in this transaction value was destroyed.
The same thing happens when you buy and sell things. Say the painting was sold instead of gifted, then the difference in what the buyer and seller thought the painting was worth is value that was created and destroyed. Each person’s net worth would go up or down depending on whether they thought the painting was a bargain or overpriced. When providing services, value is created at the moment of usage and a ledger will track the creation of value in your landscaping business.
That's not the case. Money, of course, is just a promise to provide something of some defined value at some point in the future. Anyone can make such promises. Heck, that's why we invented accounting – to keep track of the promises outstanding and delivered!
Money is created and destroyed by extending and resolving credit. central banks do it, but so do regular banks and non-bank institutions.
If a bookkepper destroyed or created money they would be in a great deal of trouble and probably end up working for the state for two years less a day.
Money is just a promise. Anyone can create those. Which should be quite obvious. When you go to work to, as we literally say, make money, your employer is making a promise that in exchange for you work you can take something of some defined value later. Later, you will take that promise and turn it into something of value, such as food. Once spent, the money is destroyed. The promise is no longer valid. The deal is done.
Currency is a promise to a particular entity, such as a central bank. A central bank will loan you something of some value, you equally promise to give them something of equal value (we'll ignore interest for simplicity) back at a later date. Indeed, only the central bank can accept promises made to the central bank. If you accepted a promise on behalf of the central bank, without explicit authority, then you are quite right that trouble is coming your way.
Because there is a trust component required in promises, often promises made – such as the promise of your employer to feed you later – will be backed by a promise to the central bank. The central bank has a military to send if someone really tries to play nasty with promises made, so that carries a lot more trust than if you and I wrote up our own 'IOU'. This may be why you see money and currency as being one and the same. Often they are, but not necessarily so.
Accounting is simply for keeping track of promises. That's why we invented it. You don't need accounting for barter. It is the promises that necessitate accounting in order to keep track of what promises are outstanding and what are fulfilled. A bookkeeper doesn't create money per se, but they certainly account for money created and destroyed by the entity they are bookkeeping for.
AR and AP accounts track promises, and as you point out, bank accounts and cash are also conceptually no different than other AR account. I call these asset and liability accounts State accounts. They track the current state of your promises and expectations. Since a promise can be reneged or an expectation not met, we need accounts that balance changes in State accounts when value is created or destroyed. That’s what income and expense accounts do — which I call Change accounts [1]
> You don't need accounting for barter.
I get what you’re mean, but I think a good way to get your head around multi-currency accounting is to think of it as double-entry bartering. Each currency only has value because it can be swapped with another currency at a certain rate. Which is basically bartering. How many sheep for how much grain? How many USD for how many GBP?
The interesting part is bringing double-entry into this:
- how do you balance a transaction when the two sides are in different currencies?
- How do you track the exchange rate between currencies?
The answer to each question is the other question. You balance entries by adding two more lines that track gain/loss due to exchange rate fluctuations. I did a talk on this at Fintech Devcon [2] and we cover this in our docs [3]
[1] https://news.ycombinator.com/item?id=39994335
Value is the opposite side of the transaction, though. Money is the promise of value, not value itself.
> Which is basically bartering.
Yes, it most definitely is, but the difference with bartering, by definition, is that the value is always delivered immediately. As in, you give me grain and I give you sheep at the same time. We both have what we want, the deal is done, and there is no need for accounting as there is no reason to ever think about it again.
But if, instead, you give me grain and I give you nothing but agree to later give you sheep after they have been fed the grain and are ready for slaughter, then we have an unbalanced transaction. You gave me value, but I gave you nothing – just a promise.
Enter accounting. I record that you gave me grain and I record that I made you a promise (money created). You record that I gave you a promise and that you gave me grain. My books will show a loss (promises outstanding) and you will show a profit (promises yet to be delivered). This gives us both a reminder that the deal isn't yet done, which is useful because people are prone to forgetfulness. Also, perhaps even more significantly, you can pass on the promise. The person who finally receives the value in the future may not be the person who made the deal originally, so accounting is critical to settling the promises across a chain of trades.
So to be clear, there are 4 accounts. Bob's Money, Bob's Books, Alice's Money, Alice's Books.
Because these two homeless librarians only have money and books, you can add the two balances together for each person to get their net worth.
If Alice owns 3 books worth $120, then the "Alice's Books" account would show a balance of $120. Meanwhile, Bob has 12 books worth $700.
When Alice buys the books, she -credits her bank account $20 and +debits her books account $20 (the value of the new book). Thus her net worth stays the same, but she has more books assets and fewer cash assets.
Similarly Bob -credits his books account $20 and +debits his bank account $20. His net worth also stays the same but he now has more cash than before.
On Alice's way back to the bridge she resides under, it starts to rain. Alice's new book is ruined. She -credit's her books account $20 and her net worth goes down by $20.
Life as a homeless librarian is harsh.
Stupid question maybe.
Is net worth an account too? Where does the debit side of Alice’s credit go?
Note that "credit" in double-entry bookkeeping means a transfer from that account and debit means a transfer to that account. So the debit side of buying the book goes into the books account. The credit entry is for whatever account value is transferred from in the transaction.
I'm not sure I'd say that Alice's net worth goes down by $20 when she buys the book since the financial value of the book would technically also be part of her net worth.
I also wouldn't consider "net worth" to be a single account.
Technically net worth would be the sum of all of Alice's assets in cash, bank accounts, real estate, books and other non-financial assets etc., minus all her liabilities. Each of those might be a separate account in the bookkeeping.
Disclaimer: I'm not an accountant.
[1] There might not be a separate account for books unless Alice is a real books aficionado and a meticulous bookkeeper, so the account might also be "books, movies & music", "entertainment & culture", or just "personal items" depending on what granularity is desired/needed.
It might also be that such items are not considered to have financial value in the system (which would probably be the correct unless Alice collects books) and the debit ("to") would actually go in some kind of an (abstract) expenses account instead. Either way, both the value leaving cash/bank and the value "entering" some other account would be entered.
https://www.investopedia.com/terms/a/accounting-equation.asp
If you're building payment rails, that event might itself be one of a pair of events, sourced from a meta-event tracking the transaction intent. (As a meta-point, I find it much more useful to think of the "graph" in accounting as having edges not made of money, but of data in a derived-event hierarchy.)
And a first step towards being able to have that mental model is ensuring that you have a good mental model of multiple physical-human actors accumulating events in a structured and atomic way.
But the OP doesn't actually make it clear that this is what the analogy is in service of! And I fear that the OP article will cause more confusion than it solves.
Unfortunately, QuickBooks won't help you understand accounting. It's not a true double-entry accounting system, at least it wasn't the last time I touched it. That said, it still does its job and does it well enough, and real accountants are fine with dealing with it.
Simply Accounting is a better example of a true double-entry system.
Can you elaborate? I've used Quickbooks for over 15 years and it has always been a true double entry accounting system during that time.
QuickBooks absolutely is a double-entry accounting system. The "bookkeeper" mode abstracts away and hides what's going on under the hood, but if you enter "accountant" mode, you'll see the full ledger, and you can even make direct journal entries to modify it.
I personally find the bookkeeper mode very confusing, and having observed others (non-accountants) using it to manage small businesses, I think that folks would be better off taking a one-day course in accounting and learning just enough to use it in accountant mode.
You don't have to be a CPA, just literally enough about A = L + E to follow the flow within Quickbooks and record one side of each entry.
No, the number of accounts (actors) does not have to be even. The sum of debits and credits has to be equal (or zero if you like).
[0]: https://www.winstoncooke.com/blog/a-basic-introduction-to-ac...
Therefore (and to your point) the observation is of limited usefulness.
For example, a bank might decide you likely can't pay your loan and write it down to zero. You might still have the liability on your books because you plan to repay it. They'll make the relevant entries in their system (and the debits and credits will balance) and you'll do nothing (which balances).
Double entry bookkeeping has zero to do with other entities. It's solely about your own books.
What if Alice does double-entry bookkeeping but Bob does single-entry bookkeeping?
Just a tiny number of formulas (accounting identities [1]) and statements (P&L, balance sheet, etc.) can represent what's going on in any org in ways that can be roughly comparable. Reminds me of the "fundamental theorem of calculus" or "central dogma of biology".
Accounting is also where we get math and written language [2] as ancient Mesopotamian civilizations initially kept track of commodities using specific "accounting tokens" [3] shaped like the thing represented, and that evolved into written language, imagine: hieroglyphics.
Later, Al-Jajr [4] (aka algebra, literally "balancing") was invented by Al-Khwarizmi (origin of "algorithm") to solve Islamic inheritance law, whose rules of splitting up became a series of equations that led to the need to solve them quickly and correctly. Al-Khwarizmi's quadratic formula was the origin of why "algorithm" gets its name from him.
[1] https://en.wikipedia.org/wiki/Accounting_identity
[2] https://en.wikipedia.org/wiki/History_of_accounting
[3] https://en.wikipedia.org/wiki/History_of_ancient_numeral_sys...
Negative numbers were first used around the 3rd century in China and took until the 16th century to be used in Europe. Modern double-entry bookkeeping was invented in the 14th century in Europe. So if you ever wonder why they traditionally use a column for debit and one for credit, with definitions that seem a bit strange: that was the best way to make it work with only positive numbers.
(A)ssets - (L)iabilities = (I)ncome - (E)xpense
So if you have more (+100) Assets, then to balance it out, you either need to have: +100 Liabilities (100 A - 100 L = 0) → You took out a loan and increased your liabilities
-100 Assets (100 A - 100 A = 0) → You sold an asset for what it was worth
+100 Income (100 A = 100 I) → You provided a service and earned income
-100 Expense (100 A = 0 I - -100 E) → You got a refund for a previous expense
I think that’s much more intuitive. You can think always think in terms of more or less Assets, Liabilities, Income or Expenses, then use the Accounting equation to check your reasoning.Here’s a deeper explanation: https://fragment.dev/docs#design-your-ledger-ledger-accounts
Disclaimer: I’m CTO at Fragment
* you can actually think of oddball reasons you might consider a "negative credit/debit", but it's more akin to something like a negative mass in physics
There's no need to learn any confusing "credit" or "debit" jargon, you just need to think about the movement of money (which you had to do already).
You don't need negatives in accounting, because anything that is affecting a number differently than the rest (reducing rather than increasing), needs to be accounted for separately. Imagine showing negative revenue. That would be mostly useless. You want to see how much revenue you had, and in a separate entry, how many expenses. Imagine how misleading it could be to show $0 in expenses last month, when in reality, you had $100 in expenses, but you subtracted $100 out because you returned some big purchase from last month and got a refund.
That's actually already how it works, the kind of inverse you use depends on if the account is credit-normal or debit-normal. You end up in the same place.
> Imagine showing negative revenue. That would be mostly useless.
Revenue is already credit instead of debit, which if you were consistent in using negative numbers, a negative revenue be completely correct (so you would want to sweat if revenue was a positive number). It's weird, but it lets your cash on hand be a positive number, which is just a necessary consequence of the system.
> Imagine how misleading it could be to show $0 in expenses last month, when in reality, you had $100 in expenses, but you subtracted $100 out because you returned some big purchase from last month and got a refund.
Wouldn't that be accurate? This would be a debit of 100 and a credit of 100 which nets a balance of 0. But individually you would see the transactions and could sum the credits and debits if you were so inclined.
Alternatively, contra-accounts exist if reporting these individually is material for some reason.
It can also obfuscate it pretty well!
[0]the third basic type of statement, in addition to balance sheet and profit & loss.
If you are selling widgets for $1.20 and buying them for $1, and they are delivered after you order them, you are limited on how many open orders you can have at any point in time even though you make money on each order.
A companies cash flow will be dependent on employees, capital expenditures, money for stock, returns rates, tax requirements etc. etc. So it's heavily dependent on what type of business is being run and the specifics of how the business is being run.
For example, see this Apple Corp. financial report[0] -- it includes a statement of cash flows. I think you'd find that all other companies required to publicly share their financials will include the same report.
[0]https://www.apple.com/newsroom/pdfs/FY22_Q4_Consolidated_Fin...
There are many important aspects of organisational design that are only loosely correlated with financial statements.
It was only after bookkeeping became ingrained into all levels society that negative numbers were considered equally real as positive numbers.
That is very different from understanding concepts like owing someone money, which is a form of negative.
Chinese and Indian mathematicians and accounting from Babylonian times didn't have the same mental blocks.
The Bakhshali manuscript is still the first known example of modernish notation I think, but used +
Essentially, the goal is to keep the accounting equation true at all times. The equation is: Equity = Assets - Liabilities. Eventually, earnings (Income - Expenses) will become part of equity, so splitting that out, you have: Equity + Income - Expenses = Assets - Liabilities. Rearranging to get rid of the minus signs you get: Equity + Income + Liabilities = Assets + Expenses. This equation must be true or something has gone wrong - like money appearing or disappearing out of nowhere. To keep it true at all times, it should be clear that any time you add money to an account on the left side of the equation (say, to an Income account), you must either add the same amount to an account on the other side or subtract the same amount from the same side.
For example, you sell a lemonade for $5. You add $5 to Sales (Income) and add $5 to Current Account (Assets).
The "credit" and "debit" terminology is ridiculous because their definitions swap around depending on which account you're talking about, which is an utterly absurd (mis)use of language and the main reason people find this confusing.
I was perplexed by this as well and none of my profs could cogently explain it. The classic example are supply and demand curves, with price as the Y axis.
I finally realized they are actually trying to communicate that price is not under the control of the buyer or seller, but that the market dictates the price given a level of production. This kind of “spherical cow” thinking made me develop a healthy contempt for conventional economics.
If you don't understand that foundational idea, then considering the effects of different rationing systems is utterly impossible. For example, that gets you a whole lot of people who make decisions that exacerbate housing crises by creating rent controls or building restrictions, and then being utterly perplexed when there isn't enough supply to go around (because they decoupled the signalling mechanism that the suppliers use (aka price) from what the buyers use (who got there first, or who is luckier with timing, or who is more politically connected). This is not to say that price controls are always bad, because real life is much more complicated than econ101 concepts lay out. But with nearly every other subject we expect people to have a basic level of understanding (like biology, history, english, etc) because we recognize it's importance for society and individuals to have at least a basic level of understanding in many different subjects. One that has as big an impact on life as economics seems like one of the worst to omit.
Just like we tell 8th grade physics students that "in the real world, cows aren't spherical so it's a little more complicated than this, but this gets you 80% to 90% of the way there" I don't see why we shouldn't do the same for economics.
scroll down and look at that graph! https://www.fda.gov/about-fda/center-drug-evaluation-and-res...
also go to and read about the studies https://www.noahpinion.blog/i/142905737/the-evidence-is-in-f... and you can see the exact numbers from the datasets, these are all spherical cow parameters basically!
"Credit" means "source", "debit" means "sink".
Suppose you invoice a customer 10,000 euros. You now have a promise for 10,000 euros, but you account in dollars so it's a promise for 11,000 dollars at current exchange rates. So you credit the source, your "Income: Customer A" account ("income" and "expense" accounts represent the external world) $11000, and debit "Assets: Accounts Receivable" (an account for trade-credit promises like this) $11000.
Later, the customer pays your invoice, which gets you $10,500 because exchange rates have moved around. How do you account for this?
Your promise, which you accounted as $11000, is the source, so you credit Accounts Receivable $11000. You debit cash $10500, because you got $10500 in cash. Finally, credits and debits have to balance, so you debit "Expenses: Loss on Foreign Exchange" $500. (recall that "expenses", like "income", represents the external world, and you lost the other $500 to forex traders or whatever.)
Since you don't liquidate the business on any typical day of its operation, why would you attempt to figure out how that $500 fits into a hypothetical instantaneous liquidation when you could just... account for it by balancing credits with debits? (You do sort of instantaneous-liquidate when preparing financial statements, an infrequent task which is very mechanical compared to ledger entry.)
What would you suggest as an improvement? The article suggests "incoming" and "outgoing" which seems to have the same issue, as does everything I see in your comment (the person spending 5$ on lemonade sure as hell isn't putting 5$ in their accounts sales entry).
I'm not fully understanding the confusion both here and in the article.
source: friends and family members who are accountants and have generously given free bookkeeping tutorials
So how would you correctly express the parent's example in terms of debit/credit if debit/credit are synonymous with decrease/increase?:
>>"Increase cash" by borrowing money is "increasing liability".
"Crediting cash by borrowing money is crediting liability" would sound obviously incorrect to any accountant.
> I wouldn't say "they are basically synonymous" because there are situations where they flip depending on the rules/approach that you are following. After working with it you get pretty familiar with these situations and don't really even translate anymore. It's important to remember though that there are books the way most people see them, and the way an accountant following GAAP sees them. "Increase" and "decrease" are quite helpful for most people the way most people see the books. If you are applying GAAP it's like working in a different language where words don't cleanly translate.
Given that we are mostly talking about double-entry in this thread, I think he is basically telling me I'm wrong but trying to explain how I came by it honestly so I don't feel stupid :-D
To quote the famous Bender from Futurama: "I’m so embarrassed. I wish everybody else was dead."
You have that exactly backwards!
Assets (like bank accounts and cash) are "debit accounts" meaning they increase with debits and decrease with credits.
When you withdraw money from your bank account, the bank account goes down, so we know that must be a credit to the bank account, while the cash goes up, that is a debit to the cash account.
Your confusion might be due to perspective. From the bank's view your bank account is a liability (credit account) so it increases with credits and decreases with debits.
Sure the banks perspective is different but maybe I'm not interested in that.
I love that this thread is full of people confidentally saying something that sounds correct or at least reasonable and the first reply that comes back is no you've got that wrong and then what your saying also sound's reasonable but it just seems to depend on the context and perspective.
I would have thought accounting a solved problem but apparently not.
well, it is if you do it on books, not in natural language.
since it looks deceptively simple everyone throws around sentences that are screaming for mandatory context.
the whole GAAP (generally accepted accounting principles) (and certs like CFA too) are about codifying this context.
what goes where is the name of the game. can you consider this or that an asset or not? is that an expense or you got credit from your vendor, because they shipped it before you paid it? which quarter does it belong to if they shipped it before new year's eve but we only pay it next financial year? etc... etc...
that said accounting is not a mechanical system. there are quite a lot of degrees of freedom ... but there are of course clearly wrong ways to do it ( https://en.wikipedia.org/wiki/Creative_accounting )
oh, and when someone says debit/credit just use a spray bottle on them and ask them to simply state clearly what happens with the fucking number on which of your accounts, does it increase or decrease. (ie. they should just say that the money goes from this account to that account, and suddenly there's no ambiguity.)
In accounting/bookkeeping parlance, "asset" and "debit" have a very strict meaning, but it's our job to make sure we are using them correctly and we agree that the usage is correct.
> Debits increase the value of asset
https://www.netsuite.com/portal/resource/articles/accounting...
> Asset accounts: Debit Increase, Credit Decrease
https://www.chase.com/business/knowledge-center/manage/debit...
Use the intuitive meaning of the words: a credit means you have money coming in, a debit means you have money going out. An increase in assets, income, or equity is a credit, and an increase in expenses or liabilities is a debit, and vice versa.
Or, alternatively, just use "credit" for any increase, and "debit" for any decrease. But this:
"Definition 6: Credit - An entry that represents money leaving an account."
is just totally backwards.
An increase in assets is a debit.
>Or, alternatively, just use "credit" for any increase, and "debit" for any decrease.
How is this consistent with the fact that an increase in my bank account balance is a debit?
My problem is that your alternatives don't just change the words, they change the logic. The invariant of debit/credit is that they need to balance out.
If you choose words that can occur on both sides of the equation then this is no longer true and you're throwing out a lot more than just the admittedly unintuitive meanings of these words.
No, they don't. They just change the words you need to express the logic.
> The invariant of debit/credit is that they need to balance out.
Sure. So? If I give you a dollar, that's going to balance whether we call that a debit to me and a credit to you or a credit to me and a debit to you. The labels don't matter.
That contradicts your suggestion that we should use the intuitive meaning of the words and it contradicts your suggestion to 'just use "credit" for any increase, and "debit" for any decrease'.
Let's say a company raises equity (i.e it issues new shares), money comes into the bank account. In traditional terminology that would result in:
debit bank
credit equity
According to your suggestions, however, raising equity would result in increase bank
increase equity
This violates the principle that the sum of labelAs need to cancel out (or balance out) the sum of labelBs. And this is why I said that you're changing the logic.E.g, this would be correct:
increase bank
increase equity
but this would be incorrect: increase bank
increase receivables
If all numbers are positive then there would be no way to check whether the journal entries balance out without considering the account types.If, on the other hand, you encode the sign in the amounts then the sign would disagree with the semantics of the label and you would have to flip signs based on the account type at the time of recording the entries:
increase bank $100
increase receivables -$100
I don't suppose this is what you meant.That's right. The distinction is based on whether the account represents an asset or a liability.
> increase bank
> increase receivables
You would have to define what you mean by "bank" in order for this to make sense. But in general, receivables represent money that a company is owed from orders that have not yet been paid for, i.e. they are a effectively a loan from the company to its customer, and like all loans they are an asset to the creditor, which in this case is the company. When a payment is made against an outstanding receivable, the receivable is debited (the loan balance is reduced) and the company's cash balance is credited. Because cash and receivables are both assets, these add together and cancel out just as you would expect.
The rules under my system are still very simple:
1. Every financial asset is someone else's liability, and vice versa. Cash is an asset to its owner and a liability to society at large. Loans are assets to the creditor and a liability to the debtor. Purchase orders are a liability to the purchaser and an asset to the supplier. Etc. etc.
2. Every financial transaction is a change in someone's liability coupled with a change of equal magnitude in someone else's assets.
3. The absolute value of your assets minus the absolute value of your liabilities is your net worth.
A completely equivalent formulation is that liabilities have negative signs attached to them, and then your net worth is the sum of your assets and liabilities, but this is just a question of where you hide the negative sign. A - B is the same as A + (- B). It really doesn't matter except insofar as one convention might make it easier to think about things. Most people are used to seeing their liabilities expressed as positive numbers, i.e. if you owe money on your credit card bill, the balance due is positive, and if you have a credit balance, the balance due is negative. But it's all just a shell game with where you hide the signs.
Instead of grouping together accounts into credit-normal and debit-normal, to make things balance, I think it’s more intuitive to group accounts by usage and use negative numbers.
Asset and Liability accounts appear on a Balance Sheet and are called State accounts. State accounts track the current state of your net worth.
Income and expense accounts appear on an Income Statement and are called Change accounts. Change accounts since they track why your net worth changed.
Bank means bank ledger account. The bank balance and receivables cannot both increase because they are both assets.
>That's right. The distinction is based on whether the account represents an asset or a liability. ... A completely equivalent formulation is that liabilities have negative signs attached to them
Understood. My point was merely that you cannot just change the labels.
The downside of this approach is that you would no longer be able to see whether a journal entry balances out based on the labels alone.
Yeah, well, there is this cool new invention called a "digital computer" that can help a lot with that. You don't have to keep the ledger on paper using quill and ink any more.
Perhaps some simple convention would help, like attaching +/- to account names. We do have account numbers and accountants know their meaning but most people don't.
Or "asset" and "liability". (Big displays are a thing now too.)
Liability has a very specific meaning (debt) and expenses do not necessarily increase liability.
And then there are accounts that can be assets or liabilities depending on their balance.
(Besides, very small displays a thing now too)
Why?
> expenses do not necessarily increase liability.
That depends on what you mean by "expenses". If you give someone an expense account, that is a commitment to make payments for expenses, i.e. debt, so it's a liability. When you actually pay for those expenses (or reimburse someone for incurring those expenses) you are paying off debt and reducing your liabilities. Why is that confusing?
> And then there are accounts that can be assets or liabilities depending on their balance.
Sure. So? An asset account is one which represents assets when its balance is positive, and a liability account is one which represents liabilities when its balance is positive. A negative balance in an asset account is a liability, and a negative balance in a liability account (like a credit card, for example) is an asset.
You could do away with this convention and just represent all assets as positive values and all liabilities as negative, but people are used to distinguishing "money that you have" from "money that you owe" and having both of those represented by positive numbers in the usual case.
> very small displays a thing now too
Not for accountants.
This is not what expense account means in accounting. An expense account is an account that records expenses incurred such as your AWS bill, rent payments or salaries paid.
These are not liabilities and labelling them as such is more than confusing.
>Sure. So? An asset account is one which represents assets when its balance is positive, and a liability account is one which represents liabilities when its balance is positive.
Exactly, so how do you label it if it can be either? The only way I see is to label it according to its main purpose and accept that it's sometimes semantically wrong. That's effectively what the chart of accounts does.
Ah.
> These are not liabilities
Well, that depends.
Every expense that involves an invoice or purchase order that is not paid immediately in cash must be recorded as two transactions. The first transaction is the issuing of the invoice or the PO. That transaction is a liability to the buyer, an asset to the seller. The second transaction is the payment of the invoice. That transaction involves a decrease in the buyer's cash reserves (asset) and a discharge (decrease) of the the buyer's liability, and an increase in the seller's cash reserves (asset) and a decrease in the seller's accounts receivable (asset).
When I look in "accounting for dummies" type web sites, they all give examples of expense accounting as a single transaction. That is deeply broken. If you try to record an expense as a single transaction then your balance sheet is going to be wrong if you have any unpaid invoices, either payable or receivable. In fact, recording an expense as a single transaction doesn't even work if you're paying cash in a brick-and-mortar store unless you literally keep all your cash as physical cash in a safe because ATM withdrawals are transactions that need to be recorded too.
In a situation like an employee being reimbursed for a travel expense there are at least four transactions:
1. The employee using their credit card to buy something (liability to the employee, asset to the merchant)
2. The merchant getting paid by the credit card company (converting a receivable into cash, i.e. trading one asset type for another)
3. The employee submitting their expense report (invoice) to the company for reimbursement (liability to the company, asset to the employee)
4. The employee getting paid by the company for the incurred expense (company converts asset into a discharge of liability, employee converting receivable into cash)
I say "at least" because if there is a credit card involved then step 2 actually involves a bank issuing a loan to the credit card holder, so there is an additional entity involved, and more transactions on their end. And of course when I say "cash" I actually mean "demand deposit" which is not quite the same thing, though people tend to conflate the two.
∆ State = ∆ Change
↓
Assets - Liabilities = Income - Expense
For example you had:> 3. The employee submitting their expense report (invoice) to the company for reimbursement (liability to the company, asset to the employee)
So looking just at the company’s books:
$0 Asset - $100 Liability = $0 Income - $100 Expense
-$100 State = -$100 Change
Then in step 4:
> The employee getting paid by the company for the incurred expense (company converts asset into a discharge of liability, employee converting receivable into cash)The company’s books would be:
-$100 Asset + $100 Liability = $0 Income - $0 Expense
$0 State = $0 Change
So the net impact on the ledger would be (putting these entries together): -$100 Asset - $100 Liability + $100 Liability = $0 Income - $100 Expense
-$100 Asset - $0 Liability = $0 Income - $100 Expense
-$100 State = -$100 Change
Which is exactly what the company’s books would have recorded if they were using cash accounting instead of accrual. They spent $100 on an Expense.So I think it’s super important to make a distinction between Liability and Expense Accounts because they’re on different sides of the accounting equation - State and Change. The same distinction applies to Asset and Income Accounts. [1]
[1] https://fragment.dev/docs#design-your-ledger-ledger-accounts
Accrual is also a way of doing implicit projections into the future, which made sense back when accounting was done with pen and paper, and payments could not be initiated by the payee. In that world, there was no such thing as (for example) an automatically renewable subscription. Today there is. How would you account for signing up for such a subscription? Theoretically, an open-ended automtically renewable subscription is an infinite liability (unless you start taking interest rates into account, but of course no one does that because no one knows what interest rates are going to be in the future). The Right Way to do this is to keep track of it as an infinite series of transactions with time stamps, which would be impossible to do with pen and ink, but is trivial for a computer.
Most people are only aware of one type of account, a liability account managed by the bank in their name.
The mistake is that we talk about them as "our" accounts.
Yes, by definition.
> The mistake is that we talk about them as "our" accounts.
No. The mistake is the failure to recognize that every account is actually two different accounts, one for each party to a transaction. A bank account looks different to the bank than it does to a depositor or to a borrower. To a depositor, a positive balance is an asset -- quite literally "money in the bank". To the bank, a positive balance in a deposit account is a liability, a loan that it has taken from the depositor on which it must pay interest (at least sometimes) and which it must eventually pay back. To a borrower, a positive balance on a loan is a liability, to the bank it's an asset. Every financial asset is a liability to some counterparty. Even cash is a liability to society at large. So whether something is an asset or a liability depends entirely on your point of view, and so if both parties are going to use the same number to represent an account balance, it is an arbitrary choice what the sign represents. A positive number is always going to be an asset to one party and a liability to the other. Which is which is totally arbitrary, except that there are some deeply entrenched conventions: a positive balance on a deposit account at a bank represents an asset to the depositor, a liability to the bank. A positive balance on a loan represents an asset to the lender, a liability to the borrower. A positive balance on an invoice represents an asset to the seller and a liability to the buyer. But there is no inherent reason why it has to be that way, it's just tradition.
Likewise, whether "credit" means "increase" or "decrease" is also simply a matter of convention. A "credit" to a deposit account means the balance goes up. A "credit" to a loan account (i.e. a loan payment) means the balance goes down. The thing that unifies these things is that a "credit" is either an increase in an asset or a decrease in a liability since both assets and liabilities are recorded by convention as positive numbers. So in isolation (i.e. without a balancing double-entry transaction), a (positive) credit increases your net worth and a (positive) debit decreases it.
Examples:
If you deposit money into a checking account (asset) that is a debit (account increases) because the money "goes to" in that account (destination).
If you borrow money from a credit card (liability) that is a credit (account increases) because the money "comes from" that account (not destination).
The hard part is remembering debit accounts increase with debits, and credit accounts increase with credits.
My 100-level accounting instructor said it pretty succinctly: Debit means an entry in the left column. Credit means an entry in the right column. What a transaction means for the business depends on the accounts.
Dr accountX £100
Cr accountY £90
Cr accountZ £10
Left and right was fine when T accounts were universally used to record entries, but that's no longer the case.https://www.deskera.com/blog/journal-entries/
And got left/right as explanation and also as left and right columns
For most people who aren't accountants though, the spreadsheet thing is correct.
https://www.accountingweb.co.uk/any-answers/vat-double-entry
But that just shifts the arbitrariness of the whole thing from the words "debit" and "credit" to the words "left" and "right".
But it does. "Debit" is an English word with an established meaning in common usage. It means to take money out of an account. It is related to the word "debt" which is something that decreases the net worth of the debtor and increases the net worth of the creditor. If you overpay a bill, the (positive) difference between what you paid and what you owed is a credit on your account, and can be used just like money to pay your next bill.
Or it's a debit on the company's account. I think that's the point that was being made; not to confuse technical terms with English common usage, and not to go to the dictionary or etymology(!) as the arbiter. Debits are credits and credits are debits, but the real question is which column does it go into.
Same nature as discussions about clients/servers.
That's exactly right. They owe you money, so it is (or at least it should be) a credit on your account, and a debit on theirs. But that is not what the definition given in the article says. TFA's definition of "credit" was "An entry that represents money leaving an account" and likewise a debit is "An entry that represents money entering an account." So when you paid your bill, that was (by the articles definition) a credit to your checking account and a debit to your account with company whose bill you were paying, which is exactly backwards. According to the standard English definitions, a credit is something that makes your net worth go up, and a debit is something that makes your net worth go down. So when you pay your bill, that should be a debit to you (cash going out decreases your net worth) and a credit to the counterparty (cash coming in increases their net worth).
> Same nature as discussions about clients/servers.
How so? It seems to me that distinction is clear: the client is the machine that initiated the connection, the one that did the DNS lookup.
When I deposit money, it modifies two accounts at the bank:
- the account which represents how much money they owe me - and the account which represents how much money they have on hand.
The former is a liability, and the latter is an asset.
The meaning of debit/credit is reversed between these two types of account. So, when I deposit $100, the entries entered are:
- CREDIT mhink's account $100 (increasing liability)
- DEBIT cash account $100 (increasing asset)
Since we only see one side of this, we start to associate "debit" with "less money for me" and "credit" as "more money for me".Oddly enough, another common financial situation reinforces this interpretation from the other direction: accounts with utility providers. Unlike the bank, your account at the utility company represents how much you owe them. So the meaning of debit/credit is reversed, but so is the direction of responsibility: your account at the utility provider is money you owe them, which is an asset. So when I pay them $100, the entries entered are:
- CREDIT mhink's account $100 (decreasing asset)
- DEBIT cash on hand $100 (increasing asset)This has nothing to do with labeling transactions so that the labels conform to the common meanings of English words. When an account representing assets has its balance go up, that's a credit. When an account representing a liability has its balance go up, that's a debit. And vice versa. If I, say, draw down a line of credit for $100 and deposit the funds in my checking account, then from my point of view, my LoC should debited by $100 and my checking account should be credited for $100.
This makes sense regardless of how you think about the LoC. If you think of the available credit as an asset, then when you draw down the LoC the available credit balance goes down and it's a debit. If you think of the amount owed on the LoC as a liability, then when you draw down the LoC the amount owed goes up and it's still a debit.
> CREDIT mhink's account $100 (increasing liability)
No. This transaction does not increase liability in any absolute sense. It increases liability only from the bank's perspective. From your perspective, it increases assets.
You missed the context: When I deposit money, it modifies two accounts at the bank.
It appeared to me they were very much explaining this from the banks or utility company’s perspective.
Yeah, I get that. I don't see what that has to do with the labels used to describe the transaction.
Actual physical cash is weird because it's an asset to its owner and a liability to the rest of society. But when you deposit cash in a bank, the bank doesn't become the owner of the cash. It has borrowed that cash from you. So that cash is both an asset (because having borrowed it from you it can turn around and loan it to someone else) and a liability (because the bank is in debt to you for the amount of the deposit).
A simpler example is depositing a check. In that case, money just gets transferred from the payor to the payee. It's a debit from the payer's account and a credit to the payee's account. Or at least that's how it should be.
What you're missing here is that if I were to keep my own records, I would also list two accounts. When I look at my bank statement online, what I'm looking at is the bank's records. If I kept my own books, it would be the same thing, but in reverse, like this:
MHINK'S RECORDS
- CREDIT mhink's cash account $100 (decreasing mhink's assets)
- DEBIT mhink's account for the bank $100 (increasing mhink's assets)
BANK'S RECORDS
- CREDIT the bank's account for mhink $100 (increasing the bank's liability)
- DEBIT bank's cash account $100 (increasing the bank's assets)
> It has borrowed that cash from you. So that cash is both an asset (because having borrowed it from you it can turn around and loan it to someone else) and a liability (because the bank is in debt to you for the amount of the deposit).The cash itself isn't both things- it's only ever an asset.
When I transfer cash from my wallet to the bank, I'm converting $100 of value from one type of an asset to another: from cash, to "a debt I'm owed by the bank".
The bank also didn't change its total position. It took on "a debt owed to mhink" (a liability), but gained "cash" (an asset).
The passage you quoted is from an earlier comment, so you are responding to something way out of context.
Let's rewind:
> Unlike the bank, your account at the utility company represents how much you owe them. So the meaning of debit/credit is reversed, but so is the direction of responsibility: your account at the utility provider is money you owe them, which is an asset.
No. There is no such thing as "an asset" without further qualification. The money you owe the utility company is an asset to them, but to you it's a liability. This is true for all financial instruments, including cash. Cash is an asset to its owner, a liability to society at large. So...
> The cash itself isn't both things- it's only ever an asset.
No, cash is a liability to society at large. The bookkeeping for this happens at the central bank. See:
https://www.federalreserve.gov/monetarypolicy/bst_frliabilit...
"The major items on the liability side of the Federal Reserve balance sheet are Federal Reserve notes (U.S. paper currency)..."
The terms debit and credit have meaning independent of their columnar position on a traditional ledger. I could create a ledger with the columns reverse or (shocking!) use a computer program with a data structure that doesn't encode the concept of left or right.
I think about it like this:
CR / Credit / Creditors -> what the business owes
DR / Debit / Debtors -> what the business owns
A CR entry is an increase is what the company owes (to creditors or shareholders), and a DR is an increase in what the company owns.A common objection to this is 'what about income and expense accounts'? But those are just equity: https://news.ycombinator.com/item?id=39991837
I wrote more about this here: https://news.ycombinator.com/item?id=32498992
Something I find frustrating is the - almost - endless debate and nitpicking on small details or elements implied but not explicitly stated...but I guess people are trying to be helpful (or right).
I didn't have an account to comment then but I really appreciated your perspective; it was extremely valuable seeing a few people saying 'forget about the credit/debit nomenclature, it's confusing' and recognising not everyone knows the terminology. Now I have an account here and can thank you for fighting the good fight again.
Over the ~20 years since I qualified as an accountant, I've found the concept of debits and credits useful. It has saved me from memorizing rules (like what's on the left and what's on the right), to design charts of accounts, to design rules for recording transactions etc.
Someone who doesn't ever need to design charts of accounts or accounting policies, and is never called upon to verify the correctness of an accounting approach, probably doesn't need to understand debits and credits. They can read a balance sheet and income statement without thinking about the concept.
And many people (even bookkeepers and accountants) are content to memorize rules without needing to understand their source.
But that doesn't mean the underlying concepts don't exist, or that they aren't valuable.
Imagine if there were a subreddit for accountants, some of whom dabbled in coding. There might be a back and forth about principles of objects oriented design. The general consensus might be that it's pointless to understand the principles, and that it would be better to focus on some small set of rules of thumb, that give the right answer in most cases.
They might be right in that context (accountants who code on the side), but it doesn't mean the principles don't exist or aren't valuable for people who do that stuff all the time.
(BTW I think accounting is, in general, taught very poorly. I wish more instructors used Frank Wood's books. An intuitive grasp of debits and credits is really useful and not hard to pick up, yet many people spend a semester studying accounting without developing any intuition at all.)
For the income statement, CR -> revenue and DR -> expense.
When you record transactions in accounting, you're updating various account balances, such as assets, liabilities, and equity. These updated balances contribute to the creation of the balance sheet, which provides a snapshot of a company's financial position at a specific point in time.
The income statement, on the other hand, reflects the changes in these balances over a period of time. There's nothing special about the line items on the income statement (e.g. revenue or expense). Any value on the income statement represents a change in what the company owns (assets) or what it owes (liabilities or equity).
Assets + Expenses = Equity + Income + Liabilities
Sum of all debits = sum of all credits
These two equations have their sides associated.
Assets and equities increase with a debit and decrease with a credit, and vice versa.
I find it easy to just think of debit as adding to the left and credit as adding to the right. Their definitions are always the same that way.
(to be clear, I'm backing up your point by giving the same circular explanation that I got constantly through Accounting 101 and 102, and then occasionally after that when dealing with the books)
Assets | Liabilities + Equity
Accounts classified as assets are debit accounts (left side), and accounts classified as liabilities or equity are credit accounts (right side).
The theory discussed everywhere in this thread is sound. You really don't need to use terminology like debit/credit for accounting.
What the discussion misses is the application of this framework. It is useful for a human to be able to visualize a complex transaction and work through missing pieces with the hints this framework provides. I'm missing something on the left? Oh yeah, I missed the deferred revenue debit.
That's exactly right -- you don't need to. The problem is that people do use this terminology, and they use it in a way that conflicts with common usage, which makes a very simple concept vastly more confusing than it needs to be.
I used to think that way, then I understood this thinking is the exact opposite of what’s happening.
Hundred million people on earth know how to work with debit and credit exactly as it has been written in accounting books for hundreds of years. When you need to expand your accounting department, you go and hire a person who understands things exactly the same way as your current accountants, can pick up their work, they can communicate effectively. As a CEO, you are spared of teaching every new junior accountant your own flavor of first-principles accounting, you don’t need to write your custom accounting software, and convert your company’s books for tax authorities and outside auditors who are not familiar with your system.
Same with music notation. Same with Java language. Same with every other piece of human knowledge.
That's actually a pretty good analogy. There is a lot in Java that could be improved too.
If you started teaching it another way, eventually that other way would be the norm.
Agreed. The concepts are all very simple. You can throw away all of the domain-specific terminology and reason about accounting theory with nothing but positive and negative numbers.
The utility of the confusing terminology and age old accounting frameworks isn't obvious unless you are a practitioner living "in it". It's not until you face the complexities of real world transactions (an accountant booking closing entries for a F500 company or something) that the strange left/right debit/credit way of thinking is very valuable.
So if you take out a loan to buy lemonade: +$5 to expenses, -$5 to liabilities. If you sell lemonade: -$5 to income, +$5 to assets. You just have to remember that equity, income and liabilities will be negative so flip them if you want to answer questions like "how much do I owe?"
As a neophyte: "credit" and "debit" make me think I'd need both entries to do books at all.
The way you've written it makes me think: "Oh, this is just single-entry accounting for people who aren't careful like me!"
So perhaps historically there was value in misusing terminology sufficiently to cause people to people turn off the optimizing compiler in their brain so that they just learn and do it correctly from the beginning?
Edit: clarification
I'm with you so far.
> the goal is to keep the accounting equation true at all times
Perfectly reasonable.
> For example, you sell a lemonade for $5. You add $5 to Sales (Income) and add $5 to Current Account (Assets).
And now you've completely lost me. Money appeared. Lemonade disappeared. I want to see the corresponding +$5 and -$5.
Making it fit the equation (Equity + Income + Liabilities = Assets + Expenses) is not an intellectually satisfying reason for 'Assets' to go up by $5 when I just lost $5 of assets.
What if it worked this way in physics?
I could write
Force * mass = acceleration
1N * 500g lemonade = 0.5 m/s/s
Then I could say: "If we halve the mass of lemonade, then we double the acceleration:" 1N * 1000g lemonade = 1.0 m/s/s
And then you could say "But you didn't halve the mass, you doubled it!" and then I could say "Yes I did, look, the equation still holds."This is just prescriptive (do it because I say so). It doesn't explain anything.
> As other commenters have pointed out, the "double entry" refers to multiple entries within your own ledger, it has nothing to do with someone else's ledger.
I didn't introduce the other guy's ledger, but since you did:
I lost lemonade (which is somehow an addition to my assets). So the "-5" which belongs in the buyer's lemonade - is the negative sign there to indicate that he gained an asset?
- $5 debit to cash (asset => debit means +5)
- $5 credit to revenue (equity => credit means + 5)
- $X debit to cost of goods sold (liability => debit means - X)
- $X credit to inventory (asset => credits mean - X)
Where X is the cost of the materials that went into the lemonade. So if X < 5, you made a profit. In terms of the equation, this comes out to:
Assets = Liabilities + Equities
(5 - X) = (-X) + (5)
So it all adds up to 0, but you make a (gross) profit or loss depending on the value of X.You wouldn't account for the customer's side of things because the customer is not on your books.
If I understand your comment correctly, where you're getting confused is, you're reading Current Account (Assets) to mean your inventory of lemonade. What they actually mean in this case is money moved from Income to your Assets (e.g. your cash register). That's why assets went up in this example.
Of course for your lemonade business you might keep track of your lemonade as well (which I think is what you're talking about when you refer to assets). The lemonade sale would then lead to a decrease in your lemonade asset and and an increase in your expenses (cost of goods sold), so the right hand side of the equation balances.
So when selling lemonade there are actually 2 things happening:
1. Your income and your assets (your amount of cash) both increased. Income and Assets are on different sides of the =, so the equation still balances
2. Your lemonade assets decrease and you incurred the cost of that lemonade as an increase of your expenses. Those are both on the same side of the =, so the equation still balances.
I knew beforehand that I will always get Credit and Debit wrong, but now I guess I can add Income and Assets to that.
> What they actually mean in this case is money moved from Income to your Assets (e.g. your cash register).
Usually when people say 'moved', it implies a decrease in one place and an increase elsewhere, and yet:
> 1. You got income and your assets (your amount of cash) both increased.
Yeah, I'm with you there. Personally I think this would be simpler if accounting just used negative numbers instead of a credit and debit side. That said, it's not super complicated. It's all derived from the accounting equation (explained well in this comment [1]):
Equity + Income + Liabilities = Assets + Expenses
Any transaction you do, needs to maintain that equation. That means that the changes either need to add to zero on one side or need to add to the same on both sides.
- E.g. in the example I'm selling lemonade: I'm increasing my cash (an asset, so on the right side) by $5, so I need to also increase the left side by the same, meaning an increase of $5 in the Income account.
- Or let's say I'm buying more lemons for my business. My cash (asset) goes down, but my inventory (also asset) goes up by the same amount.
- If I bought those lemons with my credit card instead, my inventory (asset) would go up and my liabilities would go up by the same amount.
In all cases the equation still holds after the transaction.
----
NB
You could construct an alternative way of accounting where the equation looks like this: Equity + Income + Liabilities + Assets + Expenses = 0
In this world, moving money would indeed align better with your intuition. E.g. selling lemonade would be -5 Income and +5 Assets (going from income to assets). That's for instance how Beancount does it [2]. Note that that also means that Equity, Income and Liabilities will now (generally) be negative numbers.
[1] https://news.ycombinator.com/item?id=39992035
[2] https://beancount.github.io/docs/the_double_entry_counting_m...
[1] https://beancount.github.io/docs/the_double_entry_counting_m...
State Accounts track your net worth
Assets: what you own
Liabilities: what you owe
Change Accounts track why your net worth changes Income: what you've earned
Expense: what you've spent
The accounting equation that follows is ∆ State = ∆ Change: Assets - Liabilities = Income - Expense
Selling lemonade is +$5 Asset balanced by +$5 Income.
If you substitute into the equation, it's: $5 Asset = $5 IncomeTaking out a loan is +$10 Asset balanced by +$10 Loan. In the equation: $10 Asset - $10 Liability = $0.
In general, say you have a +Asset action, to balance the equation you can do it 4 ways:
+Asset -Asset aka swapped for equal value
+Asset +Liability aka took out a loan
+Asset +Income aka sold something
+Asset -Expense aka got a refund
I've left out Equity as a separate account type since you can just treat it mathematically as a Liability account.This is the system we've implemented in our ledger API (https://fragment.dev)
Don't you mean -Asset here?
I did an explanation with numbers here: https://news.ycombinator.com/item?id=40021506
Ah. So... where is the value of the lemonade before you sold it? Wasn't that an asset before you sold it?
I was going through the 4 combinations of balanced two-line entries, based on the accounting equation, to show how it helps when thinking through how to record something.
If you get into more than two lines, then yup selling a good would be
+Asset -Asset +Income
or if you include sales tax and son shipping costs: +Asset -Asset +Liability +Income +Expense
Using an updated accounting equation and negative numbers is a lot more intuitive than credits and debits. In this larger example it tells you: Cash Asset - COGS Asset - Tax Liability = Sales Income - Shipping Expense
It tells you what types of accounts balance, with a syntax that matches your intuitions: more asset = good, less asset = bad, more expense = bad, less expense = good.LAAS!
Sorry, no, lemonade is not a service. It is true that you are adding value by turning lemons into lemonade, but that's not what you're selling. You're selling the lemonade. LAAS would be turning someone else's lemons into lemonade for them, but a typical lemonade manufacturer owns their raw materials.
I’ve also wondered what to do if you grow your own lemons. I guess you could offset the new asset on your books with a Harvest income account?
One of our customers built an ERP for food distributors, I should ask them how they would handle it.
To simply write that, "Bob's account has a credit of $12 and a debit of $7" is timeless. That sentence can go anywhere, and always be explicitly correct. It is context-free grammar: the same category that all programming languages belong to. Because a programming language is context-free, it can be perfectly understood (and translated) by a parser and compiler. Because statements using the nouns "credit" and "debit" are context-free, they can be perfectly understood as the data they represent.
> The "credit" and "debit" terminology is ridiculous because their definitions swap around depending on which account you're talking about, which is an utterly absurd (mis)use of language and the main reason people find this confusing.
On the contrary! Their definitions are always the same. They apply specifically to the account you are talking about, because they are that account: an account is a list of credits and debits.
The reason that people get confused is that we are used to using verbs like "paid" and "earned". When we use verbs, the data is the transaction, not the account. When we use the nouns "credit" and "debit", the data is the account, and not the transaction. Most people are introduced to these words with "credit card" and "debit card". That was the mistake, because cards are used for transactions, which is precisely the wrong context to use these words. It would have been much more clear to talk about "crediting cards" and "debiting cards".
(I'm 80% sure that the above reads that Bob actually owns $5 he can spend. But I'm equally sure that I get Debits and Credits backward, so I probably read it wrong.)
In any case, you've only described a single account at rest. You need to go one step further and describe an entire transaction in those terms, so that someone can swoop in and say "you got it backwards".
A transaction involves multiple accounts, so it would be written as multiple sentences: "Alice's account has a credit of $7. Bob's account has a debit of $7." If you want to write about the transaction itself, you could do that with a verb: "Transaction #23254 applies a debit of $7 to Bob's account, and a credit of $7 to Alice's account." A double-entry book is just a table with a column for each account, and a column for the date/time each credit or debit was transacted.
The whole point here is that when someone swoops in, every sentence spoken is guaranteed to be unambiguous; no matter what context that someone brings with them. So long as "credit" and "debit" are used exclusively as nouns, there can be no confusion.
I love it, let's do it!
Thank you this is very helpful.
The whole credit/debit terminology usage here is incredibly confusing to someone who hasn't studied accounting and many of the comments and replies to people who are confused are, while technically correct, simultaneously, unhelpful - to those not familiar with the terminology.
I read a comment earlier: "Why would my bank account be debited when the balance went up? Is a debit not negative? Is the cash balance presented as a negative?" And thought: "Yes! Great question! This doesn't make sense..because debits are always negative right? A direct debit takes money out, you spend money using a debit card, a debit is a debt right? So debits are always negative and debiting is always minus-ing money..." - but the replies, while technically correct weren't satisfying at all because they assumed knowledge.
It's both amusing and frustrating to watch people effectively speaking past each other like they're talking a different language. Especially when you have the same perspective as the person who is confused and trying to seek understanding. It seems like people nitpick on small points of what was said seemingly in order to be right.
Assets + Expenses = Liabilities + Equity + Income
We try to group the accounts by left and right side and find a common term for them (credit-normal and debit-normal). But it’s really hard to come up with an intuitive answer for why Assets and Expense should be on one team, and why the rest should be on the other team. So we just pick some team names and say shut-up-and-calculate.What if we re-arranged the equation to:
Assets - Liabilities = Income - Expenses
The accounts on the left side track your net worth. The accounts on the right side track why net worth changes. What should be the names for the two sides? I call them State and Change.You can then ditch credits and debits and ask - what is the impact of this financial transaction on my net worth? The equation will tell you which accounts should go up and go down using positive and negative numbers.
I go more into how this works here: https://news.ycombinator.com/item?id=39994335
> Definition 7: Debit An entry that represents money entering an account.
Not really, the meaning of debit and credit depends on the type of account: https://en.wikipedia.org/wiki/Debits_and_credits
Maybe there's a reason why it takes more than one course to become a CPA (https://www.accounting.com/careers/cpa/how-to-become/).
Not really, the meaning of debit and credit depends on the type of account
That's how most accountants think about it. But I think there's something more fundamental: a CR entry is an increase is what the company owes (to creditors or shareholders), and a DR is an increase in what the company owns.EDIT: see this link for how this relates to the accounting equation https://news.ycombinator.com/item?id=32501707
I can kinda squint and see "Oh, you want the universe to balance, so if I have something it is some kind of karmic debt". But it still feels like exactly the opposite of what I grew up thinking of these terms to mean.
As far as I can tell, the point is to double the amount of work in the hopes of catching certain kinds of errors. Which makes sense when you have humans making the entries and humans doing the arithmetic.
But I grew up in a world where computers do all of the math, and it always looks to me like it's violating the Don't Repeat Yourself principle. If you say the same thing in two different places, one of them is always going to be wrong.
I feel as if, had accounting been designed in the modern era, we wouldn't have done it that way.
I'm not an accountant and my failure to understand does not make the thing wrong. But my bafflement at "credits decrease an asset account" feels emblematic of something being genuinely off base.
The fundamental unit of a double-entry system is the transaction, which records from where things came and to where they went. In software parlance, it's an event-sourced system rather than the stateful/interactive system of single-entry accounting.
This is wrong on a couple of levels.
In your understanding do RAID disk arrays and backups violate “the Don’t Repeat Yourself principle”? Is one of the copies of the data guaranteed to be wrong? Do data backups duplicate data because of pre-modern thinking?
But on another level it’s irrelevant, because in double-entry bookkeeping, there is no duplication of information. If you buy an apple for a dollar, your journal entry will mark a dollar out of cash — which is true because you now have 1 less dollar — and a dollar against your “Food” expense account — which is true because the thing you just spent a dollar on was food. If you took away either entry, you would be losing information. The fact that both entries have to balance isn’t because of duplication, it’s because the same dollar can't exist in more than one place at a time, which is axiomatically true regardless of whether you use a computer.
That's also how I like to think about it, as a kind of checksum mechanism. Double-entry bookkeeping originated in medieval European markets, which were often open-air, noisy, dirty, full of thieves and other dangers. Keeping your records straight in that environment must be a challenge, and having a logic that allows you to catch some mistakes can be a powerful tool in that context.
But there's more to it, eg it allows you to make a distinction between expenses and investments, so it is actually a truly different way to think about your financial situation than eg looking at cash flows only. Spending X on a buying livestock has a different economic meaning than spending X to pay a security guard. There are economic historians who argue that this kind of perspective was an enabler of early capitalism, because it enables people to see that money spent on an investment isn't lost value.
If you spend $X on sheep, you credit $X where? Debit it from where? You put "$X worth of sheep" on what account? When the sheep die, do you credit some account with "$X worth of dead sheep?" (Where presumably they remain as dead-sheep forever.)
(I'm sorry, I know that sounds dumb.)
How is that "$X worth of dead sheep" different from "$X worth of security guarding" that you supposedly received?
You debit your 'sheep' account (maybe called sth like inventory) and you credit your cash account, or a liabilities towards suppliers account. Your equity stays constant in either case (no profit or loss impact), if you paid cash you've swapped X worth of cash for X worth of sheep, otherwise your liabilities went up by X.
When they die, you debit some kind of expense account (extraordinary losses or sth like that), and you credit the sheep account. In that case, you've made a loss of X and your equity (when you next draw up your balance sheet) will be lower by X (assuming that's the only business case). It might even go negative, eg if the sheep were your only asset and you still have the liability towards the guy who sold them to you.
It still feels exactly the opposite of what I thought a credit and debit were. Surely when you add sheep, you credit the sheep account and debit the cash.
I get it. It's just a shift.
More deets here: https://news.ycombinator.com/item?id=40021506
I think this is meant mostly to apply to code. For data, redundancy is a very common strategy for assuring accuracy and durability.
> If you say the same thing in two different places, one of them is always going to be wrong.
Yes! This is the exact point. The mismatch flags that there is an error that needs to be investigated and added to the ledger as a correcting transaction.
In double-entry, you’re tracking two different things: - Your current net worth. These are tracked in State accounts (Asset and Liability). - The reasons your current net worth changed. These are tracked in Change accounts (Income and Expense).
Say $5 enters your bank account, that’s recorded as an increase in an Asset account. Whether your net worth changed or not depends on the reason. There’s lots of reasons that could have happened, and that’s recorded as the second entry: - Took out a loan: increase in Liability (no net worth change) - Got paid back for a loan: decrease in Asset (no net worth change) - Sold something: increase in Income (net worth did change) - Got a refund: decrease in Expense (net worth did change)
I agree that re-engineering accounting is necessary for software engineers to build financial systems. I think it’s time to ditch credits and debits and instead deal in State and Change accounts with negative numbers.
PS I go more into it here: https://news.ycombinator.com/item?id=39994335
Something that makes this simpler to think about from a modern perspective is that accounting is older than the popular use of negative numbers. By a lot. If we were to invent accounting today, we'd probably use positive and negative accounts instead of debit and credit accounts.
Algebra over addition is second nature to us at this point, but it would not have been obvious to the average merchant in 1604, and even then, negative numbers were viewed quite poorly.
What is important is that there are always two sides to a transaction and that they are inverses of each other. This is all a credit and debit are. Inverse operations on a number.
Therefore, we can make a rule that a transaction balances when credit = debit. (aka we didn't invent money as debit + credit = 0, but remember that we didn't like negative numbers when this system was invented, so this last fact is more of a happy coincidence that happens to ALWAYS WORK, for some reason, rather than the goal).
What is then reasonable is to consider literal cash on hand to be the most positive (debit) kind of account there can be, and work backwards from there. If I want to handle an expense, then I need to invert the cash account somehow (credit it) and therefore have the opposite kind of entry for where the money went (debit it). So an expense account must have a generally debit (or positive) balance.
But where did the cash come from? Well that comes from income and I want the cash to be debit-ey so the place it came from must be credit-ey otherwise I risk writing a transaction that doesn't balance (equal zero). So then income accounts must generally be credit accounts rather than debit account (aka they hold a typically negative balance or are "credit normal").
What is really killer about this system, is it just so happens that every mundane transaction you could ever write will end up as balanced transactions and each of these possible transaction accounts end up having the same usual balance of credit or debit (negative or positive). I think that is just so elegant.
Interesting context on negative numbers, thanks for that!
[1]: https://www.reddit.com/r/plaintextaccounting/comments/1bh3x7...
I think the problem with that scheme is that without some notion of debit/credit (or equivalently, transactions that sum to 0), you can't easily tell if your transactions are balancing. Somehow you have to encode the information that Assets are a "left hand side positive" account type, and that Income is a "right hand side positive" account type, which is what the "income is negative" stuff is doing. But now you have to remember which side of the equation the account is positive on.
[1]: https://code.gnucash.org/docs/C/gnucash-guide/basics-account...
Don't store the account data. Instead store the transactions. Compute the accounts from that. The table "Transactions" should have the fields: Date, Amount, SourceAccount, TargetAccount, Description.
That is how it becomes beautiful in my opinion. Unlearn this habit of thinking in accounts just because that is what you know from your bank statements. Think in cash flows.
(Ok, this is too simple for the tax use case. Sometimes transactions have multiple sources or targets. So my schema above needs to be adapted for that. My point is that the thinking should still be different.)
If it does become a problem then one solution is to take sums at some point in time and start the ledger again paying each account from a contra account containing the previous balance.
By contrast, ALUs are stupendously well optimized for the baseline computational task of adding up integers.
The difference between nanoseconds and milliseconds is vast. It is consequently very often cheaper to recalculate a sum using data already in cache memory than to save it and later fetch it, or (even worse) to read a value precalculated by a neighbouring computer.
Furthermore, the distinction only matters for accounting systems at high scale. For the average small business accounting, it is de minimis: your computer performs more computation when resizing a browser window than it does in recalculating an account balance from scratch.
This is a bad design, please don't do this.
The better design is to have header and detail tables:
Header: TransactionID, Date, Description, (other fields as required, e.g., posting status, reconciliation status, etc) Detail: TransactionID, LineNumber, Account, Amount, Description, (other fields as required, e.g., reference numbers for subledgers, etc)
This allows a transaction to affect any number of accounts. In effect, the transaction ends up reflecting a business transaction which may affect many accounts.
You're adding an abstraction to enable more flexibility and functionality. That doesn't change the fundamental event-sourced nature of totals.
I'm not an accountant but decided to study double-entry bookkeeping and basic accounting a while ago. I learned a lot from many places, including great threads here on HN, and wanted to give back to the community. In this article, I explain the mechanics of double-entry bookkeeping and how I came to realize it's a directed graph.
I know there are many accounting nerds on HN so please feel free to criticize or suggest changes where I got things wrong!
One of the funnest things in computer science is realizing how some problem that you may not suspect initially turns out to be some type of graph.
[1] https://martin.kleppmann.com/2011/03/07/accounting-for-compu...
Let me know if it doesn't work for you!
If I get credited or I use a credit card money came from nowhere, woohoo. If I have a debit well that sounds like debt and my money decreased, boo.
I get that actually there's a good reason for the names but a field that doggedly sticks to non intuitive jargon that runs counter to every usage yet encountered for outsiders could do with some different non-overloaded terms.
I disagree. Discussions like this on HN always invite someone to say "Look, it's super simple. Credits are just... and debits are just ...". Then a reply saying "You have it backwards. Look, it's simple! Credits are just..."
I would be perfectly happy to ditch those terms forever.
I think a far more intuitive system is use negative numbers with a symmetrical accounting equation:
Assets - Liabilities = Income - Expense
Then you always think in terms of:- Do I have more or less assets?
- Do I owe more or less liabilities?
- Did I make more of less profits?
- Did I make more or less losses?
You can then use the accounting equation to check your reasoning. I go more into it here: https://news.ycombinator.com/item?id=40021375
I don't understand how describing debit/credit (accounting jargon) in layman's terms smacks of jargon, but maybe that is because I am a layman =)
As someone with no accounting background, credit/debt described as "money go in, money go out" seems like a good enough explanation in the context of this post.
Do the "true" definitions of credit/debit differ from that in a meaningful way here?
> A debit decreases assets or increases liabilities, while a credit increases assets or decreases liabilities. [1]
> A debit is always used to increase the balance of an asset account, and the cash account is an asset account. [2]
[1] https://xendoo.com/blog/debits-and-credits/ [2] https://www.fool.com/the-ascent/small-business/accounting/ar...
It's not just that they're a bit confusing, it's that those words serve exactly one purpose, which is to disambiguate the exact thing that people find confusing about them.
The biggest indicator of their failure is that they are always explained in terms of something clearer, and the reverse it not true. No-one says: "I don't understand what 'we received $50' means, can you explain that in terms of credits and debits?"
It seems to barely work with the toy example of couple transactions - imagine what the graph would look like with dozens or hundreds of edges between pairs of nodes. What use would there be for the typical algorithms that work with graphs?
This feels a bit like using pliers as a hammer. Sure, you can, I guess -- but why?
Engineers stumbling on foundational principles baked into other fields that software happens to be replicating.
1. it is another way to conceptualize an idea. For most purposes this might not be relevant, but who knows where a hard accounting problem might be resolved through the application of graph theory (or the inverse!).
2. it is another way to visualize flows. Not everyone is financially literate or numerically inclined, so instead of handing them a table of columns of numbers and having them reason about the flows numerically, it lets you represent the flows spatially which maybe easier. After all, not all tools are for professionals.
Additionally, while the cumulative history in one graph might be much, simply adding filters based on transaction date might provide non-obvious insight that other visualizations miss. I can see this probably being even more helpful by cross referencing other information such as location.
I wish OP included a working project that lets one ingest a ledger, producing a graph. Perhaps this graph view might be used for "forensic" purposes, where a one-line entry buried deep would stand out as an odd node?
Still a hard sell with only one very basic example provided -- especially in a domain that's been around forever and where any advantage is critical. The DE ledger seems like a basic, simple tool, iterated into perfection over millennia. You'd think you could improve it, but good luck if you try.
Instead, the "double entry" that complements the money leaving Alice's cash ledger is the entry of the value of the book into Alice's "book ledger", one decreases by $20, and the other increases by the same amount.
The company's accountant may care about balances and reconciling them back to things like the existence of said book, a receipt for payment or a bank transaction indicating settlement happened. At a big enough company, the accounts payables nerds may come along and be focused on making sure the full process procuring and paying has happened correctly, including record-keeping, tax compliance, and the actual movement of funds.
When you start to scale how all of these processes are executed and recorded, it's dense enough that it still surprises me many years later.
In an organisation's accounting (Alice LLC), the basis entry would state a debit (increase of expense) in the book expenses account, credit (decrease of asset) in the cash balance. The complete entry would then make a reference to the invoice/receipt of the purchase and the contact details of the bookstore (address, chamber of commerce registration ID, tax number, etc.).
The exact level of detail is determined by how 'complete' your books are supposed to be. A book expense might not mean much to Alice LLC (which does not deal in book sales/purchases), but a laptop should (see more on the subject of fixed asset registries), or a large invoice from a business from a different country (which will require a lot more diligence with tax 'metadata').
On the other hand, the bookstore definitely cares more about books and will then consider the sale and replenishment of its book inventory, and once again introduce more meta-accounting data (see more on the subject of management/manufacturing accounting).
In this case, you can be more precise about the type of graph: double-entry accounting creates a Directed[0] Bipartite Graph[1] with Labelled Edges[2]. Every edge is between a Transaction and an Account nodes, which makes it bipartite, and the amounts are edge labels.
[0] https://en.m.wikipedia.org/wiki/Directed_graph
Just by maintaining a local invariant -- debits and credits in a transaction sum to zero -- a distributed network of agents attending to their own ledger can reliably maintain a global consistent state (like, money is neither created nor destroyed), or heal it in the case of corruption.
1. since you want the capability to recompute all balances using ledger entries. 2. there are not two balances. There's usually a lot more. you want to update reward points, dues, late fees, partner share, etc etc etc. a 2 balance double entry ledger is a simplification.
once you set your mental model to think of it as a idempotency problem, there are multiple ways to model it. For e.g. a directed graph - traverse the entire subgraph to update balances. Or model it as a log database and re-run txns to arrive at balance computation.
Indeed, if you'd try to also track balances in the graph, you'd end up with the exact same limitations that the original, "mutable" account table had: You can only store a single "current" balance for each account and each time you add another transaction to the graph, the old balances of the accounts involved are lost.
You could fix this shortcoming by redefining the meaning of the "round" nodes in the graph and essentially treating the graph as a ledger: Instead of a round node representing an account, make it represents an account at a specific point in time, i.e. between two transactions. Then new transactions can be added as new nodes and edges to e.g. the right side of the graph and the graph will become a long chain that grows from left to right and represents the exchange of money over time.
(Another constraint has to be added that a transaction must never go "backwards in time", i.e. never go from a node to the right to one on the left and never have an "incoming" and "outgoing" edge pointing to the same round node)
With many accounts and transactions, it might still get difficult to keep track, which transactions are close together in time and which are far apart. This could be made easier by introducing another container, let's call it a block, that groups all transactions together which share at least one "round" node in their "incoming" or "outgoing" edge. Because of the "no going back in time" property, the blocks will be non-overlapping and they will also have at least a partial ordering to them that follows the chronologial ordering of the transactions.
If you want to make the graph extra pretty, pick one transaction in each block and use its timestamp to turn the partial into a total ordering.
If you zoom out, your graph indeed looks like a chain of blocks, going from left to right in the direction of time, with each block containing the transactions that belong to the same slice of time. A blockchain, if you will...
There's a way easier way to explain double entry bookkeeping for the article's target audience, it's just statics for accounting.
The post triggered PTSD and I want to go home and cry. You created your double entry, cool, now let's split it (because of million reasons) and add taxes. So now we deal with a basic 25 line document where some lines are doing nothing but move funds through certain tax accounts. Oh, no, there is a typo, but we cannot just create the reversal because for some accounts, the transaction should stay reflected in turnovers, for some it should not and for most it depends on fiscal period and stuff.
Don't forget that everything varies between countries. With all that let's create a financial statement for eg Walmart (who has every line item sold posted to SAP system when you buy things at store)
Shudders
Thank you!
I don't bother keeping my ledger immutable, though. The point about immutability is that whatever happened is immutable (because it's in the past; it already happened!) and the ledger should just reflect that. So if I somehow made a mistake in my ledger I just correct it. I keep my ledger in git so that does record changes to the ledger itself, but I rarely, if ever, need to access these.
I can't really think of a case where I have made a mistake, but if, for example, I sold something to a friend I would debit (+) their "reimbursement" account with the amount they owe me. If I typoed that to 10x the amount, I would just go and correct the typo, I wouldn't make two new entries to revert then correct the mistake.
Can you share more on the system you've come up with? In what format do you store the data? Do you store files per account, or per day, etc.? Do you have a CLI helper to quickly read, write, edit the files? Maybe you can even share a demo repo?
I believe this same plain text format is used by other tools, which you can find info about here: https://plaintextaccounting.org/ (In particular a lot of people seem to use hledger and beancount)
The ledger is written using a text editor. The purpose of the software is to add everything up, calculate the balances and make sure everything balances. I keep all of my 12 years of accounting in one file and haven't noticed any slowdown. But a real business would surely have many more accounts and may want to split files by financial year or something.
I use helper scripts to convert the data from my bank CSV downloads into ledger format. It uses machine learning to associate payees to accounts (e.g. "Tesco" gets filed to the account "Expenses:Groceries"). I haven't maintained the ML part although it works for me most of the time. In case it's useful, the code is here: https://github.com/georgek/accounts/
My main problem with adapting the representation was in the incommensurability of different kinds of asset moving through the pipeline. How does one credit source code and debit a blob store? I thought about learning more about multi-currency accounting as a source for ideas but never followed it up.
That effort inspired my thinking about a "Universal Asset Graph" for software[0] -- keeping track of not just containment but also movement and transformation of software. It's a partial but not complete inspiration for GUAC, which aims to capture software part relations for easy querying.
[0] https://theoryof.predictable.software/articles/some-requirem...
[1] https://guac.sh
1. It may be beneficial to segregate ledgers (used to record transactions with customer accounts, i.e. with assets you do not own) vs. books (transactions recorded to present own assets and liabilities). Books are used to account for all possible types of assets and liabilities, while ledgers are usually strictly limited to reflection of cash movements. I think the article is about ledgers.
2. Regarding the state of each account at each period in time, I think there is a lot of confusion between reflecting activity / transactions in the period and adjustments related to how prior transactions were recorded. I personally thought that adjustments could be better accounted for using something like a model with slowly changing dimensions where you can see history of each change. So it is not something you want to see on the directed graph by default, but something you want to be able to trace.
3. There was one idea that I really don’t like because although it make sense on surface, it has really bad implications for accounting and analytics. The idea I am talking about is that you don’t need to have one debit and credit for transaction, rather you just need to make sure that total debits equal total credits. say, Bob has several types of accounts and multiple customer. Now Bob asks you to tell him, how much of the current balance of a specific account was generated from proceeds by customer. To answer it, you now have to solve many-to-many relationships between customers and Bob’s accounts. And sometimes it has no deterministic answer because we balanced multiple accounts in one entry. And accountant now have to use imagination and excel to prepare a manual report that uses multiple assumptions to answer this question.
Two types of accounts:
- assets (you want your balance to be more than 0)
- liabilities (you want your balance to be 0)
Two types of entries:
- debits (increase balances of assets, decrease balances of liabilities)
- credits (increase balances of liabilities, decreases balances of liabilities)
Rules:
- A transaction represents a transfer of value between accounts.
- Every transaction must have at least two entries. The balance of all entries the transaction holds should be 0, i.e., balance = debits - credits.
You don't think about money leaving or entering an account before you nail down those definitions. The account representations can be anything that holds a numeric value, not just money.
You can affect more than two accounts by adding additional entries with the condition of keeping the balance to 0.
I think in this problem hides two mistakes:
- Zero liabilities is not a reasonable goal for most people.
- There's an equity account type also. (Also income and expense accounts.)
- I receive my paycheck in my bank account.
- I want to budget $800 for groceries every month.
- I have a credit card with a balance of $250.
- I want to know how much I have left; we will have an account named Left to Budget (LTB).
Let's outline them as accounts:
- Bank Account. It's an Asset and has a balance of $0.
- Groceries "category" Account. It's a Liability and has a balance of $0.
- AMEX Account. It's a Liability and has a balance of $250.
- LTB is my income account. It's a Liability (yeah, I know, but stay with me).
When I receive my $1,000.00 paycheck.
- Debits Bank (ASSET) for $1,000.00
- Credits LTB (LIABILITY) for $1,000.00
Balances:
- Bank (ASSET) $1,000.00
- Groceries (LIABILITY) $0.00
- AMEX (LIABILITY) $250.00
- LTB (LIABILITY) $1,000.00
I budget $800 for Groceries for this month.
- Debits LTB (LIABILITY) for $800.
- Credits Groceries (LIABILITY) for $800.
Balances:
- Bank (ASSET) $1,000.00
- Groceries (LIABILITY) $800.00
- AMEX (LIABILITY) $250.00
- LTB (LIABILITY) $200.00
I go to the grocery store and buy Milk for $50 and Bread for $10.
- Credits Bank (ASSET) for $60.00
- Debits Groceries (LIABILITY) for $60.00
Balances:
- Bank (ASSET) $940.00
- Groceries (LIABILITY) $740.00
- AMEX (LIABILITY) $250.00
- LTB (LIABILITY) $200.00
As of now, I effectively know that:
- I have $940 in my bank, but I only have $200 available to spend (LTB).
- I have $740.00 left to spend on Groceries in my Bank.
- If I wanted to pay my Credit Card (AMEX) in full, I couldn't. Even though I have enough money in my Bank, most of it is already allocated to Groceries. BUT I could adjust my budget, like so:
Adjust my Groceries budget by moving $50 back to my LTB, so I can pay my Credit Card in full this month.
- Debit Groceries (LIABILITY) for $50
- Credit LTB (LIABILITY) for $50
Balances:
- Bank (ASSET) $940.00
- Groceries (LIABILITY) $690.00
- AMEX (LIABILITY) $250.00
- LTB (LIABILITY) $250.00
OK, so now I know that:
- I still have $940.00 in my bank.
- If I wanted to pay my Credit Card I can because I have enough in my LTB category.
- I have $690.00 available to spend in Groceries, because I moved $50.00 away.
Now, let's pay my Credit Card.
- Credit Bank (ASSET) $250.00
- Debit AMEX (LIABILITY) $250.00
Balances:
- Bank (ASSET) $690
- Groceries (LIABILITY) $690.00
- AMEX (LIABILITY) $0.00
- LTB (LIABILITY) $0.00
Now the money I have left in the Bank is for Groceries only. If I wanted to spend on something else, I'd have to either:
- Create a new Category and transfer an amount from Groceries, or
- wait for my next paycheck.
--
We were able to manage all this information with only one bank account, but we successfully managed a small budget.
Double-entry is a concept that's not necessarily applied directly to "physical" accounts. We transfer values between accounts even when the money stays where it is.
> - Zero liabilities is not a reasonable goal for most people.
Zero liabilities is not a goal; it's the direction on whether money balance increases or decreases; it's not tied to the money you have or owe. It's a concept or formula rather than a reality.
> - There's an equity account type also. (Also income and expense accounts.)
Equity and expenses are Assets. Income can be an Asset or a Liability, depending on how you want to represent it. For me, it is a liability because I want it to be 0. Even tho, my income account will have money, its representation of Money Left to Budget will be zero because the accounts that transfer value from it will include savings or investing accounts.
Somewhere VERY close to this modeling patterns has always been an interesting use case for us is large-scale visual analysis of crypto investigations, where the ledger gets shown quite similarly. The bit on taxes is funny too, as that's the first thing to get filtered out because it makes the graph messy :) Often, balances aren't initially known, so a post whole-graph-compute step is done to algorithmically enrich nodes after.
You can also do visual tricks here, like collapse 'multiedges' between the same accounts to get a summary of their p2p history. Analytically, this becomes an easy groupby on a ledger dataframe :)
To a lesser extent, we also see fiat $ investigations here too, imagine correspondent banking. I wish more bigco AML forensic accounting did this internally (erp, credit cards, ..), especially as so much is digital now, but we don't see that as much.
An interesting area becomes when you do things like add identity details to the graph, and can then start realizing the "A" and "Alice" and contra XYZ are all the same person. Another, which helps once you have a lot of data, is to start to be able to decloak transaction $1 "food" is a Costco hotdog, or funny buying patterns. Both are where "graph neural networks" come in, which have really advanced over the last few years. We see this kind of things in finance, like risk analysis. We find most folks are at the viz stage vs AI stage, and it's a multi-year relationship to get them from one to another, but a fun one!
---
Edit: Another practical modeling aha here is that a transaction can involve multiple entities. Formally, that is a hyperedge: it's fine for edges to connect more than 2 nodes. (And why languages like datalog are neat here, even if rare.) Visually that's confusing, so a trick is to make the transaction a node and connect it to all the involved accounts. Keeping transactions as event edges between entities can be nicer when zoomed out as fewer nodes, but having the transaction node is nice when zoomed in, and in the limit, there are asymptomatically fewer nodes+edges when doing the transaction node as you replace strongly connected components (quadtratic in edges) with a hub&spoke, which is linear.
I think double-entry bookkeeping is, at least to me, as fundamental to economics (and of course business) as logic to math. Even if some actors don't use it explicitly, it still holds. If I buy ten apples for 10 bucks, I have ten more apples in stock and ten bucks less.
Many economic discussions (not only on HN) get out of hands because people don't try to see the full picture or deliberately choose to see one side. I've even seen a professor of economics claim in public that the world is too much in debt. Well, double-entry bookkeeping tells you that there are always two sides to consider.
For example, in case of governmental debt they ignore the other side of that debt, which might be assets. Assets like airports, schools, bridges, etc. Usually, we call such things useful.
Another typical example is the central bank "prints money". Well, double-entry bookkeeping tells us that it's not possible. If they hand out currency, the counterpart needs to trade something in (typically repurchase agreements with commercial banks). (Leaving aside here the idea of helicopter money, which could even go into neg. equity or a loss.)
It isn't as strict in that it allows for assets to alter in value, for profits or losses to be made. But it does keep track of the way that money and "value" circulates in different forms, e.g. as cash, assets, debts, depreciation, etc.
The "double entry" keeps track of the transformation of the nature of "value". This is hard to do using a simple household-style "cash-in" and "cash-out" set of accounts.
But here I'd caution against the idea that banks (not even central) cannot increase money supply because that's not really true. If a Bank is the backer of both sides of loans or engage in fractional reserve banks (i.e all banks), they can effectively increase money supply which in my opinion is equal to printing money. Especially since in the loan case, the loan is not necessarily a guaranteed asset (think cars in a crash). This effect is called the money multiplier effect via fractional reserve banking. https://www.youtube.com/watch?v=93_Va7I7Lgg
The multiplier is more of ceiling to the amplification rather than it actually happening on loans. None of this necessarily bad loans and investment are really important to other parts of economics but none of it is simple and non of it is stable in the traditional sense
[0] http://collegecatalog.uchicago.edu/thecollege/economics/#Fun...
I think this is yet another good example of thinking with double entry bookkeeping.
[1] https://www.investopedia.com/articles/investing/022416/why-b...
Events being constrained to historical statements of fact.
Also I’m sure this is extremely well studied but I’m not super familiar — ML on accounting graphs could identify shapes that indicate illegal transactions, etc… Will dig for reading :)
But so far with little success. I think I’m the only active user of Transity.
Use the appropriate structure for the data. A graph is not appropriate as you lose information about time, which is important to the ledger. No, you can't add time as a value on your edges. If you did, you'd either have several dozen graphs, or they would look absurd.
Credits actually increase the revenue account, which is a pretty important one!
- balance = states
- transactions = state transitions
It is simply the representation of state transitions as a diagram, similar but not equivalent to that of a state machine.
Also, by the way, the whole debit/credit thing in English-language accounting is supremely idiotic: a credit is an increse in this account, but a decrease in this other type of account? What? It's purely for job security for accountants.
There are accounts which represent outside interests/stakes in the company. Then there are accounts which represent what the company has.
The outside interest accounts run negative (under normal conditions). An interpretation of that is that the company owes what it has to the outside interests.
The sum of all the accounts is zero.
The outside interest accounts go negative when the company grows. E.g. $100 added to cash (account representing what the company has) might be balanced by a -$100 into the owner's equity account. The company owes $100 more to the owner.
If the $100 came from a bank, then rather than the equity account going down by $100, the account representing that bank or loan (outside interest) would go down by $100, more negative.
If the company buys some equipment for $100 for cash, then -$100 goes into cash, and $100 into assets.
When that asset depreciates, turning to $80 dollars a year later, -$20 goes into assets, and $20 into owner's equity, bringing it closer to zero.
The impression of that poor software reflects poorly on the rest of us.
I think the real winner isn't Bob or Alice though they each benefited from the exchange. The real winner is the credit card company that banked 10% of the transaction on Alice's side and 5% on Bob's side. Sounds like they both chose the least sensible option to handle payment.
Maybe Bob should've made it clear that he accepted cash, money orders, cashier's checks, or personal checks, or even cryptocurrency so that Alice would not need to suffer a foreign currency conversion fee especially when you consider that they live in the same small town.
Just kidding. I realize that the example transaction needed some massaging on the path to the end graph to illustrate handling of more complex, real-world transactions.
Great job producing this intuitive break-down.
There is one thing that I found interesting near the top of the tutorial. You make the statement "But money is meant to be spent." If money exists to be spent then why do so many people accumulate such vast sums that they could never spend all that they have managed to accumulate? Dumb question, I know. Money in the hand has indeterminate or no value until the bearer needs to acquire a product or service and then the value of the money in hand is set by the seller of the product or service they require. The global economy functions because at some point in time a traditional barter system where useful physical items were exchanged was replaced by the current system involving exchange of special artisan linen papers or conveniently portable metallic disks emblazoned with cartoon images celebrating historical events or personalities.
Anyway, this was a good read and I enjoyed watching the transaction ledger complexity increase to account for real-world situations where there are more than two parties involved in a single transaction. Years ago when I was in high school we had a class that introduced us to checking and saving accounts and the goal of the class was to teach us how money moves through the system so that we could manage our own assets once we had real jobs and incomes. We had the introduction to the ledger book with one side handling credits and the other handling debits. It was all confusing at first but ended up being very useful.
A long time after this class I found myself working as an independent consultant paid a negotiable hourly rate. All of that earlier instruction came in very handy when I needed to split project time and classify and categorize all the transactions that helped me understand where all that cartoon cash came from and where it all went. My spouse is a CPA/Auditor so having her level of knowledge and experience close to hand was also enormously useful in splitting everything so that the charts and graphs I assembled were most intuitive.
Thanks! I enjoyed reading this.