Skip to main content

WAI Extension: World Cells (a shared world that scales to a crowd)

Mirrored from the canonical text at commit 498e6b88 ().

Status: Draft. Registers the record wai.live.cells: the room authority’s signed cell statement, WLC1, that a room carrying a shared world (live-worlds) with places (world-voices §4) partitions its floor into square cells, names a cell host, a room key that carries each cell’s operations on a cell track of its own, and sets how far around its own cell a participant follows the world. An actor moves from one cell to another by a handoff, an action of its own that both cells’ tracks carry, so each cell replays deterministically from its own track: who is in it, where, and its cell hash. A participant follows its own cell and its neighbours, and one that enters late fetches only those cells. The host also signs, per cell and per window of ticks, a crowd aggregate, WLA1: how many are present, who entered and left, and how many sent each kind of reaction, so a listener far away sees a crowd without following its members, and hears it through crowd-sound’s aggregate for the cell’s scope (§8.5); a window it holds no record of is unknown, never empty. Nothing in live-worlds changes: every actor still publishes its own world track, a participant of live-worlds alone still holds the whole world, and the union of the cells is that world. The reference implementation is the world_cells module of wai-rs (feature world_cells); the corpus is live-conformance/cells/, and its second implementation is live-conformance/world_cells_verify.py. Keywords MUST, MUST NOT, SHOULD, MAY are RFC 2119/8174.

Texts read for this revision: crowd-sound (its scopes and its crowd voice, §6.2, §8), live-worlds (its statement, tracks, receipts, catching up and verification, §3, §4, §7, §9), world-voices (places, §4, and its cutoff, §5.2), interactive-worlds §5.1 and §5.2, live-rooms, live-events (reaction types, §4.5), jwp-receipts and moq-streaming-format as merged; draft-ietf-moq-transport-22 (MOQT), an Internet-Draft, a section number of which in this text is that revision’s; RFC 8032 and FIPS 180-4. The numbers it is built for, as gathered on 2026-11-14: shared worlds keep 80 to 200 people in one instance and shard a crowd past that, the shards sharing nothing; one concert in a game reached 12.9 million concurrent across its shards; a relay was measured fanning one track out to 4 000 viewers on 8 cores at a p99 of 25 to 36 ms, about 8 000 at its limit (decision D130).

1. Scope

In scope: the cell statement, its signature and its rules (§3); the grid, a place’s cell and a cell’s neighbourhood (§4); the handoff and who is in a cell (§5); the cell track, its objects and its receipts (§6); following the world by cells, and catching up (§7); the crowd aggregate (§8); verification and the cell hash (§9); metering (§10).

Out of scope: a transport; how a host decides which cell an op is for beyond §5’s rules; a cell’s rendering; how a sink renders a crowd from its aggregate, beyond §8.4; how a principal obtains a grant.

Relationship to the core spec: wai.live.cells is a record (SPEC §5): signed records a WAI tool emits and verifies. It names no payload format and is not dispatchable.

Relationship to live-worlds: nothing in it changes. Its world statement, its actors’ world tracks, their receipts, its verification and its session hash stand. The cell host follows every actor’s world track as a participant does (live-worlds §9.2) and carries each op it admits again on the tracks of the cells §5 assigns it to; an op keeps its actor’s signature, so the host can withhold or misplace an op and never make one (§12). A participant that follows every world track holds the whole world as before; one that follows cell tracks holds the cells it follows.

Relationship to world-voices: a cell world is a world with places. Its grid covers world-voices’ floor, a handoff is a place body followed by two cells (world-voices §4.1 reads its first 13 bytes and sets the place), and the voices a listener hears all stand in the cells it follows (§3.3, the cutoff rule).

2. Terms

3. The cell statement

3.1 Layout

Integers are little-endian.

fieldsizemeaning
magic4WLC1 (ASCII)
version11 in this revision
room32the room id (live-rooms §3.2)
host32the cell host’s Ed25519 key
cell_mm4u32: a cell’s edge in millimetres, 1 to 16 777 215
radius1how many cells around its own a participant follows (§4.2), 0 to 4
window_ticks4u32: the length of a crowd aggregate’s window in ticks (§8.1), at least 1
sig64§3.2

