Skip to main content

WAI Extension: Spaces

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

Status: Draft. Registers the record wai.live.spaces: the physical places a room joins together, each a space where many people stand behind one sound system and one camera and take part as a group. A space is a role of the room: every principal the room admits under that role is part of that place, publishing its capture (its sound system’s feed, its ambience, its camera) and playing the room to the place. The room authority signs a space policy, WNP1, naming the roles that are spaces and, for each, its local mix: what that place’s speakers play, which is live-compose §6’s integer mix of the room’s voices with the space’s own voices left out or lowered, and the crowd’s sound (crowd-sound) at a gain of its own. Every space plays the room at one hold: the sound captured at instant c of the room clock is played in every place at c plus the hold, so that the places hear each other, and the stage, at the same instant. The hold is set by a hold statement, WNH1, effective at a room-clock instant chosen ahead of its sending, as co-watch’s controls are. Each space’s player states what it played with ensemble’s presentation statement, WJS1, unchanged; from those statements the room clock signs an alignment statement, WNK1, per window, laid out as co-watch’s skew statement: each player’s offset from the hold, and each pair of players’ skew, as percentiles, with a verdict against the policy’s bound, which anyone holding the room recomputes. A player whose statements are missing is unknown, never in time. No new transport. The reference implementation is the spaces module of wai-rs (feature spaces); the corpus is live-conformance/spaces/, and its second implementation is live-conformance/spaces_verify.py. Keywords MUST, MUST NOT, SHOULD, MAY are RFC 2119/8174.

Texts read for this revision: the live family this extension builds on, as merged (live-events, live-rooms, live-compose §4 and §6, co-watch §5 and §8, ensemble §2, §4 and §5, crowd-sound); RFC 8032 and FIPS 180-4. No outside text is pinned: the rules of this extension are WAI’s own. What the field has, as gathered on 2026-11-14: shows joined across several venues have run only on private radio networks, at a few milliseconds of round trip; no commercial show across venues has published its latency; and no standard sets a common presentation instant across venues and remote audiences over public networks (decision D135).

1. Scope

In scope: the space policy, its signature and the policy in effect at each instant (§3); how this extension’s statements ride in a room’s events, who may sign each, and the policy a statement is read under (§4); spaces, their members, players and sources (§5); the hold, its statement, its rules and the hold in effect (§6); presentation (§7); windows, samples, offsets, percentiles, verdicts, the alignment statement, its completeness, and which spaces are together (§8); the local mix (§9); where each rule is enforced (§10); and verification (§11).

Out of scope: a transport; how a space’s devices capture, encode, decode and play sound, which live-rooms §8 profiles bound; how a player estimates the room clock, which co-watch §7.3 states for a player and §14 here for a wrong estimate; how a room chooses its hold; a place’s acoustics and the delay of its own loudspeakers to its listeners; and how the crowd’s inputs become an aggregate, which crowd-sound defines.

Relationship to the core spec: wai.live.spaces 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-events: this extension changes nothing in it. Its statements are payloads of the meta kind (live-events §4.2), so every statement is signed by its author, chained, stamped with the room clock and rate-bounded by its author’s policy (live-events §5, §6).

Relationship to live-rooms: the descriptor’s and the grant’s layouts are unchanged. A space is a role of the descriptor (live-rooms §3.3), and its members are the principals granted that role; the policy names which roles are spaces. A room states its space policy in a record of its own, WNP1 (§3), chained as co-watch’s policy is.

Relationship to co-watch: the hold is set as co-watch sets a control: at an instant of the room clock ahead of its sending, within a lead and a horizon, so every place applies it at once whatever its own latency, by one order (co-watch §5.3, §5.4). The alignment statement is co-watch’s skew statement (co-watch §8.4), field for field, under a magic of its own, and its windows, slots, samples, percentiles, verdicts and completeness are co-watch’s (co-watch §8.1 to §8.6). What differs is what an error is measured from: co-watch measures a viewer from the controlled position of a recorded source; this extension measures a place from the hold, an instant fixed by the capture of the live sound it played (§8.3). A co-watch verifier reads none of this extension’s statements as its own.

