P2P

The peer-to-peer core: there is no central ledger and no authority. Each device keeps its own append-only record of what it has done, and peers reconcile directly. This is what makes Tally local-first — it works offline and owes nothing to a server for its truth.

The ledger

The ledger is the append-only local log of every durable record the user has authored or received. All balances — tallies, trust limits, available trust — are derived from replaying it, so the log is the single source of truth and the UI never stores balances of its own.

State & storage

Runtime state (user, friends, contacts, ledger, outbox) is a single normalised object persisted in IndexedDB and reshaped by versioned migrations on load. Data-heavy parts are written in TypeScript (app/js/models/, app/js/ledger.ts, app/js/storage/).

The trust model

The economics that make P2P value transfer possible — debt, trust limits, and routed payments through mutual friends — are described in Purpose.

Connecting & syncing

How peers find each other and move data — direct WebRTC first, falling back to the relay — is covered in Communication.

Go deeper

Ledger spec — entry shape, verification, and sync merge. Data storage — the IndexedDB layout and every field of the root state. Peer communication — the wire protocol. Render flow — how a change to this state reaches the screen.