More Instant Messaging Interoperability (MIMI)
https://datatracker.ietf.org/doc/draft-barnes-mimi-arch/
The architecture document describes a federated system (with clients and servers), so it is a good starting point for designing E2EE in Fediverse. The architecture also seems to be compatible with FEP-e61.
MIMI specifies its own message format, which we probably don't need because we already have one. However, it might be a good idea to copy some parts