Relationship to ensemble: a space’s player states what it played with ensemble’s presentation statement, WJS1 (ensemble §5.1), its layout, signature and rules unchanged: at an instant of the room clock, the capture instant of each source’s sound it was playing. Ensemble judges each pair of performers by the delay between them, the shorter the better; this extension judges each place by how close it played each sound to the hold, a delay the room chose. A room with both an ensemble policy and a space policy reads a space’s statements under both, and the space is a listener to ensemble (ensemble §2). A room with a space policy and no ensemble policy is not an ensemble room, and an ensemble verifier is not its verifier: ensemble §4.5 would refuse every WJS1 in it.

Relationship to live-compose: a space’s local mix is §6 there, unchanged: its voices are the voices of the room’s composition (§4 and §6 there), each gain changed as §9 says, and the crowd’s voice added; the mixer is §6’s, sample for sample.

Relationship to crowd-sound: the crowd’s voice a space’s local mix plays is crowd-sound’s rendering of the room’s crowd aggregates (crowd-sound §8), at the space’s crowd gain. A room with no crowd policy has no crowd voice.

2. Terms

Integers are little-endian; a signed integer is two’s complement. A digest is SHA-256 (FIPS 180-4), 32 bytes. Ed25519 is RFC 8032’s, verified strictly (SPEC §7 Signatures): a key that fails step 1 or 2 is bad_key, and a signature that fails a later step is bad_signature.

3. The space policy

3.1 Layout

fieldsizemeaning
magic4WNP1 (ASCII)
version11 in this revision
room32the room id (live-rooms §3.2)
prev32the digest of the policy this one replaces (§3.4); 32 zero bytes for the first
effective8u64: the room-clock instant from which this policy applies; 0 for the first
lead_ms4u32: the least time from a hold statement’s sending to its instant (§6.2), above 0
horizon_ms4u32: the most time from a hold statement’s sending to its instant, at least lead_ms
min_hold_ms, max_hold_ms4 eachu32: the holds a hold statement may set (§6.2), min_hold_ms at most max_hold_ms, and max_hold_ms from 1 to 60 000
period_ms4u32: the slot length: a player states its presentation at least once in each (§7.3, §8.1), above 0
window_ms4u32: the length of a window (§8.1), a multiple of period_ms of 1 to 1000 slots
settle_ms4u32: how long after a player’s join and a hold’s instant a sample is settling (§8.3)
bound_us4u32: the alignment bound (§8.5), above 0
quantile1the percentile a verdict is taken at (§8.5), 1 to 100
spaces1 + 5 × na u8 count (1 to 16), then each space: role (u8, the index of a role of the room descriptor), own_gain (u16, Q12, 0 to 4096), crowd_gain (u16, Q12, 0 to 16 384) (§9)
sig64§3.2

3.2 Digest and signature

The digest of a policy is SHA-256 over its record from magic through spaces. The signature is Ed25519 by the room descriptor’s authority over the 17 bytes wai:space-policy (ASCII) and 0x01, followed by the bytes the digest covers.

3.3 Reading and rules

A reader reads exactly the bytes it is given as one policy, 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 WNP1: 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.
  3. Bytes after sig: malformed.

It then holds the policy to the rules of §3.1’s table, and refuses one that breaks any of them as space_policy_malformed: lead_ms, period_ms and bound_us are above 0; horizon_ms is at least lead_ms; min_hold_ms is at most max_hold_ms, which is 1 to 60 000; window_ms is period_ms times a whole number from 1 to 1000; quantile is 1 to 100; there are 1 to 16 spaces, in strictly ascending order of role; and each space’s own_gain is at most 4096 and its crowd_gain at most 16 384. Then, against the room: its room is the room id (wrong_room); each space’s role is the index of a role of the room descriptor (space_policy_malformed); its signature verifies (bad_key, bad_signature); and its link holds (§3.4, space_policy_unlinked).

3.4 The policy in effect

A verifier is given a room’s policies in a list. The first has prev zero and effective 0. Each later one has as prev the digest of the one before it in the list, and an effective above that one’s. A policy that breaks this is refused space_policy_unlinked. The policy in effect at room-clock instant t is the last of the list whose effective is at or below t. A policy is replaced, never amended.

4. Statements

