The full upstream README, mirrored here for reference. Install config, tool schemas, adoption signals, and an original overview live on the Ledger listing page.
Agents do not do money math in tokens.
Exact-decimal double-entry kernel + MCP. Fail-closed. Audit-hashed. Deterministic.
Money.from · validateEntry · Ledger.apply. Invalid entries are rejected, never posted.
Do not add, split, convert, or balance amounts yourself. Call the kernel.
Then:
ledger://canon/rules and ledger://canon/workflow.money_compute. Validate with entry_validate. Post with ledger_post.ledger_verify_equation + ledger_audit_hash. Never invent an audit hash.cite_lookup. Bundle proof with artifact_make.Rules live in AGENTS.md. Protocol: docs/CORE-PROTOCOL.md. Machine index: llms.txt. Full tool list: mcp/.
Host plugins (Grok and compatible) load /ledger-verify, /ledger-audit, /ledger-cite, /ledger-reconcile, /ledger-sim, /ledger-review from this repo. Copy AGENTS.md or skills/ledger/SKILL.md if the host has no plugin loader.
Token-level arithmetic is indifferent to scale, balance, and currency. The kernel is not.
| Failure | Kernel |
|---|---|
| Float drift / sub-scale | Money.from rejects |
| Unbalanced entry | validateEntry + Ledger.apply reject |
| Silent currency mix | Per-currency; FX must be explicit |
| Tamper / non-repro | SHA-256 auditHash (ledger-audit-v2) + determinism harness |
| Ungrounded treatment | Starter IFRS/GAAP graph via cite_lookup |
| Exact money | Double-entry | Immutable + audit hash | Deterministic | No DB | Agent / MCP | |
|---|---|---|---|---|---|---|
| Ledger | yes | kernel | yes | yes | yes | yes |
| dinero.js | yes | — | — | — | yes | — |
| medici | partial | yes | — | — | MongoDB | — |
| Formance / TigerBeetle | yes | yes | yes | partial | service | — |
ESM and CommonJS. Kernel-only import: @eternal-roman/ledger/core.
Mechanical check (no LLM):
All of these emit validated JournalEntrys. None reimplement money.
fillToEntries, deposits, withdrawals, taker/maker feesvaluePortfolioplanRebalanceAsset scales (BTC=8, ETH=18, …) are installed with installAssetScales(defaultAssetRegistry()). Fiat is unchanged. See examples/.
| Doc | For |
|---|---|
AGENTS.md | Agent contract |
llms.txt | Machine-readable map |
docs/CORE-PROTOCOL.md | Zero-Skip protocol |
docs/SUCCESS-CHECKLIST.md | Pre-ship checklist |
docs/ANTI-PATTERNS.md | What the kernel rejects |
docs/SCOPE-AND-LAYERS.md | What ships today |
mcp/README.md | MCP tools, resources, prompts |
CONTRIBUTING.md | Developing this repo |
Python kernel port: reference-implementations/python/ (same invariants; install an asset-scale resolver for non-fiat).
MIT. See LICENSE.
Deterministic primitives and verification tools. Not financial, tax, legal, or accounting advice. You are responsible for inputs, assumptions, rates, jurisdiction, and compliance. Tests and benchmarks are due diligence, not a certification. See LICENSE.