-
Notifications
You must be signed in to change notification settings - Fork 450
MSC4143: MatrixRTC – Real-time communication over Matrix #4143
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
toger5
wants to merge
168
commits into
main
Choose a base branch
from
toger5/matrixRTC
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+746
−0
Open
Changes from 1 commit
Commits
Show all changes
168 commits
Select commit
Hold shift + click to select a range
9cbe448
draft
toger5 b2b4e5e
lowercase filename
toger5 8c1340a
add note about this relying on MSC3757
toger5 8c800a6
remove the m.prefix from fields.
toger5 1dcbfce
update
toger5 813a21a
add foci_preferred well known section
toger5 d65e42e
update to reference to msc [MSC4158](https://github.com/matrix-org/ma…
toger5 4ab679a
add a "Reliability requirements for the room state" section
toger5 6d84256
use current state key format
toger5 d68e942
add `expires_after`
toger5 3b19b49
add section about send order (delayed leave event -> join event)
toger5 a278ff8
language fixes
ara4n f97e4e6
clarify that non-empty delayed membership events are invalid
ara4n b626d51
Latest
hughns ec9fa8b
json5 for legibility
hughns 50db42a
be more specific on `member.id`
toger5 9bc444c
add id to session
toger5 33231dc
calrify that the state key cannot be used as the source of truth for …
toger5 cea4cdd
Update proposals/4143-matrix-rtc.md
toger5 d61969a
clarify what is part of this MSC and what can be found in other MSC's
toger5 4ad3961
major rewrite addressing a lot of feedback from offline discussions.
fkwp 1fbd843
json5 code block formats
toger5 60e23d9
add unstable m.rtc.slot prefix.
toger5 680ef7d
fix grammar & link the MSC
ara4n b62f75b
more informatino on the purpose of `member.id`
fkwp 50f8331
markdown cleanup
fkwp d53175b
Remove stray . from slot ID
robintown dc605bf
cleanup field description for to-device message
fkwp 7907635
minor changes to the m.rtc.encryption_key to-device format
fkwp c032f03
Update transport type to match latest MSC4195 revision
robintown 866ca09
Require authentication for MatrixRTC transport discovery endpoint
fkwp 3855617
Fix [!NOTE] syntax
Johennes be629da
Use "power level" rather than "`power_level`" to avoid ambiguity
Johennes 9c17cc6
Avoid using MUST with respect to creating MSCs per application
Johennes 29a3f30
Remove recommendation to provide widget implementations for applicati…
Johennes e3083de
Clarify that RTC member refers to m.rtc.member events
Johennes f928273
Fix number of states
Johennes 730296f
Downgrade UX description to examples
Johennes c7fcea0
Remove duplicate paragraph
Johennes 72f3c4c
Linkify
Johennes 6dd4f50
Fix property name
Johennes 73efe93
Fix bullets
Johennes d840122
Relocate slot ID grammar
Johennes 535138a
Avoid "slot name" term
Johennes 118c9db
Clarify common namespaced identifier requirements
Johennes 9852003
Clarify why we require stickyness to consider a member connected
Johennes 3ccd90b
Remove vulnerable hashing example
Johennes 8587297
Fix spelling
Johennes d597297
Clarify origin of disconnect_reason design and remove examples as the…
Johennes 37ded3e
Fix typo
Johennes e5e135a
Clarify that we're using unpadded base64
Johennes 8235365
Clarify delegation requirements
Johennes 6bc4ff0
Add unstable version flag
Johennes 6bf733f
Cross-link MSC4075
Johennes eac1005
Add .well-known alternative
Johennes 57c8cbe
Explain why we use the claimed_ prefixes
Johennes 5bcd4f0
Some clarifications around encryption
Johennes 0229f89
Move future ratcheting extension to potential issues
Johennes 0a78a66
Merge content 'Scope and Responsibilities of MatrixRTC Applications' …
Johennes a5bef33
Remove relations
Johennes 98bd92d
Blend part of the beginning of the proposal into the introduction to …
Johennes 01abcd6
Update slot description and include encryption setting
Johennes b63210a
Update membership section
Johennes 9e07f16
Fix typos
Johennes 9409b17
Clarify SHOULD'ness of disconnect_reason
Johennes 48645d4
Update sessions section
Johennes 234a4b1
Update transports section
Johennes 3c98456
Remove shared key encryption
Johennes 82f5e57
Remove delegation of delayed event management
Johennes af4c337
Update encryption section
Johennes e4f3693
Highlight that member events must be encrypted
Johennes cbab20d
Update potential issues section
Johennes 396c61b
Slightly adapt wording in key traffic discussion now that per-partici…
Johennes 164f804
Update alternatives section
Johennes 79db42b
Update security considerations and the rest
Johennes 2231bad
Fix typo
Johennes 807199f
Fix links and styling
Johennes f23d415
Add decline MSC reference
Johennes 720aeee
Shorten slot/member consideration
Johennes 98c59df
Add space
Johennes 27854d4
Remove duplicate footnote
Johennes 9bd7142
Fix typos
Johennes d1363e3
Shorten link
Johennes ae98f71
Add CNIG restriction
Johennes a58efb9
Only remove app obj
Johennes ecb695a
Remove claimed useer ID
Johennes 98aa57a
Improve wording
Johennes ff3810b
Avoid SFU ref
Johennes a7e7e35
Fix typos
Johennes b304723
Improve wording
Johennes 55d36f8
Improve wording
Johennes 8685d8d
Improve wording
Johennes d5a758c
Improve wording
Johennes 903ae32
Improve wording
Johennes a6be849
Improve wording
Johennes ebf0ee2
Improve wording
Johennes 0bc3a1d
Improve wording
Johennes dcc1e1e
Improve wording
Johennes 6786235
Improve wording
Johennes 20265cb
Improve wording
Johennes b7f8568
Add missing prefix
Johennes de35d8b
Fix typo
Johennes 8fafc5b
reason/description -> code/reason
Johennes 0a158a0
Switch to 32 bytes
Johennes adba11b
version -> format
Johennes c87b1ee
Improve wording
Johennes b98cb2f
Improve wording
Johennes 8297dcc
Add encryption requirement
Johennes 04ee51b
Small clarity and style fixes to MSC4143 (#4510)
robintown 0e7bd82
Clarify that slot participation might also require higher power levels
Johennes 272cc47
Introduce slot status and consider encryption downgrade security impact
Johennes 9d621d4
Clarify can_subscribe
Johennes 3cddce3
Shorten explanation of why membership is bounded by stickiness
Johennes 25a4a61
m.per_participant -> m.per_member
Johennes 7f1185d
Remove interoperation potential issue as it should be covered by can_…
Johennes eb8f21f
Clarify key traffic issue
Johennes cd6c615
Use uniform language for members, joining, leaving, rename disconnect…
Johennes 55bebd6
Remove note about canonical member id
Johennes 79fefa5
Fix typo
Johennes 0c5f187
Specify generic leave codes
Johennes dab1eeb
Clarify slot<>room relationship
Johennes 492e69f
Improve line wrapping
Johennes 6d5f4ea
Spell out that the `encryption` object en-/disables encryption
Johennes d45bf23
Make the required relation between application.type and state_key exp…
Johennes e127b34
Spell out that application is required for open slots
Johennes 4602646
member.id is only unique for the same user
Johennes 3e3df5a
Tighten join requirements
Johennes 2c1ed9e
Tighten leave requirements
Johennes ecd40da
Fix position of leave marker in chart
Johennes 3e265cf
Clarify that the JSON is an OlmPlaintext
Johennes 5b13400
Also mention the former name OlmPayload
Johennes d5366ab
Tighten wording around open and closed slots
Johennes cedd4a9
Add shadow sessions consideration
Johennes 0eb3656
Adapt MatrixRTC encryption to latest agreements (#4516)
Johennes 4b8c6ea
Move transport types out of MSC4143 and into MSC4519
turt2live 694b4e4
Provide an application example
robintown e830685
Describe slots more concisely
robintown 00c0b07
Provide a transport example
robintown aa2d746
Clarify why we proscribe a deterministic slot ID grammar
robintown 3236b00
Merge branch 'toger5/matrixRTC' into travis/msc4143/rtc-registry
robintown 595ef84
Fix typo
Johennes 2a45b77
Link to MSC4531 for deprecating legacy VoIP
Johennes adb8fa5
Remove transport provisioning alternatives now that transport discove…
Johennes cea5014
Clarify that m.per_member is defined in the text following
Johennes 5495f4b
Clarify that cross-signing refers to the owner
Johennes a67a217
Fix to-device message snippet
Johennes 44caf05
Move format inside of media_key object
Johennes e2a64eb
Clarify what cryptographically secure means
Johennes 98e5783
Clarify why encryption in unencrypted rooms is disallowed
Johennes 39c144d
Clarify that slots MUST be considered closed
Johennes 6b414dd
format=0 -> format=m.base64
Johennes 6c054fb
Fix typo
Johennes 95f8be6
Clarify coalescing key rotations on leaves
Johennes 3e3d084
Stress that the member ID must be unique across devices
Johennes 1e41430
Clients should store keys even if the membership event is not yet known
Johennes 59c3f98
Recommend one hour of stickyness
Johennes 0e473cb
Membership events can be redacted to kick members
Johennes d6133e4
Agreeing on transports is out of scope
Johennes c3d05cf
PRNG -> RNG + notes on why we use a transport agnostic key agreement …
Johennes 51c8dfe
livekit -> m.livekit
Johennes af59d73
Ignore unencrypted streams in encrypted slots; call out unmappable st…
Johennes db289df
Fix typo
Johennes 99bb791
m.call#ROOM -> m.call#room
Johennes c194030
Eliminate dependency on MSC4519 and move transport discovery back int…
Johennes d544107
Clarify that member IDs must be unique across rooms and slots as well
Johennes 8f8601f
Member IDs must be non-deterministic
Johennes fda56fc
Replicate slots on room upgrades
Johennes 5b86183
Changing room encrypting can invalidate existing slots
Johennes File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,150 @@ | ||
| # MSC4143: MatrixRTC | ||
|
|
||
| This MSC defines the modules with which the matrix real time system is build with. | ||
|
|
||
| The MatrixRTC specification is separated into different modules. | ||
|
|
||
| - The MatrixRTC room state that defines the state of the real time application.\ | ||
| It is the source of truth for: | ||
| - Who is part of a session | ||
| - Who is connected via what technology/backend | ||
| - Metadata per device used by other participants to decide whether the streams | ||
| from this source are of interest / need to be subscribed. | ||
| - The RTC backend. | ||
| - It defines how to connect the participating peers. | ||
| - Livekit is the standard for this as of writing. | ||
| - Defines how to connect to a server/other peers, how to update the connection, | ||
| how to subscribe to different streams... | ||
| - Another planned backend is a full mesh implementation based on MSC3401. | ||
| - The RTCSession types (application) have their own per application spec. | ||
| - Calls can be done with an application of type `m.call` see (TODO: link call msc) | ||
| - The application defines all the details of the RTC experience: | ||
| - How to interpret the metadata of the member events. | ||
| - What streams to connect to. | ||
| - What data in which format to sent over the RTC channels. | ||
|
|
||
| This MSC will focus on the matrix room state which can be seen as the most high | ||
| level signalling of a call: | ||
|
|
||
| ## Proposal | ||
|
|
||
| Each RTC session is made out of a collection of `m.rtc.member` events. | ||
| Each `m.rtc.member` event defines the application type: `application` | ||
| and a `call_id`. And is stored in a state event of type `m.rtc.member`. | ||
| The first element of the state key is the `userId` and the second the `deviceId`. | ||
| (see [this proposal for state keys](https://github.com/matrix-org/matrix-spec-proposals/pull/3757#issuecomment-2099010555) | ||
| for context about second/first state key.) | ||
|
|
||
| ### The MatrixRTC room state | ||
|
|
||
| Everything required for working MatrixRTC | ||
| (current session, sessions history, join/leave events, ...) only | ||
| require one event type. | ||
|
|
||
| A complete `m.rtc.member` state event looks like this: | ||
|
|
||
| ```json | ||
| // event type: m.rtc.member | ||
| // event key: ["@user:matrix.domain", "DEVICEID"] | ||
| { | ||
| "m.application": "m.my_session_type", | ||
| "m.call_id": "", | ||
| "focus_active": {...FOCUS_A}, | ||
| "foci_preferred": [ | ||
| {...FOCUS_1}, | ||
| {...FOCUS_2} | ||
| ] | ||
| } | ||
| ``` | ||
|
|
||
| giving us the information, that user: `@user:matrix.domain` with device `DEVICEID` | ||
| is part of an RTCSession of type `m.call` in the scope/sub-session `""` (empty | ||
| string as call id) connected over `FOCUS_A`. This is all information that is needed | ||
| for another room member to detect the running session and join it. | ||
|
|
||
| There is **no event** to represent a session. This event would include shared | ||
| information where it is not trivial to decide who has authority over it. | ||
| Instead the session is a computed value based on `m.rtc.member` events. | ||
| The list of events with the same `m.application` and `m.call_id` represent one session. | ||
| This array allows to compute fields like participant count, start time ... | ||
|
|
||
| Sending an empty `m.rtc.member` event represents a leave action. | ||
| Sending a well formatted `m.rtc.member` represents a join action. | ||
|
|
||
| Based on the value of `m.application`, the event might include additional parameters | ||
| required to provide additional session parameters. | ||
|
|
||
| > A thirdRoom like experience could include the information of an approximate position | ||
| on the map, so that clients can omit connecting to participants that are not in their | ||
| area of interest. | ||
|
|
||
| #### Historic sessions | ||
|
|
||
| Since there is no singe entry for a historic session (because of the owner ship discussion), | ||
| historic sessions need to be computed and most likely cached on the client. | ||
|
|
||
| Each state event can either mark a join or leave: | ||
|
|
||
| - join: `prev_state.m.application != current_state.m.application` && | ||
| `prev_state.m.call_id != current_state.m.call_id` && | ||
| `current_state.m.application != undefined` | ||
| (where an empty `m.rtc.member` event would imply `state.m.application == undefined`) | ||
| - leave: `prev_state.m.application != current_state.m.application` && | ||
| `prev_state.m.call_id != current_state.m.call_id` && | ||
| `current_state.m.application == undefined` | ||
|
|
||
| Based on this one can find user sessions. (The range between a join and a leave | ||
| event) of specific times. | ||
| The collection of all overlapping user sessions with the same `call_id` and | ||
| `application` define one MatrixRTC history event. | ||
|
|
||
| ### The RTC backend | ||
|
|
||
| `foci_active` and `foci_preferred` are used to communicate | ||
|
|
||
| - how a user is connected to the session (`foci_active`) | ||
| - what connection method this user knows about would like to connect with. | ||
|
|
||
| The only enforced parameter of a `foci_preferred` or `foci_active` is `type`. | ||
| Based on the focus type a different amount of parameters might be needed to, | ||
| communicate how to connect to other users. | ||
| `foci_preferred` and `foci_active` can have different parameters so that it is, | ||
| possible to use a combination of the two to figure our that everyone is connected | ||
| with each other. | ||
|
|
||
| Only users with the same type can connect in one session. If a frontend does | ||
| not support the used type they cannot connect. | ||
|
|
||
| Each focus type will get its own MSC in which the detailed procedure to get from | ||
| the foci information to working webRTC connections to the streams of all the | ||
| participants is explained. | ||
|
|
||
| - [`livekit`](www.example.com) TODO: create `livekit` focus MSC and add link here. | ||
| - [`full_mesh`](https://github.com/matrix-org/matrix-spec-proposals/pull/3401) | ||
| TODO: create `full-mesh` focus MSC based on[MSC3401](https://github.com/matrix-org/matrix-spec-proposals/pull/3401) | ||
| and add link here. | ||
|
|
||
| ### The RTCSession types (application) | ||
|
|
||
| Each session type might have its own specification in how the different streams | ||
| are interpreted and even what focus type to use. This makes this proposal extremely | ||
| flexible. A Jitsi conference could be added by introducing a new `m.application` | ||
| and a new focus type and would be MatrixRTC compatible. It would not be compatible | ||
| with applications that do not use the Jitsi focus but clients would know that there | ||
| is an ongoing session of unknown type and unknown focus and could display/represent | ||
| this in the user interface. | ||
|
|
||
| To make it easy for clients to support different RTC session types, the recommended | ||
| approach is to provide a matrix widget for each session type, so that client developers | ||
| can use the widget as the first implementation if they want to support this RTC | ||
| session type. | ||
|
|
||
| Each application should get its own MSC in which the all the additional | ||
| fields are explained and how the communication with the possible foci is | ||
| defined: | ||
|
|
||
| - [`m.call`](www.example.com) TODO: create `m.call` MSC and add link here. | ||
|
|
||
| ## Potential issues | ||
| ## Alternatives | ||
| ## Security considerations |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.