OnLoan mark OnLoan
Metered lending. Never strangers.

Case Study · Design & Development

OnLoan

We build OnLoan for people who already trust each other. It meters kilometres, days, or hours, then settles in cash or mutual credit on the FOAF ledger.

Site
onloan.net ↗
App
app.onloan.net ↗
Status
Live
Disciplines
Product design · Full-stack development · Protocol integration
Stack
Next.js 16 · Rails 8 · Postgres · Expo 54 · React Native · FOAF protocol

The problem

Lending a car or a drill to a friend usually means guessing the amount, or using a rental platform that treats the two of you as strangers. Neighbours need a meter and a settlement that does not require a marketplace.

A loan needs an existing FOAF trustline. OnLoan meters what was actually used, then settles in cash or as mutual credit. No deposits, no interest, and never strangers.

What was built

The public site is live at onloan.net. The app is at app.onloan.net. A Rails API owns the loans table, the meter, and the settle orchestration. An Expo app is the client. Identity and contacts come from FOAF auth. Money does not.

OnLoan computes (end minus start) times rate, in BigDecimal, to the network's decimals. Settlement reuses FOAF's pending-transfer flow: the borrower creates it, the lender confirms it. The loan is marked settled only on a 2xx confirm with an operation id. OnLoan settles on the same FOAF ledger as GrowOperative.

How it's built

OnLoan owns the loan from draft to settled.

Trustlines, capacity, and transfers stay in the protocol.

01

No money math in the app

Balances, trustlines, capacity, and transfers are FOAF's job, over HTTP. OnLoan never holds a ledger of its own. That split is the architecture, not a slogan on the marketing site.

02

Two signatures to settle

The borrower creates a pending transfer, sender-signed. The lender confirms it, receiver-signed. A retry guard stops a replay from settling twice. The loan is not marked settled until the confirm returns an operation id.

03

The meter is BigDecimal

Rate, readings, and amount stay BigDecimal. Half-up rounding to the network decimals. Units are kilometres, calendar days that survive DST, or hours. Zero, negative, and rounds-to-zero results are rejected.

04

Capacity before the transfer

OnLoan reads FOAF trustline capacity before a transfer opens. A loan cannot open a transfer that would exceed the borrower's available credit. Addresses come from the FOAF session and the contacts envelope. Nobody types a wallet.

05

Four states, no marketplace

DRAFT, OPEN, AWAITING CONFIRMATION, SETTLED. The lender starts the meter. Either side logs the return. Both sides confirm. Cash is always an option. Credit uses the trustline you already have. There is no stranger matching.

06

A site, an API, an app

Next.js 16 for the public page. Rails 8 and Postgres for loans. Expo 54 for the client. Three repos, one product. The public site and the app both say never strangers.

BigDecimal metering · bilateral pending-transfer · capacity pre-check · FOAF identity · Next.js 16 · Rails 8 · Expo 54.

What this shows

The product sits on a protocol.

We build the loan in the product and leave the ledger in the protocol. Client work that needs a payment protocol, not a payment processor, looks like this.

metered lending FOAF settlement BigDecimal never strangers
Ω

Need an app that does not invent a ledger?

We design the product and the protocol boundary from one studio.