4.1 Carriage

magicstatementsectionwho signs it
WNH1hold statement§6.1a room key, or a principal whose grant in effect has the direct power (§6.2)
WJS1presentation statement§7 (ensemble §5.1)a space’s player, with its own key
WNK1alignment statement§8.4a room key

Each statement is the payload of a meta event: its magic, a version byte of 1, and the fields its section lists. A meta payload whose first four bytes are none of these magics is not this extension’s, and a sink that does not implement it shows none of them: they are timed metadata for its application (live-events §4.2). A WJS1 statement whose author is not a member of a space at its event’s t (§5.1) is not this extension’s either: it is an ensemble performer’s, which this extension passes over. Every statement is bounded by its author’s policy (live-events §5, max_payload), 1024 bytes for a room key, which bounds the counts §8.4 allows.

4.2 Reading

A hold statement or an alignment statement that ends before a field, that holds bytes after its last field, whose version is not 1, or whose field holds a value its section does not allow, is space_statement_malformed. A presentation statement is read as ensemble §4.2 and §5.1 read it, and one that does not read is ens_statement_malformed.

4.3 Who signs

An alignment statement by any principal but a room key is space_not_permitted, and so is a presentation statement by a member whose grant in effect at its event’s t may not subscribe: a member that plays nothing to the place has nothing to state. A hold statement’s author is checked by §6.2. Since a statement is a meta event, the room verifier has already held it to its author’s grant: a principal whose policy does not permit meta cannot send one (live-rooms §9.2 step 4, kind_not_permitted).

4.4 The policy a statement is read under

A statement is read under the policy in effect at its event’s t. A statement at an instant with no policy in effect is refused space_no_policy: since the first policy is effective from 0, a room has such a statement only when it has no policy at all.

5. Spaces

5.1 Members

A space at instant t is a role named by the policy in effect at t. A principal is a member of it at t when it is present at t (from the t of a join of it to the t of the following leave of it, if any, live-rooms §7.2) and its grant in effect at t is of the space’s role. A principal is a member of at most one space at once, since a grant has one role.

A space is a place, so its members are the devices of that place: the feed of its sound system and its ambience microphones, which publish its sound; its camera, which publishes its picture; and its player, which plays the room through the place’s speakers. Each holds its own grant under the space’s role, narrowed to what it does (live-rooms §4.3: a grant narrows its role). The authority admits a device to a place by granting it the place’s role, and moves it by a grant exchange (live-rooms §4.6).

5.2 Players

A member whose grant in effect may subscribe (live-rooms §3.3) is a player of its space. A space normally has one player; a place with two sound systems that play the room separately, two zones of one hall, has two, and each is measured and judged as itself (§8).

5.3 Sources and the return feed

A source at instant t is a principal that publishes its sound at t: from the t of a publish of its own audio track (live-rooms §7.2: no slot, media 1) to the t of the following unpublish of that track or leave of it, if any, as ensemble §7.2 has it. A space’s own sources are the sources among its members. A space’s return feed is what its own sources publish: the sound of the place, which every other space’s local mix plays (§9) and every listener of the room may subscribe to.

6. The hold

6.1 The hold statement

fieldsizemeaning
magic, version5WNH1, 1
at8u64: the room-clock instant it takes effect
hold_us4u32: the hold, in µs, above 0

A hold statement whose hold_us is 0 is space_statement_malformed.

6.2 Rules

A hold statement’s author is a room key, or a principal whose grant in effect at its event’s t holds the direct power (live-rooms §3.3, bit 1). Otherwise it is refused hold_not_permitted.

A hold statement is sent ahead of its instant, so that it reaches every place before the instant comes, and not far ahead. With t its event’s t, under the policy in effect at t:

  1. at is at least t + lead_ms × 1000: otherwise hold_not_ahead.
  2. at is at most t + horizon_ms × 1000: otherwise hold_beyond_horizon.

Then, under the policy in effect at at:

  1. hold_us is from min_hold_ms × 1000 to max_hold_ms × 1000: otherwise hold_out_of_range.

A relay or a room service that carries the room’s events MUST NOT carry a hold statement these rules refuse, and a player MUST NOT apply one.

6.3 The order of application and the hold in effect

