Paid exits

Notes

Seven notes on selling a network connection between phones, routers and microcontrollers — what is possible, what is not, what is left to build, and who should build it.

TollGate lets a network connection be sold for small frequent payments: no account, no subscription, no identity check. Normally the seller is a router that runs a captive portal and a firewall. These notes ask what happens when the seller is a phone, a microcontroller, or a laptop — and what that changes about who can sell to whom.

The short version: paying needs nothing installed, and routing does. Those are two different products, and most of the confusion in this design comes from treating them as one.

The notes

Selling Wi-Fi from a phone

A phone can’t run a captive portal — no nftables, no ARP table, no control over its own access point. So if a phone is going to sell internet, something else has to be the valve. This one follows that idea down into the code: the exit daemon admits a packet only from a source it authenticated, so a customer without a key cannot be routed through it, and no change to the daemon helps because it has no concept of a MAC. Android then closes the other route for a different reason entirely. Ends with eight open questions for the author of the exit daemon.

Eight figures. The longest note.

The alphabet, settled

A / B / C, written down once so the notes stop re-defining it. Indexed on how much the arriving client knows: A the client runs fips and finds exits itself, B a phone is the exit and another finds it by mDNS, C the client knows only IP and a TollGate carries it. Also says what the letters do not distinguish — most usefully that C splits into a metered product and an open one, which share a transport and nothing else.

A reference page rather than an argument. Start here if a letter confuses you.

Same letters, different questions

Two people spent a conversation disagreeing while both being entirely consistent. The reason: the same three letters were indexed on different things — one on whether the customer holds a key, the other on how much the client knows about fips. This note maps the collision, explains why the second framing wins (it stacks into a build order instead of splitting into a choice), and then covers the change that actually matters technically: exit adverts now live on a relay that exists only on the mesh, so a customer can find a seller before they have internet.

Three figures.

Interoperability: who can sell to whom

Every pairing of ESP32, phone, router, Ubuntu and a fips exit, with which models each can speak and what each costs the customer. Wherever the seller owns a kernel, both A and C are reachable; wherever the seller is a phone, only A is. Includes the finding that reframed the whole question — the ESP32 has no fips node at all, so every fips-shaped pairing with it is dead, and a fips-only design silently excludes the cheapest gate being shipped.

Eight figures: quadrants, capability grids, the device-overlap map, three discovery channels, and the full pairing matrix.

What still needs to be built

The whole programme reduced to statuses: what exists and is released, what is design only, what nobody has started, and which three decisions block everything else. Includes TollGate service discovery over Nostr relays as an opt-in feature, with the register of what turning it on costs and an acceptance test that proves it works.

Start here if you are wondering what to do next.

Is fips-exit-pay already a TollGate implementation?

A layer-by-layer comparison against TIP-01 and TIP-02, in both directions. The answer splits: yes as a product — metered network access sold for ecash, published on Nostr, enforced by dropping packets — and no as a protocol, because the two use different event shapes, different units of sale, and different notions of who the customer is. It is ahead of TollGate on one thing (continuous payment by Cashu channel) and behind on another (it cannot serve a keyless customer). Ends with the four additive spec changes that would make one advert readable by both, and the finding that the long-standing identity question does not arise between fips nodes at all.

One figure. The most useful note for deciding what to build.

What we should claim, and what we should leave alone

The build list sorted by who can finish each item rather than by size. Most of it is not ours: the exit daemon moved three releases in a day, the OpenWrt client is days away, and rebuilding either would produce a second half-working copy. What is ours is the part only we can do — a real fips-exitd on a bench router to test our own client against, a measured hardware matrix, and an advert publisher in a repo we can merge. Ends with four things to do this week that need nobody’s permission.

A short note, and the only one that is mostly a plan.

What an HTLC can and cannot buy you

NUT-14 gives you a conditional claim on ecash, and it is a good primitive. It does not give you delivery, and no tag combination makes it do so — because the mint only ever verifies signatures over Proof.secret, never over a receipt you invented. Works through which half of “atomic payment on delivery” is a payment problem, which half is not, and why the two-party case cannot be fully fixed: Even–Goldreich–Lempel and Pagnia–Gärtner, applied to a link that might be LoRa.

One table. Read this before designing an escrow.

Who holds the key? The three-party case

The two-party version of atomic pay-on-delivery is genuinely impossible, and three independent reviews said so with the spec open. The three-party version is not — because the party who funds and the party who spends can be different people. Works the construction end to end, states the one hole the tags cannot close (the transporter holds the key before delivery), and locates the real impossibility: FIPS mesh is “best-effort delivery. No acknowledgment, no retransmission” — there is no delivery fact to bind to.

The follow-up to the HTLC note. Read with it.

What is settled, and what is not

Question State
Can a customer pay with no app? Yes — but not through a phone-hosted portal. A portal is an interception, and a phone cannot be one. A QR on the seller’s screen works.
Can a phone serve a captive portal? No. Redirecting the first HTTP/DNS request needs the phone to be the default gateway — the path Android forbids.
Can a phone sell at all? Yes, under A — to customers who also run fips. It cannot host a portal, which is a narrower limit than “cannot sell”.
Can a phone-owning app meter hotspot customers? No, for any app — Google closed the request as Infeasible. Root or a router only.
Can fips2go be the exit its customers need? Not today — it has no exit role and no forwarding path. But nothing refuses it: shim/src/exit.rs:329 only stops a client picking its own npub as its exit. Missing feature, not a platform wall.
Can a keyless customer be routed through a paid exit? Not through fips-exitd. Member addresses are 0xfd‖SHA-256(pubkey), so possessing the address is possessing the key.
Does fips have a relay for keyless clients? Yes — fips-gateway, masquerading LAN clients under its own identity. Needs CAP_NET_ADMIN, so router only.
Can an ESP32 sell? Yes — it is a complete portal gate: AP, captive portal, Cashu, NAPT. It just can never be a fips peer.
Is a MAC a usable account key? No. Android 10+ and iOS randomise it per SSID, so a customer arrives with a new identity on every reconnect.
Is mining-for-access viable? No. A phone yields ~0.0015 sat/hour; a 1,000-sat pass is ~76 years of hashing.
Can a secret be derived from the MAC? No. It is broadcast in cleartext, has 2^24 bits of real entropy, and the gate could spend it.

Where to start