๐ก๏ธ 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)
- ๐ฃ๏ธ The Whisper Game - Why group messaging is hard (10 min)
- ๐๏ธ The Three Rules - Security rules (10 min)
- ๐ณ The Tree of Secret Keys - Ratchet trees (10 min)
Phase 2: Core Concepts (~50 min total)
- โฐ Time Traveling Messages - Epochs (10 min)
- ๐ Changing the Lock - Key rotation (10 min)
- ๐ณ๏ธ Voting on Changes - Proposals & commits (10 min)
- ๐๏ธ The VIP Ticket - Welcome messages (10 min)
Phase 3: How MLS Works (~75 min total)
- ๐๏ธ Starting the Meeting - Creating groups (15 min)
- โ Inviting Guests - Adding members (15 min)
- ๐ Passing Notes - Sending messages (15 min)
- ๐ Kicking Someone Out - Removing members (15 min)
- ๐คน The Juggler - Handling changes (15 min)
Phase 4: Practical Implementation (~60 min total)
- ๐ Getting Started - Setup (15 min)
- ๐ง Managing the Room - Group ops (15 min)
- ๐จ Sending and Receiving - Messages (15 min)
Phase 5: Advanced (Optional)
- ๐ฐ The Castle Walls - Security properties (15 min)
- ๐ Growing the Meeting - Scaling (15 min)
๐ง Want to Understand the Math?โ
Foundations (recommended order):
| Chapter | Concept | Mental Model |
|---|---|---|
| The Whisper Game | Group problem | Whisper chain |
| The Three Rules | Security | Three locks |
| The Tree of Secret Keys | Ratchet tree | Family tree |
Core Concepts:
| Chapter | Concept | Metaphor |
|---|---|---|
| Time Traveling Messages | Epochs | Eras/versions |
| Changing the Lock | Key rotation | Locksmith |
| Voting on Changes | Proposals/commits | Voting system |
| The VIP Ticket | Welcome messages | Invitation tickets |
๐ป Just Want to Code?โ
Jump straight to: Getting Started (15 min)
๐ Quick Overview (30 min)โ
- Introduction - Big picture (10 min)
- The Tree of Secret Keys - Ratchet trees (10 min)
- Passing Notes - Messaging (10 min)
๐ What You'll Learnโ
| Phase | What It Covers | Time |
|---|---|---|
| Introduction | Why MLS matters for groups | 10 min |
| Foundations | Group problems, security rules, ratchet trees | 45 min |
| Core Concepts | Epochs, rotation, proposals, welcomes | 50 min |
| How MLS Works | Creating groups, adding/removing members | 75 min |
| Code | Real-world implementation | 60 min |
| Advanced | Security, scalability | 30 min |
Total: ~270 minutes (4.5 hours) for complete tutorial (or 30 min for quick overview)
๐ญ Meet the Charactersโ
Throughout this tutorial, you'll meet:
| Character | Role | What They Do |
|---|---|---|
| Alice | Group Creator | Starts the meeting, invites people |
| Bob | Member 1 | Joins groups, sends messages |
| Charlie | Member 2 | Another participant |
| David | Member 3 | Another participant |
| Eve | Attacker | Tries to spy on the group |
| Sam | Server | Delivers 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 Tutorial | This 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:
| Piece | Meaning | Simple Explanation |
|---|---|---|
| MLS | Messaging Layer Security | Security 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?โ
| Feature | Signal Protocol | MLS |
|---|---|---|
| Best for | 2-person chats | Groups (2-1000+ people) |
| Structure | Double ratchet (2 people) | Ratchet tree (everyone) |
| Key sharing | X3DH handshake | Welcome messages |
| Scalability | O(1) to add person | O(log n) to add person |
| Mental Model | Phone booth with two people | Secret meeting room |
3๏ธโฃ Real Examples: Who Uses MLS?โ
| Application | Usage | Status |
|---|---|---|
| Android Messages | Google's SMS app | Planning MLS |
| Cisco Webex | Video conferencing | Already using MLS |
| RingCentral | Business communications | Using MLS |
| Firefox | Browser messaging | Planning 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 is | Introduction |
| Learn mental models | Foundations |
| See ratchet trees | Tree of Secret Keys |
| Understand epochs | Time Traveling Messages |
| Try code examples | Getting Started |
| Understand security | Castle Walls |
๐ 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.