feat: introduce keyupdate message to inform contacts about relay changes - #8601
Open
hpk42 wants to merge 1 commit into
Open
feat: introduce keyupdate message to inform contacts about relay changes#8601hpk42 wants to merge 1 commit into
hpk42 wants to merge 1 commit into
Conversation
hpk42
force-pushed
the
hpk/broadcast-key-updates
branch
2 times, most recently
from
August 16, 2026 20:18
a4c6195 to
337c787
Compare
When the published relay list changes, a symmetrically encrypted keyupdate message carries the re-signed key, and is broadcast to all non-blocked key-contacts from accepted chats. The encryption secret is derived from the public primary key packet, so every holder of a copy of that key can decrypt, forever. For more details see src/keyupdate.rs module docs.
hpk42
force-pushed
the
hpk/broadcast-key-updates
branch
from
August 16, 2026 20:56
337c787 to
a31f144
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Introduces keyupdate messages: when the published relay list changes, a symmetrically encrypted message carries the re-signed key to non-blocked key-contacts from accepted chats.
Wire format, audience and sending policy:
src/keyupdate.rsmodule docs.For full background and motivation, see https://github.com/chatmail/core/blob/hpk/draft-keyupdates/draft/keyupdate-draft.md as discussed in #8595.
You can use the following SQL statement to check the number of contacts versus keyupdate recipients as selected by this PR:
For some profiles I have access to, some real-world data on keyupdate recipient sizes:
Even for the oldest profile, reaching ~2000 key contacts can re-establish chat connectivity that is currently broken (the "mutual silence" case), so it's not clear that constraining the recipient set further would be worth the loss. Most likely there will be a lot of failure DSNs that we currently don't do much with, but that's arguably a general problem for all other chat messages, too.
Known problem: old contacts who uninstalled Delta Chat but still read the mailbox with another client
Key-contacts who once used Delta Chat on a classic email provider and later uninstalled might receive keyupdates as undecryptable mail in a mailbox they still read (given the keyupdate passes the spam filter). They have no way to opt out, and we get no signal either, because their provider may accept the mail, without failure DSNs. With relay changes currently being rare manual acts, this probably stays below the noise that group messages or other randomly arriving spam can already cause for such contacts. But it might become a real annoyance with frequent relay changes: automatic relay management should be careful to ship without rate-limiting keyupdates in some way. Note, however, that this whole problem usually only exists for old profiles, and then only for their contacts who uninstalled Delta Chat and continue to use the mailbox with another client, so we should be careful not to optimize for this particular case at the expense of helping "mutually silent" contacts, or peers with otherwise de-synchronized relay knowledge about each other, to re-establish chat connectivity so message sending will succeed afterwards.