Open standard · v1 draft
One deck code for the whole community
Two open formats for the Palworld TCG: PWC. is a self-contained, URL-safe code that is the decklist; PWCS. is an ultra-short variant backed by a public card registry for character-limited environments. Full normative spec: docs/deck-code-standard.md in the repo.
The four artifacts
- PWC portable code — decodable offline, ~100 lines, no server or card database required.
- PWCS short code — same information in typically under ~80 characters, using dense integer card IDs from the public registry at
/api/cards.json. - Share code — a 5–8 character key into a hosted deck page (
/decks/ABC12), referenced ascode:ABC12in play URLs. Site-specific. - Text format — the human-readable interchange:
// Main Deck 4x ETD01-001 3x ETD01-014 2x BP01-001-SSP // Soul Deck 10x ESOUL-001
PWC wire format
PWC. + base64url (no padding) of:
| Offset | Field | Notes |
|---|---|---|
| 0 | version | 0x01 |
| 1 | metadata pair count K | u8; then K pairs of [key_len u8][key ASCII][val_len u8][val UTF-8]. Keys lowercase; e.g. name, author. |
| — | main entry count M | u8; then M entries of [count u8][len u8][ASCII card number], sorted lexicographically. |
| — | soul entry count S | u8; then S entries, same shape, sorted. |
| last | checksum | Sum of every preceding byte mod 256. |
PWCS wire format
PWCS. + base64url (no padding). Card numbers are replaced by dense integer IDs from the registry manifest:
| Offset | Field | Notes |
|---|---|---|
| 0 | version | 0x01 |
| 1 | registry generation | u8; must match your manifest's generation or reject. |
| 2… | metadata pairs | varint count, then [key_len u8][key][val_len u8][val]. |
| — | main deck groups | Four groups: [entry count varint] then delta-encoded LEB128 card ids for 1x, 2x, 3x, then N-copies pairs [count varint][id delta varint]. |
| — | soul deck groups | Same four-group structure. |
| last | checksum | Sum of every preceding byte mod 256. |
- The registry (
/api/cards.json) is append-only: an ID once assigned is never reassigned within a generation — old codes decode forever. - Encoders register new card numbers via
POST /api/cards.jsonwith{ "cards": [...] }— returns the refreshed manifest, safe to call before every encode. - Delta-encoded card IDs MUST be sorted ascending so all deltas are positive.
- Decoders MUST verify version, registry generation, bounds, and checksum — never partially decode.
Versioning
The version byte implies the payload layout: PWC. and PWCS. are both at 0x01. Future formats ship with a new version byte — reject unknown versions rather than guessing. Registry generation is versioned independently of payload version.
Already working on the site
- Every public deck page exposes both a PWC and a PWCS code (with name/author metadata).
- Builder import/export and the Import Code dialog accept PWC, PWCS, share codes, and text lists.
- Play with — or against — a code directly:
/play/local?deckId=PWC.…&bot=PWCS.…, orcode:ABC12for hosted decks. Pick them in Practice vs AI. - Card registry manifest: /api/cards.json
Deck names, lists, and votes are community content; card data belongs to Pocketpair, Inc. and Bushiroad Inc. These formats are offered for the whole unofficial ecosystem to share.