Matrix: a new specification for federated realtime chat
Matrix: a new specification for federated realtime chat
Posted Feb 12, 2015 13:43 UTC (Thu) by Arathorn (guest, #101018)Parent article: Matrix: a new specification for federated realtime chat
Wow, thanks for writing all this! We (the Matrix team) are rather flattered/scared that LWN thinks it's worth writing about :)
Just to answer a few of the implicit questions in the article and clear up some of the places where the matrix.org spec and website is a bit stale or misleading:
The synapse repository also includes two demo clients: one that runs as a web application, and one command-line client written in Python. The most recent release is version 0.6.1f, from February 10.
The website is stale on this (sorry). We actually have 3 main reference clients - AngularJS (http://matrix.org/beta and http://github.com/matrix-org/matrix-angular-sdk), Android (http://github.com/matrix-org/matrix-android-sdk) and iOS (https://github.com/matrix-org/matrix-ios-sdk). The python commandline one in the synapse project just an HTTP/JSON console for debugging. (There are also other Perl and Python alpha commandline clients - come talk on #matrix:matrix.org if you want to experiment with them).
Also, we just released 0.7.0 a few hours ago, which has *huge* federation performance improvements over 0.6.x.
Second, users that want to connect to a persistent room need only remember the alias to join—if the original server is restarted, the room identifier might change, but the alias can remain the same.Actually, the underlying opaque room ID can never change; it is shared across all the participating servers. For instance, #matrix:matrix.org is an alias to !cURbafjkfsMDVwdRDQ:matrix.org room ID (affectionately called curbaf to its friends ;). Servers can restart, and join and part from the room, but the room ID lives on. The only time a room could ever change is if a server lost all of its state (and its private key) and created a new room, and advertised an alias of it under the same name. If this happens, it doesn't impact the original room - it just means that another server will have to publish an alias to make it easier to find the original room (e.g. create a #matrix:therealmatrix.org which points to !cURbafjkfsMDVwdRDQ:matrix.org in this example).
Interestingly enough, the specification also advertises a way for users to publicly link a Matrix user ID to a "third-party identifier" (3PID), such as an email address or phone number. To do this, the Matrix network would support a global, federated network of identity servers that maintains the links between accounts and 3PIDs. The goal would seem to be making it simpler to invite another user to join a chat. Unfortunately, the relevant section of the Matrix specification is still empty (marked with "This section is a work in progress.").The reason this is WIP is that it's in flux currently. We run a cluster of ID servers (using the sydent project in github) pointed to by matrix.org which work fine and are stable (hence lack of activity on the project), but logically they act as a single entity. They track email->matrix ID mappings (if you sign up with an email address). We want to fix this and make it properly federated ID system supporting multiple 3PIDs (MSISDNs, etc), but we're not there yet (and we want to borrow an existing federated ID system if we can, rather than re-inventing the wheel). Obviously we don't want this to be a SPOF - and the 3PID system is a strictly optional extra anyway.
...
The sydent server referenced is another GitHub repository, albeit one that has not been touched in five months.
The traffic on the wire is protected by TLS, but that does not prevent unwanted users from joining what is meant to be a private discussion room. Users who wish to restrict access to a room must rely on Matrix's room-management API: room moderators can kick out users or ban them (by user ID), but little else. Furthermore, although TLS encrypts the messages between servers, the servers themselves have access to the message content. Several spots in the specification and on the Matrix site as a whole make reference to optional end-to-end encryption (where only the users could decrypt the contents of messages), but this appears to be another unfinished component at present.
Crypto and ACLs are slightly different problems. Currently the client-server API allows both HTTP and HTTPS traffic (to support constrained devices which can't speak HTTPS, at the expense of any security/privacy whatsoever). The server-server API mandates TLS, and also signs the transactions (to protect against identity spoofing) and the history (git-style, to protect against tampering). However none of the payloads themselves are encrypted (yet) unless you do so at the application layer.
We do have good support for decentralised ACLs however - we absolutely stop unwanted users from joining private discussions, by supporting invite semantics, and decentralised ACLs where users must quote the historical events that prove that they have permission to join a room (or do some privileged action in the room). This is all relatively mature now, but is a very seperate problem from encrypted messaging.
The story on end-to-end encryption is that we've simply not specified it yet - but we'll heavily encourage people to use it once it exists. The intention is to borrow something like Axolotl (modulo its PFS characteristics).
Anyway, thanks again for writing about us. And LWN readers: please try installing a server and federating up, and come hang out in #matrix:matrix.org; tell us what you think and help us make it better!
