DogecoinArcade
@ Create a new account

hosting plan

docs/hosting-plan.md

Jump to: What Martin decided (2026-10-18) · Why this exists · What exists today that this builds on · The design · Phases (each stops for Martin's approval) · Open questions for Martin (to be asked one at a time, before the phase that needs them)

Written by Claude, 2026-10-18, from Martin's answers the same day. Private (operator-only; listed in publish.sh PRIVATE). Built one phase at a time, stopping for Martin's approval after every phase. Nothing here is started until Martin approves this plan.

What Martin decided (2026-10-18)

QuestionDecision
Who paysThe game builder, a monthly subscription that keeps their game's server online.
What it buysUp to a GB limit per month, and the limit is set by each node operator.
What can be boughtTwo products: the current game server (realtime rooms, as ASHVALE uses today) and the WebRTC fast lane.
LatencyNodes advertise their ping, so a builder who needs a fast server does not buy a slow one.
PaymentThe operator decides which coins or tokens it accepts, with any price in each.
Who gets paidEvery node that serves the game, in proportion to the game's players' usage on it. Mesh rooms span nodes, so one subscription pays many operators.
Game-agnosticAs always: any game uses it; nothing knows about a particular game.

Why this exists

The realtime rooms are free and slow on purpose: 5 messages a second per player, bursts of 10, 512 bytes (arcade/mesh/node.py RATE, BURST, MAX_PAYLOAD), carried as an HTTP POST up and server-sent events down, over TCP, often through Cloudflare. A request through the public site measured 170–300 ms on 2026-10-18. That is right for an RPG, cards or chess and wrong for a shooter. Paid hosting buys more for one game (higher rates, a fast lane), and makes the operators who carry the traffic get paid for it.

What exists today that this builds on

The design

1. Hosting offers (what a node sells)

In Admin, under Hosting, the operator sets, for each product (Rooms, Fast lane):

Paid rooms get higher limits than free ones. These are suggested defaults, and the operator can change them: Rooms 20 msg/s, burst 40, 1 KB; Fast lane 60 msg/s, 1 KB, unordered.

The node advertises the offer on the mesh next to its Core offers: {"host": {"rooms": {...}, "fast": {...}, "pay": [{asset, price, payee}], "free": {gb, players}, "region"}}. payee is the node's address for each asset: payout_address for coins, and the operator account's address for tokens.

2. Ping (so nobody buys a slow server)

A browser cannot send ICMP pings, so there are two measured numbers:

1. Live, from the builder's browser. The Host your game page times repeated requests to each node: kept-alive HTTPS to /realtime/hello for Rooms, and STUN binding round trips for the fast lane (the real UDP path). It takes the median of several and sorts nodes by it. A node cannot fake this, because the builder measures it. Over ~80 ms the fast-lane offer is marked "too slow for a fast game." 2. Advertised, from the mesh. Each node publishes its measured round trips to the nodes it links to, which the mesh already times. That gives "~40 ms to most US nodes" for offers the builder's browser has not tested yet.

Players get ping-based routing too: a player of a leased game joins through the serving node with the lowest ping from their browser.

3. The lease and the lease pool (how the builder pays)

4. Usage counting and receipts (who served what)

Each node counts, for each leased game, for its own members only (those whose origin it is):

Forwarded traffic is never counted by the forwarder, so nothing is counted twice.

Every hour each node signs a receipt with its node key, {game, node, hour, up, down, minutes, relay}, and sends it to the lease's home node over the mesh. Checks:

Fake players (decided by Martin 2026-10-18: the builder's cap, plus a majority ban). The rate limit stops a node inventing traffic for real players, not inventing players. So:

Receipts are kept for 90 days, and any node can ask the home node for the month's set to check it.

5. Settlement (how many nodes get paid)

6. The WebRTC fast lane

6a. The Cloudflare relay that exists now, and its subscription fee (2026-10-23)

7. The Host your game page

Under My arcade → Host your game, for builders:

For operators, Admin → Hosting shows the offer settings, leased games served, GB and players per game, weekly earnings by asset, and receipts.

Phases (each stops for Martin's approval)

1. Usage counting and receipts, with no payments. Count bytes, player-minutes and peer reports for every game. Admin shows the numbers. Ship it and watch ASHVALE's real monthly usage before any price is set. Harmless: no behaviour changes. Tests: three-node regtest mesh; members on each; counts add up, forwarded bytes counted once, receipts verify, mismatches resolve to the lower number. 2. Offers, leases, the lease pool and settlement, on Rooms. Admin Hosting settings, mesh offers, lease inscription, pool script (settle + refund), weekly settlement across nodes, paid-tier rates, slow down at the limit, coins and tokens, the sharer's tenth. Tests: regtest Pepecoin and Litecoin; a builder funds a pool in a coin and in a token; three nodes serve; settlement pays each by usage; the refund branch works with every node gone; an overcharging node routes no new players. 3. The WebRTC fast lane. Built 2026-10-18 without the relay (branch claude/fast-lane): STUN on every node, signaling over rooms, room.fast, the room fallback. The relay and its metering come with leases. STUN on every node, TURN on paid nodes, signaling over rooms, room.fast, relay metering. Tests: two headless Chromium browsers connect directly and through the relay; lost-packet behaviour; relay refused without a lease. 4. Ping and the Host your game page. Live ping, mesh-advertised ping, ping-based routing for players, the builder dashboard. Tests: browser tests with a slow node simulated (delay injected), which is sorted last and flagged. 5. The first fast-lane game: a 4 v 4 first-person shooter in three.js (Martin, 2026-10-18; replaces the tank shooter). A completely new game, in its own repository and inscribed like RACE CONDITION, using only the public page API, so it proves the fast lane is game-agnostic.

6. Later: node-run authoritative servers for big or wagered fast-lane matches, sold per hour under the

Open questions for Martin (to be asked one at a time, before the phase that needs them)

1. Short game names: should a lease bind a name to its builder (first lease wins), or should paid hosting require an inscription id? 2. Home node's slice: 5%, another number, or none? 3. Settlement weight: GB only, or GB plus player-minutes? 4. A home node caught settling wrongly: just switchable, or also marked publicly on the mesh? 5. TURN relay: our own small Python relay (no sudo, more work) or a bundled binary (coturn/pion)? 6. Free rooms: stay at today's rates forever, so small games can exist without paying? 7. Ban votes: one vote per paid node, or weighted by agreed usage?

← all docs