feature request: Implement fallback keys to improve E2EE reliability #1228

Closed
opened 2025-12-18 20:11:20 +00:00 by nex · 4 comments
Owner

Right now continuwuity only supports one-time keys, however, if a device is offline for a long time, its one time key pool may become exhausted, and further attempts to send messages to that device will result in unable-to-decrypt errors, which may end up being unrecoverable under some circumstances.

Fallback keys were added in spec v1.2, and they allow devices to continue receiving new encrypted messages even when their one time keys are exhausted, with the added risk of replay attacks. Synapse currently supports this, and I believe Tuwunel added support for them recently.

We should implement support for uploading and replacing fallback keys, as well as serving them to consumers where needed. This will likely greatly improve the reliability of encryption when people don't spend every waking moment on matrix.

Right now continuwuity only supports one-time keys, however, if a device is offline for a long time, its one time key pool may become exhausted, and further attempts to send messages to that device will result in unable-to-decrypt errors, which may end up being unrecoverable under some circumstances. [Fallback keys](https://spec.matrix.org/v1.17/client-server-api/#one-time-and-fallback-keys) were added in spec v1.2, and they allow devices to continue receiving new encrypted messages even when their one time keys are exhausted, with the added risk of replay attacks. Synapse currently supports this, and I believe Tuwunel added support for them recently. We should implement support for uploading and replacing fallback keys, as well as serving them to consumers where needed. This will likely greatly improve the reliability of encryption when people don't spend every waking moment on matrix.
nex added this to the 0.5.5 milestone 2025-12-18 20:11:20 +00:00
ginger modified the milestone from 0.5.5 to (deleted) 2026-02-15 15:10:42 +00:00
Contributor

I'm going to start working on this if no one is doing it.

I'm going to start working on this if no one is doing it.
Author
Owner

@eve We've already drawn up a plan for this and I did start on this, but haven't gotten very far. If you want to work on it, feel free - happy to share the design ideas we came up with in https://matrix.to/#/#dev:continuwuity.org if it helps at all!

@eve We've already drawn up a plan for this and I did *start* on this, but haven't gotten very far. If you want to work on it, feel free - happy to share the design ideas we came up with in https://matrix.to/#/#dev:continuwuity.org if it helps at all!
Contributor

@nex I'm happy to work on this I think, it seems interesting. For now I'm reading through the spec and code to make sure I understand everything. I'll probably come chat with you about the way to implement it before I get started on writing the code.

@nex I'm happy to work on this I think, it seems interesting. For now I'm reading through the spec and code to make sure I understand everything. I'll probably come chat with you about the way to implement it before I get started on writing the code.
Owner

Fixed by !1710.

Fixed by !1710.
Sign in to join this conversation.
No milestone
No project
No assignees
3 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
continuwuation/continuwuity#1228
No description provided.