0xDocs 0x.limo

Docs / Monetization

Paid games and the paygate

Partly live

Put a price on a listing, how players buy it from their 0x balance, what ownership means for your servers, and how x1-paygate gates the hosted site of a paid game.

A game on 0x is free, or it has a price in US dollars. Players buy it from their 0x balance. The purchase grants them ownership (an entitlement), and your share goes to settlement.

Status on 0x.limo
Prices on listings, buying from the balancelive
Play tickets (POST /v1/apps/{appid}/play-ticket)off (the route answers 503)
x1-paygate in front of paid games' hosted sites and game serversoff (not deployed)

#Set a price

The price is part of a listing version. Set it in the price field of POST /v1/listings:

json
{ "price": { "amount": 499, "currency": "USD" } }
  • amount is in cents, from 99 ($0.99) to 100000 ($1,000.00).
  • currency must be USD, because the 0x balance is held in US dollars.
  • "free" (or 0, or leaving the field out) makes the game free.
  • Anything else is rejected with 400 and an error such as price: "free" or {amount, currency}: amount in minor units (99-100000), currency one of USD.

As with every listing change, the version waits for store review. When it is approved, the store shows the price, and from then on only owners hold the game.

The submit form and `0x submit` send "free"

The submission page (https://api.0x.limo/dev/submit) and 0x submit always send "price": "free". A version submitted from either of them makes a paid game free once it is approved. To keep a price, submit new versions of a paid game through POST /v1/listings with the price field set.

Changing a free game to paid: players who had it while it was free keep it only if they are granted it. The reviewer sees this as free_to_paid before approving.

#What players see

On the game's page, a paid game shows Buy · $4.99 from your balance. If the balance is short, the button reads Top up $x more and opens the wallet with the missing amount filled in. The purchase is one transaction: the balance is debited, the game is granted, and the sale's fee and share are recorded. Behind the button is POST /v1/store/orders {"appid": …}, which answers 409 insufficient_funds with missing (in cents) when the balance is short.

Refunds are made by 0x support. They return the price to the player's 0x balance (never to the card or the chain), revoke the game, and take your share back (see refunds after a payout). Players can't refund a purchase themselves.

#Ownership in your game

Ownership of a paid app comes only from its entitlements, and every existing check sees it:

  • the player's library and the launcher's Play button;
  • the Steam-compatible licence check (UserHasLicenseForApp), when the game runs through the Steamworks compatibility layer;
  • play tickets and the paygate (below), once they are on.

#The paygate (hosted sites of paid games)

Not deployed on 0x.limo yet

x1-paygate (@0xlimo/paygate) and play tickets are coded and tested, but they are not deployed on 0x.limo yet. Until they are, the hosted site of a paid game is not access-controlled: anyone who has its https://<site>-play.0x.limo/sites/<site>/<n>/ URL can open it. Don't put a paid game's full build on 0x hosting until this callout is gone, or gate your own game server yourself.

The launcher only hides Play. A hosted site is a public URL, so a paid game needs a gate in front of it. Here is how the gate works once it is on:

  1. Paid sites. A site is paid when a priced app's hosted URL points at it, whether or not the app is listed (taking the listing down never opens the site). The public list is GET https://api.0x.limo/v1/hosting/paid-sites → {"sites": {"<site>": {appid, id, name}}, "at": …}.
  2. No swarm. New versions of a paid site are built origin-only: no swarm manifest, and x1.json says {"swarm": false}, so nothing of a paid game is shared from player to player. The publish answer says "origin_only": true.
  3. Play ticket. The web launcher gets a ticket for an owner (POST /v1/apps/{appid}/play-ticket, 5 minutes; anyone else gets 402 not_owned) and opens the page with ?x1_play=<ticket>.
  4. Pass cookie. The gate checks the ticket and turns it into a signed 12-hour pass cookie for /sites/<site>/ and /x1/game/<site>/ (HttpOnly; Secure; SameSite=None; Partitioned). Every file of a paid site needs the pass. Without one, the visitor gets a "Buy on 0x" page with status 402 (403 for a bad or expired ticket).
  5. Game servers. A hosted game server (0x deploy-server) is gated the same way under /x1/game/<site>/. In the browser the pass cookie travels with the game's own requests, so @0xlimo/net and the templates need no change. A client without the browser's cookies connects with ?x1_play=<ticket>, and the host strips it before your server sees the request.

A server of your own can check a ticket without holding any secret: POST /v1/play-tickets/verify {"ticket": "…"} → {valid, appid, origin, steamid, expires}.

What was already public stays public: copies kept by shared caches, and swarm pieces that players cached while the game was free.