A statement is 142 bytes.

3.2 Digest and signature

The digest of a statement is SHA-256 (FIPS 180-4) over its record from magic through window_ticks. The signature is Ed25519 (RFC 8032) by the room descriptor’s authority over the 15 bytes wai:live-cells (ASCII) and 0x01, followed by the bytes the digest covers. It is verified strictly, as SPEC §7 Signatures requires: a signature that fails is bad_signature.

3.3 Reading and rules

A cell statement is read only beside the room’s world statement (live-worlds §3) and voice statement (world-voices §3): a verifier given one with no voice statement refuses it as cells_without_places. A reader reads exactly the bytes it is given as one statement, in the order of §3.1, and refuses at the first of these that holds:

  1. Fewer than 4 bytes: truncated. A magic other than WLC1: malformed. No byte after the magic: truncated. A version other than 1: unknown_version.
  2. The bytes end before a field the layout requires: truncated. Bytes follow sig: malformed.
  3. A field breaks its rule in §3.1’s table, or the grid of §4.1 over the voice statement’s floor has more than 65 536 cells: cells_statement_invalid.
  4. The voice statement mixes voices (max_sources above 0) and its cutoff_mm is above radius × cell_mm: cells_cutoff_beyond_neighbourhood. Every voice a listener hears then stands in a cell it follows (§4.2), so a participant that follows its neighbourhood mixes the same samples as one that holds the whole world.
  5. room is not the room id of the descriptor the statement is read beside: wrong_room.
  6. The signature does not verify under the descriptor’s authority (§3.2): bad_signature.

A room has at most one cell statement.

4. The grid

4.1 Cells

The grid has C = ⌊extent_x / cell_mm⌋ + 1 columns and R = ⌊extent_y / cell_mm⌋ + 1 rows, extent_x and extent_y being the voice statement’s (world-voices §3.1). The cell of a place (x, y) is the column ⌊x / cell_mm⌋ and the row ⌊y / cell_mm⌋, and its index is row × C + column, from 0 to C × R − 1. Every place of the floor is in exactly one cell.

4.2 Neighbourhoods

The neighbourhood of the cell at column a and row b is every cell whose column is within a − radius … a + radius and whose row is within b − radius … b + radius, those inside the grid, listed in ascending index. A place in a cell is at least radius × cell_mm millimetres from every cell outside that cell’s neighbourhood.

5. Handoffs and presence

5.1 The handoff

An actor moves into, out of or between cells by a handoff: an action whose payload is exactly 21 bytes, a place body (world-voices §4.1) and then two u32, from and to, each a cell index or none. It enters the world’s cells when from is none, leaves them when to is none, and moves from from to to otherwise. As a place body, it sets the actor’s place (world-voices §4.3); its move is not applied. A payload that is not exactly that is not a handoff.

5.2 Who is in a cell

In a cell world each actor’s ops are in canonical order of their own: each op of an actor has an effect_tick at or above that of the actor’s op before it in lamport order, so an actor’s ops in lamport order are its ops in canonical order (interactive-worlds §5.2). A cell’s rules read an actor’s ops in that order, from absent:

An actor present in a cell has a place in it at every tick from its handoff in; who is present in a cell at tick k, and where, is what these rules give over the cell’s admitted ops whose effect_tick is at most k.

5.3 What a host carries

The host carries an op it admitted on the track of the cell its actor is present in before the op, and a handoff also on the track of the cell it enters: a handoff from c to d is on both tracks, byte for byte. Each op is on no other cell’s track. An actor present in no cell has no op on any cell track but a handoff whose from is none.

6. The cell track

6.1 Naming

The host H of room R publishes a cell track for each cell that has an op. With R and H as 64 lowercase hexadecimal digits, its Track Namespace is [R, H, "cell"], its Track Name is c and the cell’s index in decimal (c0, c17), and its receipts track (moq-streaming-format §4.1) is in the same namespace, named the track’s name and _receipts. The names keep live-rooms §6.1’s rules, and namespace prefix matching on [R, H, "cell"] reaches every cell track of the room.

6.2 Objects

