The Black Ledger

Every Debt Leaves a Trace.

An AI-assisted shared-expense ledger with real PayPal Sandbox checkout, explainable balances, and independently verifiable financial history.

Inspiration

Everyone remembers what they paid. Nobody remembers the same thing.

A weekend trip starts with good intentions. One friend books the accommodation. Another pays for groceries. Someone covers an activity. A fourth person promises to send their share later.

Then the questions begin.

Was that expense split among everyone, or only the people who participated? Did someone already pay? Was the receipt entered twice? Which exchange rate did we agree on? And why does the spreadsheet show a number nobody can explain?

Most expense-sharing applications tell people who owes whom. But a balance alone cannot resolve a disagreement when nobody trusts the history behind it.

We wanted to solve the whole problem, not just calculate the final number.

What if every expense had an origin, every correction remained visible, every payment required evidence, and anyone could independently check the financial record?

What if AI could help reconstruct what happened without ever becoming the authority that decides what people owe?

And what if the application could actually settle those debts through PayPal?

The Black Ledger was born from a simple idea: money should never become a mystery just because people remember things differently.

We gave that idea an unusual visual identity: a mysterious interactive archive, filled with old ledgers, broken mirrors, antique instruments, and the atmosphere of an unfolding puzzle.

Because accounting doesn't have to look ordinary to be rigorous.

The interface is mysterious. The accounting is not.

What it does

The Black Ledger transforms shared expenses into an auditable financial history — from the first agreement to the final confirmed payment.

It combines collaborative expense management, AI-assisted receipt interpretation, deterministic financial calculations, real PayPal Sandbox checkout, and independent evidence verification.

But the details are where it becomes interesting.

1. Getting everyone into the story

Creating a session generates a reusable room code. Participants join under their own names without requiring individual invitation links.

The code grants self-service membership, not permission to move money.

Groups can record their agreements before expenses begin: who is responsible for what, how costs should be divided, and when outstanding balances should be settled.

Those agreements become timestamped records rather than disputed memories.

Participants can also form subgroups. If four people visit a museum while two stay behind, that expense belongs to the four participants, not automatically to everyone.

Different access roles distinguish organizers, participants, and read-only witnesses. Financial permissions are enforced by the server, not simply hidden in the interface.

2. Recording what actually happened

Every expense records who paid, who benefited, how the amount was allocated, and which currency was used.

When currencies differ, the original amounts and exchange-rate evidence are preserved. The financial engine uses integer minor units, rational arithmetic, half-even rounding for currency conversion, and deterministic remainder allocation.

No floating-point approximation determines what someone owes.

Receipts can be attached as evidence even when automatic interpretation fails.

Possible duplicate expenses are flagged for review rather than silently deleted.

Corrections are new events, not edits that erase previous information. Disagreements, confirmations, refunds, forgiveness, and responsibility transfers remain distinguishable parts of the history.

Nothing needs to disappear for the balance to change.

3. An AI that reads but never decides

The Black Ledger uses OpenAI's Responses API to interpret photographed receipts.

AI can extract a merchant name, itemized purchases, totals, and other visible details, returning a structured proposal that explicitly identifies uncertainty.

But a proposal is not an expense.

A person must review the extracted information, correct it when necessary, and explicitly confirm it before anything enters the financial record.

The model has no privileged path to append financial events.

That separation is architectural, not merely a system prompt asking the model to behave responsibly.

The same principle applies to hypothetical scenarios.

A participant can describe a possible change in natural language. AI proposes the corresponding events, and the deterministic engine simulates their financial consequences without recording anything.

A group can explore “What happens if we split this differently?” without changing the actual books.

AI interprets. Humans authorize. Deterministic rules calculate.

4. Settling debts through PayPal — for real

Tracking a debt and settling it are different problems.

The Black Ledger supports both.

Participants can record a payment claim, such as a cash handoff. But the claimed payment remains pending until the recipient confirms it. Saying “I paid” is not the same as proving that a settlement was completed.

For eligible USD obligations owed to the configured merchant participant, the application also integrates PayPal Orders v2 through a server-side checkout.

The server reserves the outstanding amount, creates an idempotent order, and processes the payment through PayPal.

A pending checkout does not reduce the debt.

Only a completed PayPal capture that passes the ledger's validation and reconciliation checks produces a confirmed settlement.