The accepted hold statements apply in co-watch §5.4’s order: ascending at; of two with one at, the one whose event has the lower t first; of two with one at and one t, the one whose event digest is the lower first. Of the hold statements at one instant, each but the last is overridden, and the last is applied. The hold in effect at instant x is the hold_us of the last applied hold statement whose at is at or before x; before the first, there is none, and a space plays nothing held (§6.4, §9).

6.4 What a player does

A player of a room with a space policy MUST, while it is present and a hold is in effect:

A room chooses a hold longer than the longest path from any source to any player, so that every place can play every sound at its instant; the alignment statements (§8) show which places do, and a room raises the hold, ahead, when one does not.

7. Presentation

7.1 The statement

A player states what it played with ensemble’s presentation statement, WJS1 (ensemble §5.1): listener is the player’s key, at an instant of the room clock, and each entry a source it was playing at at with the capture instant of that sample. The statement’s layout, digest and signature are ensemble §5.1’s, and its rules ensemble §5.2’s, with ensemble’s reasons: its room is the room id (wrong_room); its listener is its event’s principal (ens_wrong_key); its signature verifies (bad_key, bad_signature); and its at is at most its event’s t (ens_presentation_ahead).

7.2 Own sources

A presentation statement of a player whose space’s own_gain is 0, under the policy in effect at its event’s t, that has an entry for an own source of the player’s space at that t, is refused space_own_presented: it states that the player played the place’s own sound back into it, which its local mix leaves out (§9).

7.3 The page

A player MUST state, at least once in every slot (§8.1) while it is present and plays, and SHOULD twice so that timer jitter leaves no slot empty, a presentation statement listing each source it was playing at at, with that sample’s capture instant (the object’s timestamp on the room clock plus the sample’s offset in the object, ensemble §5.3), and as at the instant the sample left it for the place’s speakers, as its audio output reports it, on its estimate of the room clock.

8. Alignment

8.1 Windows and slots

Windows and slots are co-watch §8.1’s, under the space policy: a window is a stretch of the room clock from from up to, but not including, to, over which one policy is in effect, whose length is a whole number of its slots from 1 to 1000; its slots are period_ms × 1000 µs long from from.

8.2 Players and due slots

A slot is due for a principal when, for the whole slot (from at or before its start to at or after its end):

The players of a window are the principals with a slot of the window due.

8.3 Samples, offsets and settling

An alignment statement names, for each player it lists, held: how many of the player’s events the room clock held when it made the statement (its next seq). A player’s sample in a slot is, of its accepted presentation statements whose event’s seq is below held and whose at is within the slot, the first in the merged order. A statement the clock had not received when it made its statement is not a sample of that statement, whenever it arrived.

An entry’s offset is a − (c + H), with a the statement’s at, c the entry’s capture instant, and H the hold in effect at a, a signed number of µs computed without overflow (at least 66 bits). A sample’s error is the offset of its entries of greatest magnitude; of two of one magnitude, the one above 0. A player is as far from the hold as the furthest of the sounds it played.

A sample is settling when its at is within settle_ms × 1000 µs (of the policy in effect at its at) after a join of the player or the at of an applied hold statement: at or after that instant and before it plus settle_ms × 1000. A settling sample fills its slot, and is not counted: a player that has just joined, or every player moving to a new hold, takes a moment that the bound is not about. A source that begins to publish needs no settling: a player holds its first samples to their instant as it holds every other’s.

8.4 The alignment statement

fieldsizemeaning
magic, version5WNK1, 1
from, to8 eachu64: the window (§8.1)
bound_us4u32: the bound it judges by, the policy’s
quantile1the percentile it judges at, the policy’s
players1 + 59 × va u8 count (1 to 8), then each player: principal (32), held (u64), due, samples, counted (u16 each), p50, pq, max (u32 each), verdict (u8)
pairs1 + 17 × v(v − 1)/2a u8 count, then each pair: a, b (u8 each, indexes into players), n (u16), p50, pq, max (u32 each), verdict (u8)

