XEP-xxxx: End-to-End Encrypted Contacts Metadata

Abstract
This specification describes how to encrypt contacts metadata to minimize server exposure.
Author
Jérôme Poisson
Copyright
© 2026 – 2026 XMPP Standards Foundation. SEE LEGAL NOTICES.
Status

ProtoXEP

WARNING: This document has not yet been accepted for consideration or approved in any official manner by the XMPP Standards Foundation, and this document is not yet an XMPP Extension Protocol (XEP). If this document is accepted as a XEP by the XMPP Council, it will be published at <https://xmpp.org/extensions/> and announced on the <standards@xmpp.org> mailing list.
Type
Standards Track
Version
0.0.1 (2026-01-11)
Document Lifecycle
  1. Experimental
  2. Proposed
  3. Stable
  4. Final

1. Introduction

Roster is a central component of the XMPP specifications, serving as the mechanism for indicating to the server and other devices who we know, along with associated metadata and presence permission data. While convenient, this information carries significant privacy implications. In the context of ongoing efforts to reduce metadata exposure in XMPP, this document specifies a method for managing contact data in a more privacy-respectful way by using end-to-end encryption, while retaining the original roster mechanism described in RFC 6121 [1] for server-required features and backward compatibility.

2. Requirements

The design goals of this XEP are:

3. Design Decisions

A few words to explain the design decisions. There are basically two ways to encrypt contact metadata:

  1. By using the existing roster mechanism, adding a new element to handle metadata, and implementing end-to-end encryption for this element.
  2. By implementing another metadata mechanism, exploiting other XMPP mechanisms. Publish-Subscribe (XEP-0060) [2] is the most suitable one for this use case.

Option 2 has been chosen for the following reasons:

4. Service and Well-Known Nodes

Encrypted contacts use two well-known nodes:

These nodes MUST be set on the Personal Eventing Protocol (XEP-0163) [5] service (except in serverless configurations, where they MAY be set on another relevant pubsub service, see Business Rules), and MUST follow Best Practices for Persistent Storage of Private Data via Publish-Subscribe (XEP-0223) [6]. The IDs used for the pubsub items MUST NOT have any semantic meaning, and in particular MUST NOT be derived from any contact-related data.

Both node items MUST be end-to-end encrypted. The currently recommended method is using OpenPGP for XMPP Pubsub (XEP-0473) [4] as OX is well adapted for this use case. However, another encryption method MAY be used in the future if proven better.

4.1 Contacts Node

Contact metadata are stored on the 'urn:xmpp:contacts' node. Each published item MUST have either a <contact/> element qualified by the 'urn:xmpp:contacts:0' namespace or a <reserved/> element qualitifed by the 'urn:xmpp:contacts:0' namespace (see below).

The <contact/> element MAY have a 'name' attribute to specify the "handle" to be associated with the contact, in the same way as for roster items as described in RFC 6121 [1] §2.1.2.4.

The <contact/> element may have the following child elements:

4.1.1 identity

The <contact/> MUST have a way to identify the contact, by having one or more <identity/> elements qualified by the 'urn:xmpp:contacts:0' namespace. This element MUST have a 'type' attribute. The 'type' attribute can have the value "jid" when the contact is identified by its bare JID; in that case, its content is the bare JID of the contact. Future specifications may propose other <identity/> types to identify contacts by other means (e.g., cryptographic fingerprint).

4.1.2 group

In a similar way as for RFC 6121 [1] roster, zero, one, or more groups may be associated with a contact. However, groups use IDs and are defined in the separate node 'urn:xmpp:contacts-groups'. This allows group names or other metadata to be modified without having to change all references to this group.

A group is specified by the <group/> element, which MUST have an 'id' attribute set to the ID of the desired group. This ID is associated with group metadata in the 'urn:xmpp:contacts-groups' node.

4.1.3 Contacts Example

Romeo adds Juliet to his contacts:

Example 1. Setting a Contact Item
<iq type='set'
  from='romeo@example.net/orchard'
  to='romeo@example.net'
  id='contact1'>
  <pubsub xmlns='http://jabber.org/protocol/pubsub'>
    <publish node='urn:xmpp:contacts'>
      <item id='a1b2c3d4'>
        <contact xmlns='urn:xmpp:contacts:0' name='Juliet Capulet'>
          <identity type='jid'>juliet@example.org</identity>
          <group id='grp-789'/>
          <group id='grp-123'/>
        </contact>
      </item>
    </publish>
  </pubsub>
</iq>

Note: the example is in clear here, but in real use cases it is end-to-end encrypted.

