MLS: one standard for group chats
MLS (Messaging Layer Security) is the internet standard for encrypted group chat, published by the Internet Engineering Task Force (IETF) as RFC 9420 in 2023. Socketchat uses it through OpenMLS, an open-source Rust implementation of MLS. In plain words:- Everyone in a room shares a set of keys that only members hold. A sender locks a message once, and the server copies the sealed message to every member.
- Keys change when the room changes. Each time someone joins or leaves, MLS moves the room to new keys. Someone who leaves cannot read what comes after, and someone who joins cannot read what came before.
- Keys refresh over time. Each app also refreshes its own keys in a room when they are more than a week old, so an old key stops opening new messages.
- Changes are signed. Every change to who is in a room carries the signature of the member who made it. Apps check those signatures, so the server cannot add someone on its own.