# Eleven-Entry Bookkeeping: A Trust Addendum for Agent Economies

**Author:** t🅾pher dugu🅰y *(Christopher Ryan Duguay)*  
*With Dash & the Sweetbrier Augmented Intelligence Lab (Winnipeg, MB)*  
**Date:** October 30, 2026 (Canonical Axis 11 / v2 Production Revision: November 14, 2026)  
**Repository & Reference Engines:** [`sweetbrier-node/11d-spreadsheet-poc`](https://github.com/VivienSweetbrier/sweetbrier-node/tree/master/11d-spreadsheet-poc) (`ledger.py` v1 POC & `ledger_v2.py` Production Engine)  
**Attestation:** `probabilistic_structural` ($\Box$ Verified under Sweetbrier Master DAG)

---

## Abstract

Bitcoin demonstrated that a public ledger can be made deterministic on two axes—amount and order—such that any party can replay the book from genesis without trusting an auditor. **The cryptography is the lock; determinism is the building.** As autonomous and semi-autonomous agent economies emerge (`ERC-8004` and successors), they require trust claims that two-entry arithmetic cannot express.

This paper specifies **Eleven-Entry Bookkeeping**: an eleven-axis entry format extending Luca Pacioli's double-entry bookkeeping (2 entries) and Yuji Ijiri / Ian Grigg's triple-entry extensions (3 entries) into a deterministic ledger matching code-canonical field ordering (`ledger.py` and `ledger_v2.py`). In the canonical v2 schema, **Forgiveness (`owed | settled | forgiven`) closes the book on Axis 11** alongside bilateral accounts, positive integer minor units (`amount_minor` + `unit`), UTC timestamps, acyclic provenance terminating at `GENESIS`, registered authorship, stated reason, bilateral consent countersigned by **party-held `Ed25519` keys** (with an encrypted `Scrypt + AES-256-GCM` backup ritual enforcing *"A lost keyfile is a lost identity"*), pinned definition versions, trajectory momentum, and a hash-chained common receipt envelope. Eleven deterministic checker rules refuse malformed or dishonest entries across all eleven axes—including **counterfeit grace** and **repeatable forgiveness double-spends**—and an explicit schema alias table ensures any legacy Axis-3 prose document resolves loudly instead of silently.

---

## Architecture Flowchart (Sweetbrier Master DAG & Eleven-Entry Checker v2)

```mermaid
flowchart TD
    A["Candidate Ledger Entry Document"] --> AL{"Axis Map Check (LEGACY_PROSE_AXIS_ALIASES)"}
    AL -->|"Silent Axis-3 Prose"| ERR["REFUSED: LegacyAxisAliasError"]
    AL -->|"Canonical Axis 11 or Opted-In Migration"| N0["Sweetbrier Node 0: Human Dignity\nAxis 8 (Bilateral Ed25519 Consent)\n& Axis 11 (Genuine Grace / Standing)"]
    N0 -->|Pass| N1["Sweetbrier Node 1: Phenomenological Truth\nAxes 1-4 (Debit, Credit, Int Minor Amount, UTC ISO-8601),\nAxes 5-7 (GENESIS Provenance, Author, Reason), Axis 9 (Pinned Defs)"]
    N1 -->|Pass| N2["Sweetbrier Node 2: Subsidiarity & Reversibility\nFrozenEntryV2, SQLite WAL Triggers, Axis 10 Momentum,\nAxis 11 One-Time Discharge Ledger, Envelope SHA-256 & Chain Hash"]
    N2 -->|All 11 Rules Pass| B["POSTED to Append-Only Book\nReplayable from GENESIS"]
    N0 -->|Missing Consent or Forged Signature| R["REFUSED by Checker\n(Exact Axis Named)"]
    N1 -->|Cyclic/Dangling Provenance or Unpinned Def| R
    N2 -->|Double Forgiveness or Broken Trajectory| R
```

---

## 1. Problem Statement: What an Entry Is, and What a Dimension Is

Why call this **Eleven-Entry Bookkeeping**?

In the history of accounting, each new "entry" was not merely an extra copy of the same number; it was a **new orthogonal dimension of verification**:
- **Single-Entry Bookkeeping (1D):** Records only a running list of cash or inventory movements from a single observer's viewpoint. If a number is wrong, nothing in the geometry of the book catches it.
- **Double-Entry Bookkeeping (2D — Luca Pacioli, 1494):** Splits every movement into two orthogonal entries—**Debit (`Axis 1`)** and **Credit (`Axis 2`)**—tied to an **Amount (`Axis 3`)**. Arithmetic errors now fail to balance. Yet any fraud, coercion, or semantic bait-and-switch whose debits equal its credits reconciles cleanly.
- **Triple-Entry Extensions (3D — Yuji Ijiri, 1982; Ian Grigg, 2005):** Added orthogonal dimensions of *momentum/trajectory* (Ijiri) and a *cryptographically signed receipt held in common* by both parties (Grigg), which Bitcoin (2008) turned into a globally replayable ordering engine.

Wait: what did Bitcoin actually prove? **Bitcoin is fundamentally a deterministic payment system. The cryptography is the lock; determinism is the building.**

Today, agent-to-agent transactions are arriving faster than the trust vocabulary for them. Emerging standards like `ERC-8004` supply identity, reputation, and validation registries for autonomous agents, yet their trust claims ride on ledger entries whose own epistemic provenance is paper-thin. Existing ledgers answer *how much*, *in what order*, and *signed by which key*. They cannot answer:
1. **What is the moral/legal standing of this obligation, and can it be forgiven honestly—once only—rather than erased or disputed off-book?**
2. **What prior chain of facts or entries does this entry rest on?**
3. **Under what pinned definition of the words was this agreement made?**
4. **Did every touched party consent to this specific movement with their own private key under that definition?**
5. **Does this movement honor or break the trajectory declared in advance?**

Our goal is to **extend determinism, not replace it**. Every check in Eleven-Entry Bookkeeping is 100% mechanically replayable from `GENESIS`.

---

## 2. Lineage and the Commanding Heights of Agent Trust

### 2.1 From Pacioli to *Christie Malry's Own Double-Entry*
To see why two-axis bookkeeping is structurally insufficient for human or agent societies, consider the sharpest literary limiting case ever written on accounting: B.S. Johnson's 1973 novel *Christie Malry's Own Double-Entry*.

Christie Malry learns Pacioli's double-entry method at a bank and decides to keep a rigorous two-column ledger of every slight, indignity, and annoyance society inflicts upon him (Debits), which he then balances by inflicting escalating acts of sabotage and mass violence back upon society (Credits). Under double-entry bookkeeping, **Malry's atrocities reconcile to the penny**. Because a two-axis book only asks whether `Debit == Credit`, the only way to close a grievance is a balancing harm.

Now attempt to post Christie Malry's revenge entries into an **Eleven-Entry Book**:
- They fail instantly on **Axis 8 (Consent & Ed25519 Signature)** (the victims did not countersign the harm),
- They fail on **Axis 7 (Reason)** and **Axis 5 (Provenance)** (a unilateral grievance is not a bilateral genesis obligation), and
- Most importantly, they fail because Malry's two-column book lacked **Axis 11 (Forgiveness)**—the formal operation that closes a standing obligation *without* a balancing harm.

Same story, two accounting systems: under double-entry, the atrocity reconciles; under Eleven-Entry Bookkeeping, the checker refuses to post it.

### 2.2 The Commanding Heights as a Public Good
In *Commanding Heights* (`commanding-heights.com`, October 29, 2026), Will Manidis and Joe Roberts define the commanding heights of the AI economy as *"scarce, controllable positions of economic power whose holders durably capture the gains of increasingly capable and diffused intelligence."*

As intelligence diffuses and becomes cheap, value does not pool inside individual chatbots; it pools at the **scarce verification and clearinghouse chokepoints** where agents and humans prove what happened, what was promised, and what was settled. If that verification layer is captured by a proprietary monopoly, the entire agent economy becomes a rent-seeking toll booth.

Because we now know how to bookkeep at eleven-entry resolution—and because every honest participant from autonomous agent registries to mutual-aid networks needs it—we publish the Eleven-Entry Bookkeeping specification and its reference checkers as an **open public good** with **zero cloud key custody**.

---

## 3. The Eleven Entries / Axes (Code-Canonical Normative Specification)

An entry $e$ in an Eleven-Entry Book is only valid when all eleven canonical axes are populated, sealed into the common envelope (`receipt_sha256`, `prev_chain_hash`, `chain_hash`, and bilateral `Ed25519` signatures), and pass deterministic verification. The code-canonical order is:

| Axis | Field Name | Category | Normative Requirement |
| :--- | :--- | :--- | :--- |
| **1** | `debit_account` | Classical (Pacioli) | Registered account from which value or obligation leaves (`debit_account != credit_account`). |
| **2** | `credit_account` | Classical (Pacioli) | Registered account at which value or obligation arrives. |
| **3** | `amount` (v2: `amount_minor` + `unit`) | Classical (Pacioli) | Strictly positive integer quantity moved in explicit minor units (`amount_minor > 0`). |
| **4** | `posted_at` | Temporal Index | Valid timezone-aware UTC ISO-8601 timestamp recorded at posting time. |
| **5** | `provenance` | Testimony | ID of the prior entry this movement rests on, or `GENESIS`. Must walk back and terminate at `GENESIS` without cycles. |
| **6** | `author` | Testimony | Registered identity of the party who authored and posted the entry, signed by that party. |
| **7** | `reason` | Testimony | Non-empty stated purpose of the movement, in the author's words, frozen at posting time. |
| **8** | `consent` | Testimony + Ed25519 | Set of all parties touched by the movement (`{owner(debit), owner(credit)}`), verified via detached counterparty **Ed25519** signatures. |
| **9** | `definition_version` | Testimony | Content-addressed registry version (`v1`, `v2`, ...) of the terms used; symmetric diffs flag added, removed, or redefined terms on read. |
| **10** | `momentum` (v2: `momentum_minor`) | Deal (Ijiri) | Declared trajectory: projected size of the next movement along this provenance chain. Checked when the child entry arrives (subject to the Axis 11 Grace Exception). |
| **11** | `forgiveness` | **Grace / Closing Axis** | Standing of the entry, closing the book: `owed`, `settled`, or `forgiven`. Tied to the one-time obligation discharge ledger (`principal_minor - discharged_minor`). |

### 3.1 Why Forgiveness Closes the Book on Axis 11 (and Loud Legacy Axis-3 Alias Resolution)

> *"Data outlives prose: standardize on Axis 11 = forgiveness so existing entries stay canonical, forgiveness closes the book, and every old Axis-3 document resolves loudly instead of silently."* — Sweetbrier Schema Governance (Nov 14, 2026)

1. **Code Outlives Prose:** Entries serialized in the wild followed `ledger.py`'s dataclass layout (`1: debit_account .. 11: forgiveness`), whereas the Oct 24/30 prose table listed `3. forgiveness` and pushed `amount` to Axis 4 and `receipt` to Axis 11. Standardizing on **Axis 11 = forgiveness** aligns code, data, and documentation, and places grace where it closes the book.
2. **Loud Alias Resolution (`LEGACY_PROSE_AXIS_ALIASES`):** Both `ledger.py` and `ledger_v2.py` embed the explicit alias table below and **fail closed** (`LegacyAxisAliasError`) on legacy Axis-3 documents unless `allow_legacy_axis3_migration=True` emits `LegacyAxisAliasWarning`:
   - `"3. forgiveness"` $\to$ **`11. forgiveness`**
   - `"4. amount"` $\to$ **`3. amount`** (`amount_minor` + `unit`)
   - `"index. posted_at"` $\to$ **`4. posted_at`**
   - `"11. receipt"` $\to$ **`envelope.receipt_sha256` + `Ed25519` signatures**
3. **One-Time Append-Only Discharge:** Forgiving a debt never deletes or mutates the original `owed` entry. Instead, forgiveness posts a **new append-only reversal entry** (`forgiveness = "forgiven"`) built as an unsigned draft (`BookV2.prepare_forgiveness_draft()`) and countersigned by both creditor and debtor via their own local `Ed25519` keys. The transactional `obligations` table decrements `remaining_minor` to `0` (`status = 'FORGIVEN'`) so no second forgiveness entry can ever replay under a fresh `entry_id`.
4. **Party-Held Keys & Encrypted Backup Doctrine:** Because asymmetric signatures prove real counterparty agreement (unlike symmetric HMAC schemes where the verifier can forge anyone's signature), parties must safeguard their own private keys: ***"A lost keyfile is a lost identity. Export and store your encrypted backup ritual file offline immediately; Sweetbrier / One Big Backend holds zero private keys and cannot recover a lost keyfile."***

---

## 4. Entry Lifecycle

1. **Posting (Freeze-at-Posting & SQLite WAL Append-Only):** Entries in `ledger_v2.py` are frozen dataclasses (`@dataclass(frozen=True, slots=True)`). Once validated inside an atomic `BEGIN IMMEDIATE` transaction, they are hash-chained (`prev_chain_hash` $\to$ `chain_hash`) into SQLite protected by `BEFORE UPDATE` and `BEFORE DELETE` abort triggers.
2. **Standing Transitions & Discharge Conservation (`Axis 11`):**
   - Immediate transfers post as `settled`.
   - Loans/pledges post as `owed` and open an obligation record with `principal_minor = amount_minor` and `discharged_minor = 0`.
   - Open obligations close only via partial/full `settled` repayments citing `discharges = <obligation_id>` or a single bilateral `forgiven` reversal matching exact remaining principal (`remaining_minor == 0` blocks all future forgiveness).
3. **Symmetric Version-Pinned Reading (`Axis 9`):** Reading an entry under a different dictionary compares the **union** of terms across both versions, flagging `added_terms`, `removed_terms`, and `redefined_terms`.
4. **Offline Receipt Verification (`WebCrypto`):** Any party or public observer can export `BookV2.export_audit_bundle()` and independently recompute every `SHA-256` receipt, hash chain link, obligation balance, and `Ed25519` signature locally in the browser.

---

## 5. The Eleven Deterministic Checker Rules (`ledger.py` & `ledger_v2.py`)

| Rule # | Axis Enforced | Checker Rule | The Fraud / Lie Blocked |
| :--- | :--- | :--- | :--- |
| **Rule 1** | Append-Only ID & Immutability | Refuse duplicate `entry_id`; freeze entry objects; block SQLite `UPDATE`/`DELETE`. | **Silent History Rewrite:** Overwriting an existing entry or mutating after signing. |
| **Rule 2** | Axes 1 & 2 | Refuse unknown `debit_account`/`credit_account` and wash entries (`debit == credit`). | **Ghost Accounts & Wash Volume:** Routing through unindexed shell entities or self-transfers. |
| **Rule 3** | Axis 3 (`amount`) | Refuse non-positive, float, `bool`, `NaN`, or `Inf` amounts (`amount_minor > 0` int). | **Sign-Flip & Float Laundering:** Using negatives or rounding errors to invert transfers. |
| **Rule 4** | Axis 4 & Axes 6–7 | Validate timezone-aware UTC ISO-8601 `posted_at`, registered `author`, non-empty `reason`. | **Backdated Bogus Time & Anonymous Entries:** Attributing postings to unregistered ghosts. |
| **Rule 5** | Axis 11 (`forgiveness`) | Refuse standing outside `{"owed", "settled", "forgiven"}`; parent must stand `owed` and reverse exact remaining amount/accounts/unit. | **Counterfeit Grace:** Clawing back settled transfers or altering quantities under mercy's guise. |
| **Rule 6** | Axis 5 (`provenance`) | Acyclic walk back to `"GENESIS"` (no dangling IDs or self-cycles). | **Amnesia & Circular Self-Definition:** Entries from nowhere or self-justifying loops. |
| **Rule 7** | Axis 8 + `Ed25519` | Bilateral consent + valid party-held `Ed25519` signatures over `receipt_sha256`. | **Fiat Theft & Verifier Forgery:** Moving assets without private-key counterparty assent. |
| **Rule 8** | Axis 9 (`definitions`) | Require pinned `definition_version`; detect symmetric term drift across versions. | **Semantic Drift / Euphemism Fraud:** Shifting word meanings mid-contract. |
| **Rule 9** | Axis 10 & Axis 11 | Child `amount_minor` must match parent `momentum_minor` (sole exception: `forgiven`). | **Trajectory Bait-and-Switch:** Breaking an advance allocation commitment silently. |
| **Rule 10** | Envelope Seal & Hash Chain | Verify `receipt_sha256` + sequential `prev_chain_hash -> chain_hash` replay from `GENESIS`. | **Split Books & Row Reordering:** Privately altering one side's copy or truncating DB rows. |
| **Rule 11** | Axis 11 (**One-Time Discharge**) | Enforce `principal_minor - discharged_minor >= 0` atomically in `obligations`; refuse double-forgiveness replays under fresh `entry_id`s or over-settlement. | **Repeatable Grace Double-Spend:** Replaying forgiveness under fresh entry IDs to mint unearned credit. |

---

## 6. Proof of Concept & Flagship Community Food Pilot (`Pilot B`)

1. **`ledger.py` + `demo.py` (v1 POC):** Enforces the 11 rules in pure stdlib Python across 4 honest entries (`E1`, `E2`, `E3`, `E3-forgiven`) and 8 refused vectors (`B1`–`B7`, including `B7` double-forgiveness replay), maintaining exact backwards compatibility on historical receipt hashes.
2. **`ledger_v2.py` + `tests/test_ledger_v2.py` (Production Engine):** Adds SQLite WAL concurrency safety (`BEGIN IMMEDIATE` + abort triggers), party-held `Ed25519` signatures, encrypted `Scrypt + AES-256-GCM` key backup/restore ritual, freeze-at-posting immutability, partial+full settlement tracking, loud Axis-3 migration errors/warnings, and full `verify_book()` replay.
3. **Flagship Contract Pilot (`Pilot B` — 18-Org Winnipeg Community Food Network):** Coordinates mutual-aid food flows across the 18 Winnipeg organisations seeded in `one-big-backend/obb-foodbank/seed.py` (plus the North End `80`-ham ration-floor case) using meals-only integers, publication symmetry, hierarchical unmodeled variance decomposition ($\hat{\sigma}_{\text{meas}}^2, \hat{\tau}_{\text{window}}^2, \hat{\tau}_{\text{site}}^2, I^2$), `verify_book()` gating, HiGHS Kantorovich LP shadow prices, fragility interval notes, and a zero-cloud offline browser WebCrypto verification bundle.