4.2 Groups Node

Group metadata are stored on the 'urn:xmpp:contacts-groups' node. Each published item MUST have either a <group/> element qualified by the 'urn:xmpp:contacts:0' namespace or a <reserved/> element qualitifed by the 'urn:xmpp:contacts:0' namespace (see below).

The <group/> element MUST have an 'id' attribute set to a unique value. This ID defines the group identity and MUST NOT change as long as the group is not deleted.

The <group/> element MUST have a 'name' attribute to specify the "handle" to be associated with the group. This name MAY be changed in an existing group.

The <group/> element may have the following child element:

4.2.1 description

An optional <description/> element may be used to describe the group.

4.2.2 Groups Example

Romeo adds the groups where he places Juliet:

Example 2. Setting Group Items
<iq type='set'
  from='romeo@example.net/orchard'
  to='romeo@example.net'
  id='group1'>
  <pubsub xmlns='http://jabber.org/protocol/pubsub'>
    <publish node='urn:xmpp:contacts-groups'>
      <item id='grp-789'>
        <group xmlns='urn:xmpp:contacts:0' id='grp-789' name='Friends'/>
      </item>
      <item id='grp-123'>
        <group xmlns='urn:xmpp:contacts:0' id='grp-123' name='House of Capulet'/>
      </item>
    </publish>
  </pubsub>
</iq>

Note: the example is in clear here, but in real use cases it is end-to-end encrypted.

4.3 Reserved Element

Since contact and group metadata are stored one per pubsub item, the number of items may reveal the size of the contact list. To mitigate this, clients MAY publish additional items without actual data, which should be ignored by other clients. This prevents the server from precisely determining the number of contacts or groups by simply counting encrypted pubsub items.

For either the contacts or groups node, a client MAY publish an item containing only a <reserved/> element qualified by the 'urn:xmpp:contacts:0' namespace. A client may publish as many such items as desired, replace an existing <contact/> or <group/> element with a reserved one, or vice versa.

4.3.1 Reserved Example

Romeo wants to hide the size of his contact list by publishing reserved items:

Example 3. Setting Reserved Items
<iq type='set'
  from='romeo@example.net/orchard'
  to='romeo@example.net'
  id='reserved1'>
  <pubsub xmlns='http://jabber.org/protocol/pubsub'>
    <publish node='urn:xmpp:contacts'>
      <item id='a1b2c3d5'>
        <reserved xmlns='urn:xmpp:contacts:0'/>
      </item>
    </publish>
  </pubsub>
</iq>

Note: the example is in clear here, but in real use cases it is end-to-end encrypted.

5. Business Rules

6. Discovering Support

If a client supports encrypted contacts, it MUST advertise it by including the "urn:xmpp:contacts:0" discovery feature in response to a Service Discovery (XEP-0030) [7] information request:

Example 4. Service Discovery information request
<iq type='get'
    from='juliet@example.org/balcony'
    to='romeo@montague.lit/orchard'
    id='disco1'>
  <query xmlns='http://jabber.org/protocol/disco#info'/>
</iq>
Example 5. Service Discovery information response
<iq type='result'
    from='romeo@montague.lit/orchard'
    to='juliet@example.org/balcony'
    id='disco1'>
  <query xmlns='http://jabber.org/protocol/disco#info'>
    ...
    <feature var='urn:xmpp:contacts:0'/>
    ...
  </query>
</iq>

7. Security Considerations

The security consideration of used XEPs apply here and must be carrefully checked, in paritcular the ones from Publish-Subscribe (XEP-0060) [2] Best Practices for Persistent Storage of Private Data via Publish-Subscribe (XEP-0223) [6] and OpenPGP for XMPP Pubsub (XEP-0473) [4].

8. IANA Considerations

This document does not require interaction with the Internet Assigned Numbers Authority (IANA) [8].

9. XMPP Registrar Considerations

TODO

10. Acknowledgements

This work has been done for the Serverless and Metadata Reduction for XMPP project. Many thanks to NLNet foundation and NGI Zero Core for funding the work on this specification.

11. XML Schema

TODO


Appendices

Appendix A: Document Information

Series
XEP
Number
xxxx
Publisher
XMPP Standards Foundation
Status
ProtoXEP
Type
Standards Track
Version
0.0.1
Last Updated
2026-01-11
Approving Body
XMPP Council
Dependencies
XMPP Core, XEP-0060, XEP-0163, XEP-0223, XEP-0473
Supersedes
None
Superseded By
None
Short Name
contacts

