🛡️ 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)
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)
🧠 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 members, messaging | 45 min |
| Code | Real-world implementation | 60 min |
Total: ~240 minutes (4 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 |
📓 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.