🔐 Megolm and Olm, explained simply

Olm is for one-to-one chats. Megolm is for group chats.

That is the big idea.

Olm

Think of two kids passing folded notes in class. Only those two can read the note.

Each pair of kids has their own secret way to lock and unlock notes.

If a third kid gets the note, it looks like nonsense.

Megolm

Now think of a group of kids sharing one special notebook lock for that group.

Everyone in the group can read messages from that notebook lock.

It is faster for big groups than making a separate lock for every single pair.

Why use both

Olm helps people set up trust directly between devices.

Megolm helps the group send lots of messages quickly.

So: one is best for private 1-to-1 setup and chats, the other is best for room-wide message flow.

How the group key handoff works

One device creates a fresh group secret key.

It sends that key to each member using private one-to-one encrypted messages.

After everyone has it, the room can read new group messages.

Then the key moves forward step by step, like a one-way chain, for each new message.

If someone joins or leaves, the room should make a new group key and share it again privately.

Important safety rule

If someone new joins a group, you should change the group lock.

If someone leaves, you should also change the group lock.

This stops old members from reading future messages.