This is co-watch’s skew statement (co-watch §8.4), field for field, its viewers the window’s players. Its entries are co-watch’s over this section’s errors: for a player, due is its due slots, samples the due slots it has a sample in, and counted those whose sample is counted; p50, pq and max are the 50th and the quantile-th percentile and the greatest of the absolute errors of its counted samples, and all three 0 when it has none. For a pair, n is the due slots in which both have a counted sample, and p50, pq and max are over the absolute values of the skew in those slots, the first player’s error less the second’s. A value above 2^32 − 1 is written 2^32 − 1.

An alignment statement is space_statement_malformed as co-watch §8.4 holds a skew statement malformed: its players are not in strictly ascending order of principal; a verdict is outside 1 to 3; its pairs are not every pair of its players exactly once, in ascending order of (a, b) with a below b; from is not below to; to is above its event’s t; or the policy in effect at from is not in effect up to to, or to − from is not a whole number of its slots from 1 to 1000. Then, under the policy in effect at from:

  1. bound_us and quantile are the policy’s: otherwise alignment_mismatch;
  2. each player it lists is a player of the window, its held is at most the number of that player’s events the room holds, and its entry is the one recomputed from the room: otherwise alignment_mismatch;
  3. each pair’s entry is the one recomputed: otherwise alignment_mismatch.

A statement may list a subset of a window’s players, since one holds at most eight; it states the pairs among those it lists. §8.6 requires every player of the window to be listed by one.

8.5 Percentiles and verdicts

Percentiles are co-watch §8.5’s, by nearest rank: the q-th percentile of n values, n above 0, is the value at index ⌈q × n / 100⌉ − 1 of the values in ascending order. A verdict is 1 in time, 2 out of time or 3 unknown:

“In time” is so a claim with a stated bound, checked against the statements. A player whose statements are missing for a slot it was due is unknown, never in time: a place that stops stating is not counted as keeping to the hold.

8.6 Completeness

A room clock that states a window states all of it. Once every record is read, for each window that an accepted alignment statement names, every player of the window is listed by an alignment statement of that window: otherwise alignment_incomplete, at the window’s first alignment statement in the merged order.

8.7 Spaces together

For a window that accepted alignment statements name, each player and each pair of players is read from the first alignment statement of the window, in the merged order, that lists it; a pair of players that no statement of the window lists together (a window stated in more than one statement lists each pair only within one) is unknown. A space with a player in the window is in time when each of its players is, unknown when any is unknown, and out of time otherwise. Two spaces each with a player in the window are together when each pair of a player of one and a player of the other is in time, unknown when any such pair is unknown, and apart otherwise. Every instant of the window has that window’s answer, so anyone holding the room recomputes, for each instant an alignment statement covers, which places heard the room at its hold, and which heard each other at one instant.

9. The local mix

9.1 The voices

A space’s local mix at instant x is what its player plays at x. With H the hold in effect at x (§6.3) and C the room’s composition descriptor (live-compose §3), it is live-compose §6’s mix of these voices, in this order:

  1. the voices of C’s composition at x − H (live-compose §4 and §6: the room as it stood when the sound being played was captured; none when x is below H), each with its pan, and with its gain g, but a voice of an own source of the space at x − H, whose gain is ⌊g × own_gain / 4096⌋: 0 leaves the place’s own sound out, and a value between lowers it;
  2. when the room has a crowd policy and the space’s crowd_gain is above 0, the crowd voice (crowd-sound §8) at x, mono, at gain crowd_gain and pan 0.

Each voice of step 1 is mixed from its decoded audio captured from x − H on: the block the mixer mixes at x is the block of each voice that was captured at x − H. A voice whose gain is 0 is mixed as silence and changes nothing. The arithmetic is live-compose §6’s, unchanged: the sum of up to 65 terms of at most 2^41 is exact, and an input that §6 refuses is mix_input_malformed. With no hold in effect at x a space has no local mix, and with no composition descriptor no voice of step 1.

So the local mix of every space is an integer function of the room’s events, its composition descriptor, the space policy, the crowd aggregates and the decoded sound: two players of one space mix the same samples, and a verifier given the room states every space’s voices at any instant (§11.3).

9.2 Why the mix is held

