devaccuracy/ledgerforge
FinanceAn open-source double-entry ledger for wallets, payouts, marketplaces and billing, with server-enforced spending limits for AI agents.
What it is
LedgerForge is a self-hostable double-entry ledger written in Go. It records wallet transfers, payouts, billing charges, reservations and refunds as integer postings, so balances stay exact and every applied transfer debits the source and credits the destination by the same amount. Each API key, including keys used by AI agents, can carry currency limits, allowlists, daily budgets and approval holds that the server enforces rather than the client.
It targets teams building stored-value wallets, payout flows, marketplace splits or usage-based billing. Access is available through an HTTP API, a Go library and a local MCP server for AI agents. PostgreSQL stores the financial records; Redis runs queues and background workers. Payment rails and the accounting model remain the application's responsibility.
Key properties described in the README: integer amounts with explicit precision (1250 at precision 100 means 12.50), immutable postings where corrections and refunds create linked transactions, idempotency by unique transaction reference, and a read-only ledgerforge verify command that replays accounting evidence against versioned audit chains and exportable checkpoints.
Quickstart
Prerequisites are Docker with Compose and Python 3. The local demo builds the current checkout, generates a random master key, runs migrations and binds the API to 127.0.0.1:5001:
git clone https://github.com/devaccuracy/ledgerforge.git
cd ledgerforge
./examples/quickstart/start.sh
./examples/quickstart/transfer.sh
It creates two USD balances and posts a synchronous 12.50 transfer: the source gets a bounded demo overdraft, ending at -1250 units while the destination holds 1250 units. Reusing the same reference should leave balances unchanged. Stop the demo with:
docker compose -p ledgerforge-demo -f examples/quickstart/compose.yaml down
The quickstart example guide covers the API payload and credentials, and the deployment guide covers exposing a real service.
Install for real use
Release binaries for Linux, macOS and Windows (including ledgerforge-mcp) are on GitHub Releases; verify them against checksums.txt. A container image is published at ghcr.io/devaccuracy/ledgerforge, and Go 1.26.9 or later can install from source with go install github.com/devaccuracy/ledgerforge/cmd/ledgerforge@v1.0.0. After installing, run ledgerforge version, copy the example config, replace server.secret_key with a random secret, run ledgerforge migrate up, then start the server. Existing databases should be read against the upgrade notes before upgrading.
Constraints and scope
- Stateful dependencies are PostgreSQL and Redis; search, metrics and OpenTelemetry are optional.
- The README explicitly says LedgerForge records money movement — connecting payment rails and defining the accounting model rest you must do yourself.
- Demo credentials, database defaults and the local-only binding to
127.0.0.1:5001are not meant for exposed deployments. - Agent guardrails work through server-enforced API keys; independent approver credentials should stay outside the agent's authority, as described in the agent safety guide.
- The
:mainimage tracks tested main-branch commits; pin a release tag or digest in production viaLEDGERFORGE_IMAGE. - Licensed Apache 2.0, with no license keys or feature gates; the managed Cloud offering runs the same open-source core.
HotRepo's take
The project entered the Go daily list on 2026-11-11 at position 16 with 217 stars, 29 forks and 69 stars gained that day. That is a single daily snapshot, not a sustained trend. The notable technical choice is putting spending controls at the ledger/API key layer rather than in the agent client, which matters for anyone wiring autonomous agents into payout flows; the repo also ships verification tooling and MCP support in the same open-source core.
Written by AI from the project's README, updated . The project's own docs are the source of truth.