Explainers

Internal · Gate · inquiry 02

Double-entry conservation

If a balance increases, which account decreased by the same amount? Until that account is named, the increase is not a fact in these books. A larger number written on one line changes the total held by the network. The gate exists to refuse that write.

The previous page asked why a single function must stand between a caller and a balance. This page asks what that function demands of the lines. The question is conservation alone: after a write the Gate accepts, is the sum of every balance change zero?

What has to be named

The account that holds the change

Each tenant has one account. There is one system origin account, and the network issues value against it. Treasury accounts exist for a fee, a tax, or a burn. An increase with no account on the other side has nowhere to be recorded.

The event that ties the sides

A move is an event with one name, and at least two lines. Each line is a debit or a credit, never both, and never negative. The name is how the gate knows it has already accepted this move.

Ask the books

In this ledger a debit raises the named account and a credit lowers it. That sign is local to these books. It is not the textbook convention, in which the meaning of debit depends on the kind of account. Post an earn, a spend, and a payment. Then post a write that names only one side. Read the sum after each one.

Sum of all balances0

Start from zero. The first legal earn should raise the tenant by 100 and lower the origin by 100. The origin may go negative. That negative balance is the quantity the network has issued. The sum should remain zero. If it does not, the write was not conserved.

What the gate will not accept

CheckIf it fails
The event has a nameRefused. The same name a second time returns the result already stored. It does not issue again.
At least two linesRefused. One line cannot name the account that gave the value up.
Debits equal credits, and the total is not zeroRefused. Unequal sides would change the amount held by the network.
A line is a debit or a credit, not bothRefused by the table. A line that both raises and lowers itself does not name a counterparty.

Three answers, same test

Each legal shape names every account that moved. Add the increases. Add the decreases. They match.

MoveRisesFalls
EarnTenantOrigin
SpendOriginTenant
Pay with a feeSeller and treasuryBuyer, by the same total

The lines remain. The database will not delete an event that still has lines, so a later reader can reconstruct the balances from the events rather than from a stored total alone. The figure on a profile is copied from the tenant balance after the write. If the profile and the balance disagree, the balance is the book.

What this question does not settle

Conservation does not ask whether the tenant had enough to spend. The Gate still accepts a spend that drives that balance below zero. Some callers refuse that case before they reach the Gate. Conservation also does not ask which decision, person, or job the move belongs to. A model call is not required here. A separate record can show that a decision row was not edited. That record does not move value. Those are later questions. They are not exceptions to the sum on this page.

The question this leaves

A conserved write can be checked. It does not, by itself, tell you why a tenant with different aims would agree to keep their value in the same book as someone else’s.