Skip to content

MSC4428: Stable identifiers for Room Members#4428

Open
kegsay wants to merge 3 commits intomainfrom
kegan/stable-ids
Open

MSC4428: Stable identifiers for Room Members#4428
kegsay wants to merge 3 commits intomainfrom
kegan/stable-ids

Conversation

@kegsay
Copy link
Copy Markdown
Member

@kegsay kegsay commented Mar 4, 2026

@ara4n ara4n added the proposal A matrix spec change proposal label Mar 4, 2026
@turt2live turt2live added requires-room-version An idea which will require a bump in room version s2s Server-to-Server API (federation) client-server Client-Server API room-spec Something to do with the room version specifications unassigned-room-version Remove this label when things get versioned. kind:core MSC which is critical to the protocol's success labels Mar 4, 2026
Copy link
Copy Markdown
Member

@turt2live turt2live Mar 4, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Implementation requirements:

@turt2live turt2live added application services needs-implementation This MSC does not have a qualifying implementation for the SCT to review. The MSC cannot enter FCP. and removed requires-room-version An idea which will require a bump in room version s2s Server-to-Server API (federation) room-spec Something to do with the room version specifications unassigned-room-version Remove this label when things get versioned. labels Mar 4, 2026
Comment on lines +105 to +109
Clients MUST use the new `unsigned.stable_id` field as the stable ID.
Clients MUST NOT use the `sender` field of events as the stable ID.
A later room version **may remove the `sender` field entirely** on events,
which would break any client relying on the `sender` field for the stable ID.
For this reason, clients MUST handle the case where the `sender` is missing (it is Optional).
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't it make more sense to sign the stable id by including it in sender and provide the mapping to the mutable part as unsigned.user_id? It would lead to trouble if the sender isn't signed so I don't see why we want to remove it.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would lead to trouble if the sender isn't signed so I don't see why we want to remove it.

I agree. I'm not proposing that we remove the event signature from sender over federation. I am suggesting that this field may change over the client-server API as per "The purpose of this MSC is primarily to introduce a Client-Server mechanism to communicate that the sender is now mutable.".

I will clarify this though since I agree it reads poorly at present.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still, I think having the stable id under unsigned seems silly and makes it look like untrusted data.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fair point, if we only add the stable ID to a new room version then it can be a top-level field.

Rather than add `unsigned.stable_id`, we could remove the `sender` and replace it with a `stable_id` field.
We would do this so in the future if clients do not implement stable IDs they would crash due to the `sender` field not existing,
rather than parsing the `sender` as a user ID when it is in fact a stable ID.
This change would be backwards incompatible (as we'd be removing `sender`) so clients would need to opt-in e.g. via a query parameter `?stable_ids=1`.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The problem with this proposal in my mind seems to stem from the fact that it is trying so hard to change the semantics of, remove or rename sender even for previous room versions while remaining backwards compatible. I don't think that's a good idea as it'll just lead to confusing behavior between clients that do support this and those that don't.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The proposed change in isolation is backwards compatible because the stable ID is the sender. If something like MSC4430 lands then yes, this would become a breaking change.

The intent is for:

  • clients to be able to become aware of stable IDs
  • any client which remains unaware of stable IDs will not see rooms that rely on stable IDs (MSC4430). This mechanism isn't fully fleshed out beyond "filter them out from the sync API".

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would still have effects on previous rooms:

  • If a user is erased, supporting clients will see an "anonymous user" while clients without support will still see the user id. Additionally, deanonymization is as simple as viewing the event source (so, pointless).
  • This also allows for changing a user's localpart with the caveat that it is still tied to their old one. Clients without stable id support wouldn't see that change either.

If this mechanism is reserved for rooms with MSC4430 or another proposal that depends on this instead, there would be no disagreements.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right, I see your point now.

The rationale for adding backwards compat for earlier room versions is:

  • it allows erasure to be expressed in existing room versions (even if it is imperfect)
  • it makes it easier for clients to implement support as they can use any room and /deactivate a user.

I'm not sure these reasons are strong enough to justify the risk of clients disagreeing on the sender of an event in existing rooms. If erasure wasn't trivial to circumvent that would help, but it isn't.

Maybe it would be better to only apply this on a new room version then,

Comment on lines +142 to +145
We could repurpose the `sender` field as the stable ID. This is backwards compatible.
However, this changes the data type depending on the room version: the `sender` is either a User ID *or* a Stable ID (public key).
This is particularly concerning for stable ID aware clients, as in order for them to know how to
parse the `sender` field they either need to figure out the room version (which is fragile as it needs to be kept updated)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is preferable. We have room versions for a reason.
We shouldn't expect clients to be able to fully participate in room versions that they haven't been updated to support.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Room versions primarily exist for servers, not clients.

That being said, it's not a particularly strong arguement because it's a leaky abstraction e.g. clients have to implement the redaction algorithm to know how to process redaction events, they need to know if the room supports creator power levels.

I agree that the lack of a strong way to express room version support in clients does cause friction. I don't think this is the MSC to fix it though. If such a mechanism existed already though, I would use it in this MSC.

I think some resistance also comes from the fact that out of the 12 room versions we have today, only a small subset of them actually required client changes. This means you could be prevented from participating in a room simply because the client author did not add an extra number to the allowed room versions array.

@Saiv46
Copy link
Copy Markdown

Saiv46 commented Mar 14, 2026

Great proposal as a stepping stone towards homeserver mobility and ephemeral user IDs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

client-server Client-Server API kind:core MSC which is critical to the protocol's success needs-implementation This MSC does not have a qualifying implementation for the SCT to review. The MSC cannot enter FCP. proposal A matrix spec change proposal

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants