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)
  4. ๐Ÿ‘‹ Kicking Someone Out - Removing members (15 min)
  5. ๐Ÿคน The Juggler - Handling changes (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)

Phase 5: Advanced (Optional)

  1. ๐Ÿฐ The Castle Walls - Security properties (15 min)
  2. ๐Ÿ“ˆ Growing the Meeting - Scaling (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/removing members75 min
CodeReal-world implementation60 min
AdvancedSecurity, scalability30 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:

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
Understand securityCastle 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.