We tested this flow against the real PayPal Sandbox APIs, completing payments that updated the ledger's calculated balances — not mocked transactions or screenshots pretending to represent payment execution.

We also designed for the situations where the provider and the application cannot immediately agree.

If PayPal reports a completed capture that cannot be safely reconciled, the evidence is preserved separately and surfaced in an organizer-facing reconciliation inbox.

The application does not silently discard the payment, invent a successful settlement, or charge again during recovery.

The payment button is only the beginning. Financial reconciliation is what makes the operation meaningful.

5. More than splitting one bill

Shared finances continue long after the first expense.

The Black Ledger supports budgets, recurring expense rules, commitments, refunds, partial forgiveness, and responsibility transfers.

A household can track recurring obligations. A travel group can monitor spending against an agreed budget. A participant can formally take over another person's debt without hiding the original obligation.

Surprise gifts can be recorded with descriptions concealed from the recipient's view.

Verified obligations can also be carried atomically between compatible sessions, preserving continuity instead of allowing a debt to vanish when a group starts a new trip or accounting period.

And when a group is ready to close its books, the application checks for unresolved obligations and disputes rather than pretending everything has been settled.

6. A ledger that can be independently checked

Every financial event is stored in an append-only, hash-chained history using versioned canonical serialization.

Balances are derived from validated events, rather than stored as freely editable numbers.

Each participant can inspect the contributions behind their balance and trace them back to the corresponding records.

The application can export an evidence package containing its event history, integrity proofs, and attachments.

An independent offline verifier checks the package structure, event-chain consistency, financial-domain rules, and attachment integrity without relying on the running application or its server.

The verifier uses Node.js standard-library capabilities and can run locally:

node src/verify-package.js <evidence-package.json>

These checks establish internal consistency, not digital signatures or independent authentication of participants. Detecting replacement of an entire coherent package requires comparison with a previously trusted hash.

The goal is not to ask users to trust a number. It is to give them the means to examine how that number was produced.

How we built it

We began with an architectural principle:

Financial decisions must remain deterministic, human-authorized, and supported by evidence — even when AI participates in the workflow.

The backend is built with Node.js and its built-in SQLite module, using transactional persistence without an external database dependency.

The financial engine handles amounts in integer minor units and uses rational arithmetic for currency conversion and allocation.

We implemented a versioned, canonically serialized event history with SHA-256 hash chaining, transactional writes, and idempotency keys.

Instead of mutating balances directly, the application derives financial state by replaying validated events.

The PayPal integration uses Orders v2, with server-side credentials, outstanding-obligation validation, idempotent order creation, capture confirmation, and reconciliation handling.

We exercised real PayPal Sandbox checkout separately from the automated tests, which use controlled provider responses to investigate concurrency, recovery, and failure conditions.

The AI layer uses OpenAI's Responses API with structured outputs. Receipt interpretation and scenario generation remain proposal-producing operations; they cannot bypass the ledger's validation and authorization boundaries.

We also implemented a standalone offline evidence verifier and an automated test suite covering financial invariants, API security, concurrent operations, payment recovery, and package consistency.

For the frontend, we deliberately rejected the appearance of a conventional expense tracker.

We designed an interactive narrative identity built around six visual chambers: The Ledger, The Broken Mirror, The Black Telephone, Memory Extraction, The Elixir, and The Verdict.

Each chamber represents a different part of the financial journey.

Antique textures, engraved seals, restrained animation, and a distinctive visual language make the application feel like an investigation into financial history.

The visual design and financial engineering were developed together, because understanding a financial system should be as carefully designed as calculating its balances.

Challenges we ran into

The hardest challenge was making the system preserve financial truth when the available evidence was incomplete, contradictory, or unexpected.

A receipt can be ambiguous. Someone can dispute an expense. An API request can be repeated. A payment provider can report a completed capture while the application cannot safely reconcile it with the current obligation.

These cases require more than careful interface design or stronger AI prompts.

They require explicit boundaries between observations, proposals, authorizations, provider evidence, and confirmed financial events.

We also subjected the project to multiple rounds of adversarial security review.

One investigation uncovered a payment-processing defect: a completed provider capture containing an unsupported currency or unexpected monetary precision could fail parsing before its evidence was preserved.

That meant the payment might not appear in the reconciliation workflow, even though the provider had reported a completed capture.

We changed the processing order to preserve provider evidence before attempting financial interpretation. Unreconciled captures now remain visible for review, and recovery avoids blindly repeating an external charge.