Each group of a cell track holds exactly one object, Object ID 0, whose payload is one op batch (live-worlds §2) of at most max_ops ops, each at most max_op_bytes bytes, the world statement’s. The groups are numbered from 0 with no gap. An op carried again that is byte for byte the same as one the track carried is a redelivery and changes nothing; a second op with the op id of one the track carried and other bytes is equivocation (live-worlds §4.2). An op of actor P that the track carries and that is not a redelivery has a lamport greater than that of every op of P the track carried before it.

6.3 Receipts

A cell track carries receipts as a world track does (live-worlds §4.3), signed by the host’s key, with the cell’s receipt alias, 65 536 plus the cell’s index, as its track_alias (jwp-receipts §2.4.1). A relay that checks receipts at a door holds every cell track to the host: a door rule over ["*", "*", "cell"] whose trusted field is the namespace’s second.

6.4 Rights

The host’s key is a room key of the room by the authority’s statement. A relay that honours a room’s grants (live-rooms §10.5) accepts a PUBLISH under [R, H, "cell"] or [R, H, "crowd"] only from a session that proved the host’s key, and refuses any other with REQUEST_ERROR UNAUTHORIZED (MOQT §12.3). A grant that may subscribe reads every cell track and the crowd track, as it reads every track of the room.

7. Following the world by cells

A participant whose place is in cell c SHOULD follow the cell tracks of c’s neighbourhood and their receipts tracks, and MAY follow no world track; when a handoff of its own moves it to another cell, it follows the cells of the new neighbourhood it did not follow, and MAY stop following those it no longer needs. A participant with no place follows the neighbourhood of a cell of its choosing. A participant follows the crowd track (§8.3) for the cells beyond its neighbourhood.

A participant that enters a room in progress, or follows a cell it did not follow, fetches that cell track and its receipts track from group 0 to the live edge (MOQT §3.2; live-rooms §10.6) and admits the fetched objects in group order before any it received live, as live-worlds §7 has it for a world track; it fetches no other cell. A fetch that does not return every group from 0 to the live edge leaves that cell incomplete, cell_incomplete, at its first missing group, and a participant MUST NOT report a cell hash or a presence for an incomplete cell. A relay that carries a cell world SHOULD keep every group of the cell tracks, from group 0, while the room lasts. With N participants spread over the cells, each follows at most (2 × radius + 1)² cell tracks and the crowd track, and each cell track has the participants of its neighbourhood as its subscribers, where every participant following every world track makes N² subscriptions.

8. The crowd aggregate

8.1 Windows and reactions

Window w is the ticks w × window_ticks … (w + 1) × window_ticks − 1. A reaction is an action whose payload is exactly 5 bytes, WCR1 (ASCII) and a type from 1 to 5, live-events §4.5’s reaction types (1 emoji, 2 vote, 3 raise, 4 applause, 5 custom); a payload of another form is not one. A reaction is an action and keeps §5.2’s rules, its move applied (an actor’s page sends it with a move of (0, 0)). It is what a far participant sees of a crowd; what it hears is §8.5’s.

8.2 Layout

fieldsizemeaning
magic4WLA1 (ASCII)
version11 in this revision
room32the room id
cell4u32: the cell’s index
window8u64: the window
through8u64: how many groups of the cell’s track, from group 0, the aggregate is computed from
present4u32: the actors present in the cell at the window’s end
entered4u32: the handoffs into the cell whose tick is in the window
left4u32: the handoffs out of the cell whose tick is in the window
reactions20five u32: for each reaction type, the actors that sent at least one reaction of it in the window
sig64Ed25519 by the cell statement’s host over the 15 bytes wai:live-crowd (ASCII) and 0x01, followed by every byte before sig

Each value is computed from the cell’s admitted ops of groups 0 to through − 1, in canonical order: present at the window’s end is who §5.2 gives at its last tick. entered and left count handoffs, so an actor that enters twice counts twice; reactions count each sender once per type, whether or not it is present at the window’s end. A record is 153 bytes.

8.3 Carriage and reading

The host publishes the crowd track, Track Namespace [R, H, "crowd"], Track Name 0, receipt alias 5, signed into its receipt chain as any track (moq-streaming-format §4.1): one group a window from the first it publishes, its object the window’s records in ascending cell order, a record for each cell in which an actor was present or acted during the window. A reader refuses a record that does not read as §8.2 lays it out (truncated, malformed, unknown_version), whose room is not the room’s (wrong_room), whose signature does not verify under the host (bad_signature), or whose cell is outside the grid (aggregate_invalid).