This document in other formats: XML  PDF

Appendix B: Author Information

Jérôme Poisson
Email
goffi@goffi.org
JabberID
goffi@jabber.fr
URI
https://www.goffi.org

Copyright

This XMPP Extension Protocol is copyright © 1999 – 2024 by the XMPP Standards Foundation (XSF).

Permissions

Permission is hereby granted, free of charge, to any person obtaining a copy of this specification (the "Specification"), to make use of the Specification without restriction, including without limitation the rights to implement the Specification in a software program, deploy the Specification in a network service, and copy, modify, merge, publish, translate, distribute, sublicense, or sell copies of the Specification, and to permit persons to whom the Specification is furnished to do so, subject to the condition that the foregoing copyright notice and this permission notice shall be included in all copies or substantial portions of the Specification. Unless separate permission is granted, modified works that are redistributed shall not contain misleading information regarding the authors, title, number, or publisher of the Specification, and shall not claim endorsement of the modified works by the authors, any organization or project to which the authors belong, or the XMPP Standards Foundation.

Disclaimer of Warranty

## NOTE WELL: This Specification is provided on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. ##

Limitation of Liability

In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall the XMPP Standards Foundation or any author of this Specification be liable for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising from, out of, or in connection with the Specification or the implementation, deployment, or other use of the Specification (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if the XMPP Standards Foundation or such author has been advised of the possibility of such damages.

IPR Conformance

This XMPP Extension Protocol has been contributed in full conformance with the XSF's Intellectual Property Rights Policy (a copy of which can be found at <https://xmpp.org/about/xsf/ipr-policy> or obtained by writing to XMPP Standards Foundation, P.O. Box 787, Parker, CO 80134 USA).

Visual Presentation

The HTML representation (you are looking at) is maintained by the XSF. It is based on the YAML CSS Framework, which is licensed under the terms of the CC-BY-SA 2.0 license.

Appendix D: Relation to XMPP

The Extensible Messaging and Presence Protocol (XMPP) is defined in the XMPP Core (RFC 6120) and XMPP IM (RFC 6121) specifications contributed by the XMPP Standards Foundation to the Internet Standards Process, which is managed by the Internet Engineering Task Force in accordance with RFC 2026. Any protocol defined in this document has been developed outside the Internet Standards Process and is to be understood as an extension to XMPP rather than as an evolution, development, or modification of XMPP itself.

Appendix E: Discussion Venue

The primary venue for discussion of XMPP Extension Protocols is the <standards@xmpp.org> discussion list.

Discussion on other xmpp.org discussion lists might also be appropriate; see <https://xmpp.org/community/> for a complete list.

Errata can be sent to <editor@xmpp.org>.

Appendix F: Requirements Conformance

The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in BCP 14 [RFC2119] [RFC8174] when, and only when, they appear in all capitals, as shown here.

Appendix G: Notes

1. RFC 6121: Extensible Messaging and Presence Protocol (XMPP): Instant Messaging and Presence <http://tools.ietf.org/html/rfc6121>.

2. XEP-0060: Publish-Subscribe <https://xmpp.org/extensions/xep-0060.html>.

3. XEP-0048: Bookmark Storage <https://xmpp.org/extensions/xep-0048.html>.

4. XEP-0473: OpenPGP for XMPP Pubsub <https://xmpp.org/extensions/xep-0473.html>.

5. XEP-0163: Personal Eventing Protocol <https://xmpp.org/extensions/xep-0163.html>.

6. XEP-0223: Best Practices for Persistent Storage of Private Data via Publish-Subscribe <https://xmpp.org/extensions/xep-0223.html>.

7. XEP-0030: Service Discovery <https://xmpp.org/extensions/xep-0030.html>.

8. The Internet Assigned Numbers Authority (IANA) is the central coordinator for the assignment of unique parameter values for Internet protocols, such as port numbers and URI schemes. For further information, see <http://www.iana.org/>.

Appendix H: Revision History

Note: Older versions of this specification might be available at https://xmpp.org/extensions/attic/

  1. Version 0.0.1 (2026-01-11)

    First draft.

    jp

Appendix I: Bib(La)TeX Entry

@report{poisson2026contacts,
  title = {End-to-End Encrypted Contacts Metadata},
  author = {Poisson, Jérôme},
  type = {XEP},
  number = {xxxx},
  version = {0.0.1},
  institution = {XMPP Standards Foundation},
  url = {https://xmpp.org/extensions/xep-xxxx.html},
  date = {2026-01-11/2026-01-11},
}

END