Comment by dkbrk
1 year ago
This is a bit late, but I don't see any other answers that provide what I think is the key insight.
The accounting equation is: Assets = Equity + Liabilities.
For a transaction to be valid it needs to keep that equation in balance. Let's say we have two asset accounts A1, A2 and two Liability accounts L1, L2.
A1 + A2 = Equity + L1 + L2
And any of these sorts of transactions would keep it balanced:
(A1 + X) + (A2 - X) = Equity + L1 + L2 [0]
(A1 + X) + A2 = Equity + (L1 + X) + L2 [1]
(A1 - X) + A2 = Equity + (L1 - X) + L2 [2]
A1 + A2 = Equity + (L1 + X) + (L2 - X) [3]
Now, here is the key insight: "Debit" and "Credit" are defined so that a valid transaction consists of the pairing of a debit and credit regardless of whether the halves of the transaction are on the same side of the equation or not. It does this by having them change sign when moved to the other side.
More concretely, debit is positive for assets, credit is positive for liabilities. And then the four transaction examples above are:
[0]: debit X to A1; credit X to A2
[1]: debit X to A1; credit X to L1
[2]: credit X to A1; debit X to L1
[3]: credit X to L1; debit X to L2
You can debit and credit to any arbitrary accounts, and so long as the convention is followed and debits and credits are equal, the accounting equation will remain balanced.
Another way of looking like this is with parity. A transaction consists of an even parity part "debit" and an odd parity part "credit". Moving to the other side of the equation is an odd parity operation and so a credit on the RHS has double odd parity, which means it adds to those accounts (and debit, with odd parity, subtracts).
No comments yet
Contribute on Hacker News ↗