8.4 Unknown is never empty

A cell for which a sink holds no record of a window is unknown for that window, never empty: a sink shows it as unknown and does not show it as a cell of no one. A sink MAY show present, entered, left and reactions for a cell beyond its neighbourhood.

8.5 A cell’s crowd sound

What a far listener hears of a cell is crowd-sound’s, whose aggregate has one form for every part of a room’s crowd (crowd-sound §6.2). A cell is such a part: its scope is SHA-256 over the 21 bytes wai:world-cell-scope (ASCII) and 0x01, the room id and the cell’s index as a u32. A member may report to a cell’s scope in a window (crowd-sound §6.1) when it is present in that cell, by §5.2 over the cell’s track, at the tick of its contribution’s instant on the room clock (world-voices §4.2): its presence at that tick is §5.2’s over the cell’s admitted ops whose effect_tick is at most the tick. A member that was not is not entitled to report to that cell (crowd-sound §6.2 leaves that to this extension), and a verifier holding the cell refuses its input as crowd_reporter_absent (§9.2); an aggregate of the cell’s scope that counts such an input counts a member the cell did not hold. A page that follows its cell sends its crowd inputs (crowd-sound §5.1) with its cell’s scope. A participant hears a cell beyond its neighbourhood by the crowd voice of the cell’s scope (crowd-sound §8), which a sink MAY place at the cell’s centre by world-voices §5’s law, and shows a window that crowd-sound states too few, or does not state, as such, never as silence (crowd-sound §8.4). The cell’s crowd aggregate (§8.2) gives the count of the members present beside crowd-sound’s count of those reporting.

9. Verification

9.1 Inputs

A verifier is given: the room’s descriptor and grants; its world statement, its voice statement and its cell statement; the cell tracks it holds, each with its cell’s index and its objects in group order, each with its Group ID, its receipts-track object and its payload; the crowd aggregates it holds, in order; and the crowd inputs (crowd-sound §5.1) a verification of the room’s events accepted that it holds, in order, each as its author, its event’s t and its scope.

9.2 Steps

The verifier reads the descriptor (live-rooms §3.4), checks the grants in order (live-rooms §4.3), reads the world statement (live-worlds §3.4), refuses a cell statement given with no voice statement as cells_without_places, reads the voice statement (world-voices §3.3) and the cell statement (§3.3), refusing at the first failure and naming the descriptor, the grant or the statement. It then takes the cell tracks in the order given, and each object of a track in group order through every step below before the next, refusing at the first that fails and naming the cell and the group:

  1. The cell is in the grid (§4.1): cell_unknown.
  2. The track’s first object is group 0 and each later object the group after the one before it: cell_gap.
  3. Its receipts verify as live-worlds §9.2 step 3 verifies a world track’s, under the host’s key and the cell’s receipt alias (§6.3), with live-worlds’ and jwp-receipts’ reasons.
  4. The op batch reads and keeps its bounds (live-worlds §9.2 step 4): op_malformed, batch_too_large, op_too_large.
  5. Each op, in batch order: its signature verifies under its actor (bad_op_signature); its actor has a grant whose world is act (live-worlds §5.1, world_not_granted); it is an action (world-voices §2, op_not_action); it is not equivocation (§6.2, equivocation); where it is not a redelivery, it keeps §6.2’s Lamport rule (lamport_regress), its effect_tick is at or above that of its actor’s op before it on the track (tick_regress, §5.2), and it keeps §5.2’s rules for the cell.

