Swarm earnings
How players earn a share of 0x's revenue for seeding your game's files, the signed receipts behind it, and what a game needs (nothing beyond the 0x runtime).
Every player of a game on 0x hosting helps host it. When a player's browser loads a file from the
swarm instead of from our origin, the player it came from did the hosting. Swarm earnings pays
those players a share of 0x's revenue for it. Your game needs no change: the 0x runtime
(@0xlimo/swarm-sw 0.1.4 and later) does the work, and you keep your full developer share. The pool
comes out of 0x's own platform fee.
#What players get
- The pool. Each calendar month, 20 % of 0x's net platform revenue goes into a pool. Net revenue is the store and in-game sales fees, less refunds, plus the top-up margin. Cents nobody earns roll over to the next month.
- The split. The pool is split by verified bytes: what other signed-in players downloaded from
the player and signed for.
- Files few others hold count more, and so do busy hours and steady seeding.
- Large amounts count less and less, so farming doesn't pay.
- To earn in a month, a player needs at least three different receivers, and no single receiver counts for more than a quarter of their bytes.
- The cap. No player gets more than 10 % of a month's pool or $250.
- Payment. After a 14-day hold, earnings go to the player's 0x balance, spendable in the store and in in-game shops. Earnings are balance credit only; they can't be withdrawn.
- Worlds count too. The Earth, War and Los Santos web clients sign receipts as well, so seeding a world's files earns the same way as seeding a hosted game's.
- Joining. Players opt in on 0x.limo/earnings. Seeding itself needs no opt-in, and players who turn sharing off in Settings neither seed nor earn.
#Signed receipts
Only the receiving player can vouch that bytes arrived, so only receipts it signs count.
A key per page. Each page that runs the swarm creates an ECDSA P-256 key pair with WebCrypto. The private key is non-extractable. The launcher registers the public key for the signed-in player:
POST /v1/revshare/keys {pub}returns{kid, expires}, valid for 24 h. Guests get no key.Handshake. The meshtorrent wire extension
x1_rs(BEP 10) tells each peer the other'skid.Counting. The receiver counts, per uploader and torrent, the block bytes each peer delivered, but only for pieces that then pass the torrent's hash check.
Signing. At least once a minute, the receiver signs one receipt per uploader and torrent:
x1rs1|<receiver kid>|<uploader kid>|<infohash>|<seq>|<unix seconds>|<piece ranges>|<bytes>|<ph>phis the SHA-256 over the listed pieces' hashes from your version'sswarm/manifest.json(thesg.pieceshex strings, in ascending piece order). The signature is P1363 (r‖s), base64url.Upload. The launcher posts the receipts with the player's credentials:
POST /v1/revshare/receipts {receipts: [{r, s}]}.
The backend checks each receipt before it counts:
- the signature, and that the key belongs to the account that posts it;
- the receipt is counted once only;
- the infohash names real swarm content, and the pieces and
phmatch its manifest; - the receiver and uploader are not the same account and not on the same network;
- the receiver is a real player.
Per receiver and file, a month credits at most the file's size.
#What this means for your game
- Nothing to integrate. Publish with the current CLI (
0x publish). The site runtime registers the key through the launcher and signs receipts on its own. - Your files must be on the swarm (see Swarm assets). Files that stay on the origin are not seeded by players, so no player earns from them.
- Paid games are served origin-only (no swarm), so no player earns from them either.
- No data about your players leaves the page beyond what the transfer reports already carry. A receipt names key ids, an infohash and piece numbers, never an address.
#Limits
- Only pages opened inside the 0x launcher (signed-in players) sign receipts. Direct visits to a game's own address are anonymous and are not counted.
- Native peers (the desktop runtime) don't sign receipts yet. Their bytes are shown as unverified and are not paid.
