Read more notes

← All journals
August 1, 2026

Anything printed is a view, not an instruction

We were putting a QR code on school invoices so a parent handed a paper bill could pay from their phone. I reached for the pattern already in the codebase: the single-use token behind our set-password links. Familiar, proven, wrong.

Then the question that broke it: what if they scan it again?

A printed invoice lives in a drawer for months. It will be scanned again. And a single-use token answers the second scan with “link expired” — which a parent reads as “my payment failed.” The worst possible message, at the worst possible moment, about money.

So the link isn’t a payment instruction frozen at print time. It’s a pointer to a bill that keeps changing. The token stays reusable, and the page renders the invoice as it is now: still owing, part-paid, paid in full, cancelled.

What convinced me it was right is how much it dissolved. No double-payment guard needed — a settled bill simply shows no Pay button. Installments work for free: pay half, scan next month, see the balance. Editing an invoice doesn’t invalidate paper already in someone’s house, because the paper never carried the amount in the first place.

The part I’d have got wrong twice

Our credential invites hash their tokens. This one stores it readable — a deliberate reversal, and the reasoning is worth keeping.

A hash can’t be reversed. So regenerating an invoice PDF could never reproduce the QR already sitting in a parent’s hands. Meanwhile the identical token is sitting in a hundred WhatsApp threads anyway. Hashing would have bought theoretical protection at a real operational cost.

The defense has to match where the secret actually lives. A token that gets photographed, printed and pasted into chat isn’t protected by hashing at rest. It’s protected by scoping: that link opens exactly one bill. No login, no siblings, no account. Worst case, a stranger pays someone’s school fees.

Paper outlives the moment it was printed in. So must everything it points at.