It then holds the cells together, in three checks, each over every held cell before the next, each naming an actor and a lamport:

  1. An op that two held tracks carry with one op id and other bytes is equivocation: the cells taken in ascending index, each cell’s admitted ops in group and batch order, at the first op whose op id was seen before with other bytes.
  2. A handoff from one held cell to another held cell that either does not carry, byte for byte, is handoff_unmatched, at the least such handoff by its actor’s key and then its lamport.
  3. An actor present in two held cells at once is presence_overlap, its presence in a cell running from the lamport of its handoff in to the lamport of its handoff out, that one excluded (to no end while it stays): the actors in ascending order of their keys, each actor’s presences in ascending order of their start, their end and their cell, at the first two that overlap, naming the later start. Last it takes the crowd aggregates in order, each read as §8.3 reads it, and each recomputed (§8.2) from its cell’s track as held: a record whose through is above the groups held of its cell is aggregate_beyond_track, and one whose any value differs from the recomputed one is aggregate_mismatch, naming the aggregate. Then it takes the crowd inputs in order (§8.5): an input whose scope is a held cell’s and whose author was not present in that cell at the tick of its t is crowd_reporter_absent, naming the input; an input of any other scope is not this extension’s to check.

9.3 The cell hash

A cell’s cell hash is BLAKE3 over the 23 bytes wai:world-cell-session (ASCII) and 0x01, followed by the world statement’s world and the cell’s index as a u32, chained through each op the cell admitted in canonical order as live-worlds §9.3 chains the session hash: the chain’s next value is BLAKE3 over that domain, the value before it and the op’s whole bytes. Two participants that hold the same admitted ops of a cell hold the same cell hash. The union of the held cells is their admitted ops, each once; when the held cells are every cell with an op, the union is the world, and its session hash (live-worlds §9.3) is the one a participant of every world track holds.

9.4 Outcomes

A verification that refuses states the reason and where. One that passes states, for each held cell, its cell hash, the number of its admitted ops, the actors present at the last tick of its ops with their places, its neighbourhood and its crowd-sound scope (§8.5); the union’s session hash and its number of ops; and the number of crowd aggregates and of crowd inputs of held cells’ scopes it verified. A cell’s present actors are listed in ascending order of their keys.

10. Metering

A relay’s per-hop session record (live-metering §3) counts cell tracks and the crowd track with the room’s other tracks, as live-worlds §10 counts world tracks.

11. Reasons

The codes this extension adds, each with where it is raised:

reasonraised at
cells_without_places§3.3, §9.2
cells_statement_invalid§3.3 step 3
cells_cutoff_beyond_neighbourhood§3.3 step 4
cell_unknown§9.2 step 1
cell_gap§6.2, §9.2 step 2
cell_incomplete§7
op_wrong_cell§5.2
cell_exit_without_handoff§5.2
handoff_from_mismatch§5.2
handoff_place_outside§5.2
handoff_invalid§5.2
tick_regress§5.2, §9.2 step 5
handoff_unmatched§9.2
presence_overlap§9.2
aggregate_invalid§8.3
aggregate_beyond_track§9.2
aggregate_mismatch§9.2
crowd_reporter_absent§8.5, §9.2

Of live-events §9’s codes, a verifier also raises truncated, malformed, unknown_version, bad_signature and wrong_room for a statement or an aggregate that does not read or verify; of live-worlds §11’s, world_not_granted, op_malformed, batch_too_large, op_too_large, bad_op_signature, op_not_action, lamport_regress and equivocation; and of jwp-receipts §3.3’s, those its §3 raises for a receipt. cell_incomplete is a participant’s report about its own copy, not a refusal.

12. Conformance

live-conformance/cells/ holds the corpus, in one file, vectors.json, written from fixed seeds by wai_world_cells_vectors gen. Each vector gives the descriptor, the grants, the three statements, the cell tracks, the crowd aggregates and the crowd inputs, and either the outcome of §9.4 or the refusal, its reason and where:

A conforming verifier gives every vector its outcome, or the reason and the place. wai_world_cells_vectors verify and the test tests/world_cells.rs check that the file regenerates byte for byte, that wai-rs gives every vector its outcome, that every reason of §11 a verifier raises appears, and that §11 lists exactly the reference’s codes. live-conformance/world_cells_verify.py is the second implementation, written from this text: it shares no code with wai-rs; it mutates copies of the corpus and requires every copy to fail, and drops each of its own checks in turn and requires the corpus to catch the weakened verifier. The reference room client’s web/world/cells.js holds the grid, neighbourhoods, handoffs, the cells a participant follows and the aggregates’ reading to the corpus.

13. Security and privacy considerations