Another investigation revealed that an organizer-facing reconciliation inbox could appear empty despite relevant records existing on the server.

The interface was reading a field from the derived financial state that actually belonged to the server's operational state.

We corrected the data boundary and introduced a guard to prevent that class of silent rendering failure.

These findings changed how we evaluated success.

A correctly calculated balance is essential, but it is not sufficient if evidence of external money movement can be lost.

When uncertainty cannot be resolved automatically, the system must preserve it — not conceal it.

Accomplishments we're proud of

We built and tested a working PayPal Sandbox checkout that completes real provider API operations and updates actual ledger balances. Not a mocked checkout. Not a screenshot. Not just an API integration on paper.

That result matters because the payment flow is connected to the ledger's financial rules, not merely added as a button.

We are also proud of building:

  • A deterministic financial engine where balances have traceable origins.
  • An append-only event history that preserves corrections instead of rewriting the past.
  • AI-assisted receipt interpretation without privileged financial write access.
  • Human authorization and payment-recipient confirmation boundaries.
  • Real PayPal Sandbox checkout with capture-gated settlement and reconciliation.
  • An independent offline verifier for exported financial evidence.
  • A broader shared-finance domain covering agreements, subgroups, disputes, budgets, recurring rules, refunds, gifts, and obligation transfers.
  • Adversarial tests that uncovered real defects and produced concrete fixes.
  • An unusual, cohesive visual identity that turns expense management into an experience of reconstructing a story.

What makes these accomplishments meaningful is how they work together.

The AI doesn't need to control money to be useful.

A payment claim doesn't need to be mistaken for a completed settlement.

And a balance doesn't need to exist without an explanation.

We built the financial system first, made its decisions accountable, and then gave it a world worth exploring.

What we learned

Reliable financial software must preserve uncertainty rather than erase it.

We learned that successful payment-provider communication and safe financial posting are separate operations. A provider response must be preserved, interpreted, and reconciled before it changes the books.

We learned that the strongest boundary for AI-assisted financial work is architectural: the model should propose information, while validated rules and explicit human actions determine what becomes part of the record.

We also learned that adversarial testing is especially valuable at the boundaries between systems. Unexpected provider responses, interrupted requests, and inconsistent application states revealed problems that ordinary successful test cases did not.

Finally, we learned that technical rigor and creative presentation are not opposing priorities.

An unusual interface can make people curious enough to investigate. A deterministic financial engine can make that investigation meaningful.

Good design invites curiosity. Good engineering earns trust.

What's next for The Black Ledger

Our next priority is making the existing guarantees more accessible in everyday use.

We plan to implement token revocation and replacement so access can be recovered safely after a lost device, without deleting financial history.

A multi-session selector will allow people to manage multiple trips, households, or shared groups without losing access to previous ledgers.

We also want to bring the offline verifier directly into the browser, allowing people to examine exported evidence packages without installing Node.js or uploading private receipts to another service.

Additional work will focus on clearer review flows, dispute resolution, and payment reconciliation.

Our long-term vision is a shared-finance experience where everyone can understand not only what they owe, but why they owe it, what evidence supports it, and whether it has actually been paid.

Because every debt has a history. And every history deserves an accurate record.

Additional note for the judges

Please take a moment to check the README on GitHub. It includes a screenshot of the PayPal Sandbox payment receipt corresponding to the transaction demonstrated in the video.

The screenshot provides additional evidence of the actual Sandbox payment flow, beyond what was visible in the recording.


Technologies Used

  • PayPal Orders v2 API — Real Sandbox checkout, capture confirmation, idempotency, and reconciliation.
  • OpenAI Responses API — Structured receipt extraction and hypothetical scenario proposals.
  • Node.js — Backend HTTP API and application runtime.
  • SQLite — Transactional event storage.
  • JavaScript, HTML, CSS — Deterministic financial logic and interactive user interface.
  • SHA-256 — Event-chain and evidence integrity checks.
  • Automated testing — Financial invariants, API security, concurrency, recovery, and offline verification.

Try the application: https://the-black-ledger-showcase.vercel.app/

Source code: https://github.com/annatchijova/the-black-ledger

Slides https://claude.ai/artifact/XkDfZzYauJThf18nurskzs#slide-8a29359bde30

License: MIT

Built With

Share this project:

Updates

Submission history