Source integrity
Publish your game's source with its listing. 0x rebuilds it in a sandbox, checks that every file players download is exactly what the source builds, scans it, and shows "Source verified" on the store.
Publish your game's source with its listing. 0x then:
- fetches the source at the exact commit or content id you name;
- builds it in a sandbox with the toolchain you pin;
- checks that every file players download is byte-for-byte what the source builds;
- scans the source for malware and abuse, and has an AI model review it;
- shows the result to the operator who reviews your listing.
When the rebuilt files match and an operator approves the version with the audit in front of them, the store page says Source verified, with the commit.
Source integrity is optional. A listing without source still goes through store review.
#1. Where the source lives
| where | --source | notes |
|---|---|---|
| Public GitHub, GitLab or any git host | git:https://github.com/you/game.git#<commit> | The full 40-character commit id: branches and tags move, a commit doesn't. |
| Private repository, deploy key | git:git@github.com:you/game.git#<commit> with --source-access deploy-key | Run 0x submit deploy-key <id> first, then add the printed key to the repository as a read-only deploy key (GitHub: Settings → Deploy keys; GitLab: Settings → Repository → Deploy keys). Fetched over ssh. |
| Private repository, token | git:https://gitlab.com/you/game.git#<commit> with --source-access token --source-token-file token.txt | A read-only token. 0x stores it sealed and never shows it again. |
| IPFS | ipfs:<cid> | A directory, or one tar, tar.gz or zip file. Keep it pinned until the check is done. Add a directory with ipfs add -r --hidden: without --hidden, dot-files such as .cargo/config.toml or .npm-cache are left out and the build fails. |
| BitTorrent | torrent:<infohash> or torrent:magnet:?xt=urn:btih:… | Keep seeding until the check is done. Add trackers to the magnet link. |
Caps: 2 GB and 200,000 files of source; a 30-minute build with 8 GB of memory; 4 GB of output.
#2. The build recipe: 0x.build.json
Put it at the root of the source:
{
"image": "node@sha256:<digest>",
"steps": ["npm ci --offline --ignore-scripts --cache .npm-cache", "npm run build"],
"output": "dist",
"env": {"NODE_ENV": "production"}
}image: the toolchain, pinned by digest (name@sha256:<64 hex>). Get it withdocker image inspect --format '{{index .RepoDigests 0}}' node:20. A tag can change; a digest can't.steps: 1 to 50 shell lines, run in order in a copy of the source, as an unprivileged user, with no network. The build can't download anything, so commit what it needs. For npm, commit its cache (npm ci --cache .npm-cacheonce, then commit.npm-cache), so thatnpm ci --offlineinstalls exactly the lockfile's packages.output: the directory whose files you publish (0x publish dist).env: up to 50 plain variables.SOURCE_DATE_EPOCHis set to the commit's time (0 for IPFS and torrents). Use it for any date your build embeds.
Instead of a file you can pass the recipe inline in the submission (source.build), or name
another file with --build-file.
Builds must be reproducible: the same source must give the same bytes. Avoid timestamps, random ids and absolute paths in the output, and sort whatever you concatenate.
#Rust and WebAssembly
For a Rust engine built with wasm-bindgen:
- Use the official
rust@sha256:…image of your Rust version, and carry everything else in the source. cargo vendorthe crates, with a.cargo/config.tomlthat replaces crates-io withvendor/and sets[net] offline = true.- The image has no wasm32 target. Add the
rust-std-<version>-wasm32-unknown-unknown.tar.gzthat rust-lang's channel manifest (static.rust-lang.org/dist/channel-rust-<version>.toml) names, check its SHA-256 in a step, and pointCARGO_TARGET_WASM32_UNKNOWN_UNKNOWN_RUSTFLAGS=--sysroot=…at it. - Build
wasm-bindgen-cliof the same version as yourwasm-bindgencrate from its crates.io source, vendored with the rest. - Put upstream code under
vendor/orthird_party/: the AI review reads your own files first.
Such a source is hundreds of MB, so run 0x source check --no-scan locally (the reviewers' scan has no
size limit).
#3. Check it before you submit
0x source check . --site my-game --site-version 3This runs the same scan the reviewers see (a dry run: nothing is stored), then runs the recipe
in Docker with the same sandbox arguments, and compares the output with what players get from
your hosted version. Compare against a local directory with --against dist, or against any
origin with --against-url https://…/. --no-build and --no-scan skip a stage. On a
mismatch it names the files and exits with status 3.
#4. Submit
0x publish dist --site my-game # the files players get
0x submit . --site my-game --site-version 3 --source git:https://github.com/you/game.git#<commit>
0x submit source-status my-game # the check: match or mismatch, and the auditOr set it in 0x.config.json:
{
"listing": {
"source": {"kind": "git", "url": "https://github.com/you/game.git", "commit": "<40 hex>", "build": {"file": "0x.build.json"}}
}
}A declaration is checked when you submit (400 names the bad field), so a broken one never queues a check.
#What is compared
- A hosted site version: the files you uploaded with
0x publish, by SHA-256. The files 0x adds (x1.json,x1-sw.js,x1/,swarm/) are not part of it. - A game published as builds: the build's files, encrypted files and large files in parts included.
Check a build with
POST /v1/apps/<appid>/builds/<build>/publish {"branch": "public", "source": {…}}and read the result atGET /v1/apps/<appid>/builds/<build>/source. - A web game served from your own host can't be verified, because 0x can't know what your
server sends. The source is still scanned and reviewed, and the result is
unverifiable.
Every published file is match, mismatch, missing (published, not built) or extra (built,
not published; allowed). The verdict is match only when every published file matched.
#5. What reviewers see, what players see
- The file table: every published file, rebuilt identically or not. One mismatch and the source is not verified.
- The scan: languages, binaries and archives in the source, minified or obfuscated code, where dependencies come from, and constructs malware uses, each with file and line. Those constructs include eval of strings, running programs, code loaded from other hosts, miners, wallet drainers, and clipboard and key capture. The rules are public:
curl -s -o /dev/null -w '%{http_code}\n' https://api.0x.limo/v1/sourcecheck/rules- The AI review: a model reads the source (flagged files first) and reports only malware and abuse. It is advisory: an operator decides, as for any submission. AI findings never reach you on their own. You only see issues a reviewer raises (see Review).
Players see one of three states on the game page: Source verified (with the commit, where the
source is, and the audit summary), Source check failed, or Source not provided. Source
verified means "built from this source, and reviewed", which anyone can check again. The public
record is at GET /v1/listings/{id}/source, and the catalog carries source_verified per game.
#API summary
| call | auth | what |
|---|---|---|
POST /v1/listings with source | you | Submit with a source; the response carries source: {job, status}. |
GET /v1/listings/{id} | you | Each version's source status, verdict, file counts and audit summary. Credentials are never returned. |
GET /v1/listings/{id}/source/deploy_key | you | The read-only deploy key to add to a private repository: {public_key, fingerprint}. |
GET /v1/apps/{appid}/source/deploy_key | you | The same, for builds. |
GET /v1/apps/{appid}/builds/{build}/source | you | A build's check. |
POST /v1/sourcecheck/scan | you | The deterministic scan of a tar (up to 50 MB) as a dry run. Nothing is stored. |
GET /v1/sourcecheck/rules | public | The scan's rule data. |
GET /v1/listings/{id}/source | public | The live version's source record and verified flag. |
