Skip to content

MSC4225: Specification of an order in which one-time-keys should be issued #4225

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Dec 9, 2024

Conversation

richvdh
Copy link
Member

@richvdh richvdh commented Nov 6, 2024

@richvdh richvdh changed the title MSC4225: Specification of an order in which one-time-keys should be issued WIP: MSC4225: Specification of an order in which one-time-keys should be issued Nov 6, 2024
@turt2live turt2live added e2e proposal A matrix spec change proposal 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. labels Nov 7, 2024
@richvdh richvdh marked this pull request as ready for review November 7, 2024 13:25
@richvdh richvdh removed the needs-implementation This MSC does not have a qualifying implementation for the SCT to review. The MSC cannot enter FCP. label Nov 7, 2024
@richvdh richvdh changed the title WIP: MSC4225: Specification of an order in which one-time-keys should be issued MSC4225: Specification of an order in which one-time-keys should be issued Nov 7, 2024
Copy link
Member

@turt2live turt2live left a comment

Choose a reason for hiding this comment

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

only briefly read the MSC, but seems sane at the core

@turt2live turt2live added the matrix-2.0 Required for Matrix 2.0 label Nov 18, 2024
@turt2live
Copy link
Member

@mscbot fcp merge

@mscbot
Copy link
Collaborator

mscbot commented Nov 18, 2024

Team member @turt2live has proposed to merge this. The next step is review by the rest of the tagged people:

Once at least 75% of reviewers approve (and there are no outstanding concerns), this will enter its final comment period. If you spot a major issue that hasn't been raised at any point in this process, please speak up!

See this document for information about what commands tagged team members can give me.

@mscbot mscbot added proposed-final-comment-period Currently awaiting signoff of a majority of team members in order to enter the final comment period. disposition-merge labels Nov 18, 2024
possible for a to-device message to be delayed so long that the recipient has
discarded the private part of the one-time key. It is, however, a significant
improvement. A possible future solution is for clients that expect to be used
in conditions of poor connectivity to keep old OTKs for longer.
Copy link
Member

Choose a reason for hiding this comment

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

AIUI there's almost always going to be situations where the client receives a to-device message using an OTK it no longer has. Is there any mechanism to handle this situation, e.g. a reply asking the sender to retry?

Copy link
Member Author

Choose a reason for hiding this comment

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

Not at the moment. We've had thoughts about that sort of thing. TBH though, I think it's pretty unlikely to happen once we fix the ordering problem, unless the sender literally goes offline for a year just after claiming the OTK.

2. [MSC4162](https://github.com/matrix-org/matrix-spec-proposals/pull/4162)
proposes a mechanism by which a client can inform the server that it is
discarding certain OTKs, so that the server can also remove the public
keys. This seems a heavier-weight solution to the problem.
Copy link
Member

Choose a reason for hiding this comment

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

Sort of wondering whether clients should replace all OTKs on the server at once, rather than appending new ones to the list? That way whenever the client replaces all the OTKs its easier to then say "we can discard the previous batch of OTK private keys in N days".

Just an ideal non-blocking thought.

Copy link
Member Author

Choose a reason for hiding this comment

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

erm... not really following how that would work/help.

Copy link
Member

Choose a reason for hiding this comment

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

This is the kind of idea I was toying with in my discussion: replacing the whole lot every time would have the effect of removing any keys that the device had deleted from the server. It's probably a similar conclusion to that conversation.

This presents a problem: there is a limit to the number of private one-time
keys that a client can retain. Over time, as keys are repeatedly claimed,
replaced with newly-generated keys, but not actually used, the client must
start to discard older keys.
Copy link
Member

Choose a reason for hiding this comment

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

OOI how long do clients typically retain these keys?

Copy link
Member Author

Choose a reason for hiding this comment

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

libolm kept 100. Vodozemac keeps 5000.

@mscbot
Copy link
Collaborator

mscbot commented Nov 28, 2024

🔔 This is now entering its final comment period, as per the review above. 🔔

@mscbot mscbot added final-comment-period This MSC has entered a final comment period in interest to approval, postpone, or delete in 5 days. and removed proposed-final-comment-period Currently awaiting signoff of a majority of team members in order to enter the final comment period. labels Nov 28, 2024
@ara4n
Copy link
Member

ara4n commented Nov 28, 2024

Let the record show that i was having a slight wobble over some dim memory of whether there was some impact on deniability by being able to predict the order that OTKs are consumed. Looks like there isn't, but for posterity, the raw discussion was:

Screenshot 2024-11-28 at 14 03 40

@mscbot
Copy link
Collaborator

mscbot commented Dec 3, 2024

The final comment period, with a disposition to merge, as per the review above, is now complete.

@mscbot mscbot added finished-final-comment-period and removed disposition-merge final-comment-period This MSC has entered a final comment period in interest to approval, postpone, or delete in 5 days. labels Dec 3, 2024
@turt2live turt2live merged commit 5370f48 into main Dec 9, 2024
1 check passed
@turt2live
Copy link
Member

Spec PR: matrix-org/matrix-spec#2029

@turt2live turt2live added spec-pr-in-review A proposal which has been PR'd against the spec and is in review and removed finished-final-comment-period labels Dec 9, 2024
@richvdh richvdh added merged A proposal whose PR has merged into the spec! and removed spec-pr-in-review A proposal which has been PR'd against the spec and is in review labels Dec 12, 2024
@richvdh
Copy link
Member Author

richvdh commented Dec 12, 2024

merged!

S7evinK added a commit to element-hq/dendrite that referenced this pull request Dec 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
e2e kind:core MSC which is critical to the protocol's success matrix-2.0 Required for Matrix 2.0 merged A proposal whose PR has merged into the spec! proposal A matrix spec change proposal
Projects
Status: Done to some definition
Development

Successfully merging this pull request may close these issues.

6 participants