Skip to main content

🛡️ MLS for Beginners

Welcome to the Secret Meeting Room Tutorial

Goal: Learn how MLS protects your group chats from hackers
Prerequisite: Basic curiosity (no math yet)


🎯 Quick Start Guide

✋ Complete Beginner? Start Here

Show Me the Path (Click to Expand)

Phase 1: Foundations (~45 min total)

  1. 🗣️ The Whisper Game - Why group messaging is hard (10 min)
  2. 🎖️ The Three Rules - Security rules (10 min)
  3. 🌳 The Tree of Secret Keys - Ratchet trees (10 min)

Phase 2: Core Concepts (~50 min total)

  1. Time Traveling Messages - Epochs (10 min)
  2. 🔄 Changing the Lock - Key rotation (10 min)
  3. 🗳️ Voting on Changes - Proposals & commits (10 min)
  4. 🎟️ The VIP Ticket - Welcome messages (10 min)

Phase 3: How MLS Works (~75 min total)

  1. 🏗️ Starting the Meeting - Creating groups (15 min)
  2. Inviting Guests - Adding members (15 min)
  3. 📝 Passing Notes - Sending messages (15 min)

Phase 4: Practical Implementation (~60 min total)

  1. 🚀 Getting Started - Setup (15 min)
  2. 🔧 Managing the Room - Group ops (15 min)
  3. 📨 Sending and Receiving - Messages (15 min)

🧠 Want to Understand the Math?

Foundations (recommended order):

ChapterConceptMental Model
The Whisper GameGroup problemWhisper chain
The Three RulesSecurityThree locks
The Tree of Secret KeysRatchet treeFamily tree

Core Concepts:

ChapterConceptMetaphor
Time Traveling MessagesEpochsEras/versions
Changing the LockKey rotationLocksmith
Voting on ChangesProposals/commitsVoting system
The VIP TicketWelcome messagesInvitation tickets

💻 Just Want to Code?

Jump straight to: Getting Started (15 min)


🚀 Quick Overview (30 min)

  1. Introduction - Big picture (10 min)
  2. The Tree of Secret Keys - Ratchet trees (10 min)
  3. Passing Notes - Messaging (10 min)

📚 What You'll Learn

PhaseWhat It CoversTime
IntroductionWhy MLS matters for groups10 min
FoundationsGroup problems, security rules, ratchet trees45 min
Core ConceptsEpochs, rotation, proposals, welcomes50 min
How MLS WorksCreating groups, adding members, messaging45 min
CodeReal-world implementation60 min

Total: ~240 minutes (4 hours) for complete tutorial (or 30 min for quick overview)


🎭 Meet the Characters

Throughout this tutorial, you'll meet:

CharacterRoleWhat They Do
AliceGroup CreatorStarts the meeting, invites people
BobMember 1Joins groups, sends messages
CharlieMember 2Another participant
DavidMember 3Another participant
EveAttackerTries to spy on the group
SamServerDelivers messages (not trusted)

🎬 Quick Preview: The Secret Meeting Room Metaphor

Old Way (Signal Protocol):

  • Great for 2-person chats
  • 🚫 What about groups of 3, 4, or 100 people?

New Way (MLS - Group Messaging ):

  • Alice creates a "Secret Meeting Room"
  • Sends VIP tickets to Bob, Charlie, David
  • Everyone enters the room
  • Now they can whisper in private
  • When someone leaves, the room locks change

⚡ Why This Tutorial is Different

Traditional TutorialThis Tutorial
❌ Starts with complex math✅ Starts with simple stories
❌ Uses jargon immediately✅ Explains terms as needed
❌ Assumes crypto background✅ Teaches from scratch
❌ Dry, academic tone✅ Conversational, fun
❌ Static text only✅ Interactive demos, quizzes

📖 Before We Start: 3 Questions

1️⃣ What is MLS Anyway?

MLS stands for Messaging Layer Security

Let's break that down:

PieceMeaningSimple Explanation
MLSMessaging Layer SecuritySecurity for group messaging

Simple definition: MLS is a protocol that lets a group of people (2 to thousands) have end-to-end encrypted conversations where:

  • Everyone can send/receive messages securely
  • New people can join anytime
  • People can leave and the room locks change
  • Past messages stay secret forever
  • Future messages stay secret even if someone's phone gets hacked

2️⃣ How is MLS Different from Signal?

FeatureSignal ProtocolMLS
Best for2-person chatsGroups (2-1000+ people)
StructureDouble ratchet (2 people)Ratchet tree (everyone)
Key sharingX3DH handshakeWelcome messages
ScalabilityO(1) to add personO(log n) to add person
Mental ModelPhone booth with two peopleSecret meeting room

3️⃣ Real Examples: Who Uses MLS?

ApplicationUsageStatus
Android MessagesGoogle's SMS appPlanning MLS
Cisco WebexVideo conferencingAlready using MLS
RingCentralBusiness communicationsUsing MLS
FirefoxBrowser messagingPlanning MLS

Think of it: MLS is becoming the standard for secure group messaging


🎯 Where Should You Start?

If You're Curious but Want the Big Picture First

Start with → Introduction

If You Want to Understand Everything Deeply

Read in order → Start with The Whisper Game

If You Just Want to Use It in Your Code

Jump to → Getting Started


📞 Quick Reference

You Want to...Go To...
Understand what MLS isIntroduction
Learn mental modelsFoundations
See ratchet treesTree of Secret Keys
Understand epochsTime Traveling Messages
Try code examplesGetting Started

📓 Learning Checklist

When you finish, you'll be able to:

  • Explain why group messaging encryption is hard
  • Describe the ratchet tree mental model
  • Understand forward secrecy and post-compromise security
  • Explain how MLS uses epochs
  • Code a simple MLS group chat
  • Know how MLS scales to thousands

🌟 Ready to Begin?

Choose your path:

🎯 Complete Learning Path

→ Start with The Whisper Game

🚀 Quick Overview

→ Start with Introduction

💻 Code First, Theory Later

→ Start with Getting Started


🎉 Let's Make This Fun

Throughout the tutorial, you'll see:

  • 🧠 Mental Models: Simple pictures to hold in your head
  • 🎭 Stories: Alice, Bob, Charlie scenarios
  • 🎮 Interactive: Try it yourself (expandable answers)
  • Quizzes: Check your understanding
  • 📊 Visuals: Diagrams and tables
  • 🎯 Clear goals: Each chapter has objectives

Note: This tutorial is based on RFC 9420, the official standard for MLS. For the full technical specification, see the RFC 9420 documentation.