Matrix 2.0 — Matthew Hodgson talks about Rust in Element client, Rust SDK, IETF MLS, MIMI and more

79 points Bassfaceapollo

Was listening in on Matthew Hodgson's talk about Matrix 2.0 (marketing term for improvements). Found it interesting how the Matrix Foundation has added Rust to their tech stack. This is merely an overview post, so I'd recommend that people checkout the video when they have some time.

​

Disclaimer:

I am neither related to the Matrix Foundation, nor am I a dev working on a Matrix related project. I am just a guy who reads up on technology.

​

What is the Matrix Protocol?

A federated real-time communication protocol with focus on End-to-End Encryption (E2EE).

​

How is the Matrix Foundation using Rust?

Now, the Matrix Foundation has decided to use Rust to improve bits and pieces of their Gen 1 Home Server - Synapse. The server itself is still largely in Python though. That being said, some of the improvements to the performance of Synapse based home servers can partly be attributed to the usage of Rust.

Another important piece of the ecosystem for which Rust was used is the SDK. This new SDK was used to write the newest mobile client - Element X. The current Element client will also see its cryptography implementation being changed from Javascript to Rust, this was also made possible by the new Rust based SDK.

Until now, Rust was only present in the Matrix ecosystem thanks to contributions by third-parties in the form of Conduit and Fractal. So this is pretty rad. Amongst these two, Conduit is the most important project imo. It's a Matrix home server, written from scratch in Rust.

​

What are IETF MLS and MIMI?

Messaging Layer Security (MLS) and More Instant Messaging Interoperability (MIMI) are two IETF workgroups that focus on defining standards for E2EE group chats and secure interoperable communication respectively. The Matrix Foundation is involved in both these workgroups, they seem to have found success with implementing MLS in distributed environments, which is a great news imo.

​

Other Stuff:

I merely skimmed the parts that are relevant to Rust & Matrix's core functionality (MLS, MIMI) in this post. There's more cool stuff that I didn't mention like -

  1. Third Room, which is basically a virtual reality space built using C that leverages Matrix and runs natively in your browser through WASM. I'd recommend anyone that is interested to checkout the video for more details. It's an interesting presentation.
  2. Pinecone, which is an experimental overlay routing protocol used by P2P Matrix. It and Dendrite are extremely important to P2P Matrix.

​

Supporting Matrix:

As Matthew said at the end of the presentation, please do consider donating to the Matrix Foundation if you have leveraged their technology or their services. You can find links to Donorbox, Liberapay and Patreon, along with BTC/ETH addresses on their homepage.

​

Closing:

2023 has only begun and we already have cool stuff being built using Rust.

Not to mention in 2022, we saw Cloudflare replacing NGINX with Pingora, a new Rust based solution written from scratch. Hopefully they open source it in 2023. 人・ω・)

Wonder what else we see getting written in Rust.