A place hears every other place, and the stage, at the instant it was captured plus the hold, the same instant in every place. A cheer in one hall reaches every other hall together; the stage hears the halls together, one hold after the moment they cheered at; and a place’s own sound, which its people already hear in the room, is left out or lowered so that it does not return to them a hold late. A room that wants the stage to hear the halls sooner shortens the hold for every place.

10. Where each rule is enforced

After the fact, a verifier (§11) checks every one of these against the room: a hold a service carried that §6 refuses, a statement by a key that is not its player’s, a player that played its own place back, and an alignment statement that does not recompute, calls a player in time whose samples are missing, or leaves a player out, are each found out.

11. Verification

11.1 Inputs

A spaces verifier is given what a room verifier is given (live-rooms §9.1: a descriptor, grants, a key-log head or none, and the chains), and:

11.2 Steps

It runs these steps and stops at the first refusal, which it reports with the reason and where:

  1. The room (live-rooms §9): a refusal, at room with the room verifier’s own place. A gap is not a refusal; the steps go on, and the checks of an alignment statement that recompute from the room (§8.4 steps 2 and 3, and §8.6) are not made: each depends on events the verifier may not hold.
  2. The policies, in the list’s order (§3.3, §3.4): at the policy’s index.
  3. The statements, in the merged order: each meta event the room accepted whose payload begins with a magic of §4.1, but a presentation statement whose author is no member of a space at its t (§4.1): §4.4 (space_no_policy), then §4.2, then §4.3, then the rules of its section, in the order each section gives. An alignment statement’s checks that recompute (§8.4 steps 2 and 3) are made after every statement has been read, in the merged order, since its samples may follow it there. At the record.
  4. Completeness (§8.6): at the record.
  5. The local mixes, when a composition is given: the descriptor (live-compose §3.3, §3.5), at composition; then, at each instant of the list, in order, the voices of each space of the policy in effect (§9.1), the composition’s refusal at that instant (live-compose §9 step 3) at mix with the instant. A gap in a room key’s chain refuses this step lifecycle_incomplete (live-compose §4.1), at mix.
  6. The outcome (§11.3).

11.3 Outcomes and what a verification states

With accept or gap, the verifier states:

12. Reasons

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

reasonraised at
space_policy_malformed§3.3
space_policy_unlinked§3.4
space_statement_malformed§4.2, §6.1, §8.4
space_no_policy§4.4
space_not_permitted§4.3
hold_not_permitted§6.2
hold_not_ahead§6.2 step 1
hold_beyond_horizon§6.2 step 2
hold_out_of_range§6.2 step 3
space_own_presented§7.2
alignment_mismatch§8.4
alignment_incomplete§8.6

A spaces verifier also raises every code a room verifier raises (live-rooms §11 and the live-events codes it lists), at room; truncated, malformed and unknown_version for a policy that does not read; wrong_room, bad_key and bad_signature for a policy of another room or whose signature fails, and for a presentation statement (§7.1); ensemble’s ens_statement_malformed, ens_wrong_key and ens_presentation_ahead for a presentation statement (§4.2, §7.1); live-compose’s codes for a composition descriptor and an instant it refuses (§11.2 step 5), lifecycle_incomplete among them; and delivery_gap for a gap, which is not a refusal.

13. Conformance

live-conformance/spaces/ holds the corpus, in one file, vectors.json, written from fixed seeds by wai_spaces_vectors gen. It has rooms, each a room (descriptor, grants, key-log head or none, chains), its policies, its composition descriptor or none and its instants, and the outcome §11.3 gives them with everything it states; and mixes.

A conforming verifier gives every room the outcome, the reason, the place, and everything else the corpus states, and every mix its samples. wai_spaces_vectors verify and the test tests/spaces.rs check that the file regenerates byte for byte, that wai-rs gives every room its outcome, that every reason of §12 appears, and that §12 lists exactly the reference’s codes. live-conformance/spaces_verify.py is the second implementation, written from this text: it shares no code with wai-rs; it verifies each room with the live-rooms corpus’s second implementation (live_rooms_verify.py), reads presentation statements with the ensemble corpus’s (ensemble_verify.py), lays the composition out with the live-compose corpus’s (live_compose_verify.py), and verifies every signature with WAI’s strict rule (claim-conformance/_ed25519.py); and 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.

14. Security and privacy considerations