go-ledger

Multi-tenant double-entry payment ledger API in Go, built in public

Image 1 of 2: Demo console overview with accounts, transactions, admin and reporting panels and a five-step start

Every transaction is postings that sum to zero per currency, enforced in the domain type and by a Postgres CHECK trigger. Balances are summed from append-only history, never stored. REST and gRPC, row-level tenant isolation, FX via clearing accounts, approval holds and webhooks.

  • ~35 msp50 post (colima VM)
  • ~68 msp99 post (colima VM)

Trade-offs

  • SERIALIZABLE with automatic retry instead of hand-taken row locks. Correctness comes from the database, so no code path can forget a lock, at the cost of serialization retries under contention.
  • Benchmarks keep synchronous_commit on. The p99 is dominated by fsync and misses the 50 ms target, but turning durability off on a ledger would trade the guarantee for a number.
  • PII in posting descriptions is encrypted with a destroyable key. Erasing a person destroys the key, so the append-only history keeps every row while the text becomes unreadable.

Q&A3

Each post writes an outbox row in the same transaction, and a single-leader chainer drains it into a hash-chained audit_log. That log is also the event stream webhooks are delivered from.

Reviews

Loading reviews

    More in Payments

    See all 9 →
    • OffPayOffline UPI payments over *99# USSD, with no data connection
    • SellfSelf-hosted storefront for digital products on the seller's own Stripe account
    • PandaPayLensPayment error decoder and event timeline that runs in the browser
    • RRQClosed-loop payment ledger on sharded Postgres with a Kafka outbox
    • PartageEnd-to-end encrypted, local-first bill splitting with no accounts
    • minshopSmall store on Cloudflare Workers that agents can pay

    More in Ledgers

    See all 7 →
    • pgledgerDouble-entry ledger implemented entirely in PostgreSQL functions and views
    • HisabDouble-entry ledger kept by texting a WhatsApp agent, in Urdu or English
    • Accountant24Personal finance agent that keeps an hledger ledger in plain text under git
    • OpenBilanzLocal tool for a German GmbH's opening balance, annual accounts and E-Bilanz
    • franken_accountingEvidence-native double-entry accounting system of record in Rust

    More in Postgres

    See all 25 →
    • SupermetryCookie-free web and product analytics on one Go binary and PostgreSQL
    • arbiterPostgreSQL job queue for Haskell, with no broker and no leader
    • StreambedPostgres-to-Iceberg CDC engine with a built-in Postgres wire query server
    • MigrationPilotPostgreSQL migration linter that blocks unsafe DDL before merge
    • pistachioDeclarative PostgreSQL schema management with a plan and apply workflow
    • EgresPostgres-compatible database in Zig for heavy, multi-tenant workloads