0xpak asset packs
Partly live0xpak is 0x's cooked asset pack, one signed, content-addressed, range-readable file for a game's assets that the player swarm delivers. Overview, status and the full reference.
An .0xpak is one file that holds a game's assets, cooked and ready for the GPU or the player,
with every original file kept by its path. Its id is its SHA-256, any part of it can be
read with a range request, and one Ed25519 signature over its header and table of contents
covers every blob. It travels over the 0x player swarm like any other file, with your origin
as the fallback.
Formerly x1pak
0xpak used to be called x1pak. Only the name changed: the format, magic bytes, signatures and hashes are
the same, readers still open .x1pak files, and new packs are written as .0xpak. This page and the
full reference keep their /x1pak/ addresses.
The full reference lives at /sdk/x1pak/
The complete 0xpak documentation (format, signing, encryption, the x1cook CLI, readers,
publishing and limits) is maintained at
0x.limo/sdk/x1pak/. This page is a summary and a map into it.
#Why use it
- Cooked. Meshes are GPU vertex and index buffers, textures are WebP or PNG as delivered, and audio is Ogg. Nothing is converted at load time.
- Signed. One signature covers every blob's SHA-256, and a client can check it from the first few KB.
- Content-addressed. The pack's id is the SHA-256 of the file, and each blob is listed by its own hash. The same sources cooked twice give the same bytes.
- Range-readable. One range request returns the head. After that you fetch only the blobs you draw, and each is verified before it is decoded.
- P2P-friendly. One pack is one torrent. Thousands of loose files become a few dozen seeded packs.
#What is live
| piece | status |
|---|---|
| The web worlds (Earth, Los Santos, War) read their assets from signed packs | live |
A hosted game's .0xpak files are seeded on the swarm like any other file | live |
x1cook (cook, import, sign, verify, extract) | source only: no public binary or npm package yet |
x1cook swarm (prints a pack's swarm manifest entry) | in the next build |
| Signing your packs on the server when you publish to hosting | coded, off on 0x.limo |
| Encrypted packs with owner-only keys | coded, off |
| Swarm range reads (only the torrent pieces under one blob) | in development: range reads go to the origin |
| The native runtime (sg-runtime) reading packs | not yet |
The canonical page keeps this table current: see What is live.
#Packs on 0x hosting
Packs need nothing special on 0x hosting:
- With the default swarm policy, every file of 16 KiB or more goes on
the swarm, packs included. A
swarm-assets.jsoncan narrow it, for example{"include": ["packs/*.0xpak"]}. - The 64 MiB per-file limit of hosting applies, so split big content into several packs.
- Keep pack keys out of your build directory.
@0xlimo/cli0.1.4 leaves out onlyx1-iap.key. The rule that also skips*.0xpak.key(and*.x1pak.key) is not in a released CLI yet, and the hosting service doesn't refuse.keyfiles. Anything you upload is public on your site's origin. - Paid games are built origin-only, so their packs are not seeded (see What you control).
#Reference map
| topic | on the canonical page |
|---|---|
| Quick start: pack, verify, list, publish | #quick |
| Format reference (container v1, header, TOC, blobs) | #format |
| Signatures and publisher roots | #signing |
| Encryption | #encryption |
The x1cook CLI | #x1cook |
| Reading packs (browser and Rust) | #reading |
| P2P delivery | #p2p |
| Publishing your game's packs | #publish |
| Limits | #limits |
| Security model | #security |
| FAQ | #faq |
