XEP-0465: Pubsub Public Subscriptions

This specification provides a way to make subscriptions to a node public
Jérôme Poisson
© 1999 – 2021 XMPP Standards Foundation. SEE LEGAL NOTICES.


WARNING: This Standards-Track document is Experimental. Publication as an XMPP Extension Protocol does not imply approval of this proposal by the XMPP Standards Foundation. Implementation of the protocol described herein is encouraged in exploratory implementations, but production systems are advised to carefully consider whether it is appropriate to deploy implementations of this protocol before it advances to a status of Draft.
Standards Track
0.1.1 (2022-07-25)
Document Lifecycle
  1. Experimental
  2. Proposed
  3. Stable
  4. Final

1. Introduction

Publish-Subscribe (XEP-0060) [1] as its name states has a mechanism to subscribe to a node. Only the owner of the node can retrieve the list of subscribers

It may be interesting for users to share publicly the nodes they have subscribed to, or who is subscribed to theirs: it's a quick way to discover center of interest of a user, or to discover new accounts/nodes related to a specific center of interest. This kind of feature is common in modern social networks and often named "following" and "followers". This XEP proposes a solution to implement this feature in XMPP while respecting privacy of users.

There is currently a XEP partially covering this problem with Pubsub Subscription (XEP-0330) [2]. This XEP has the advantage to be usable with a generic Pubsub service, but it has 2 flaws:

This XEP fixes both issues.

2. Requirements

The design goal of this XEP are:

This XEP uses Pubsub Account Management (XEP-0376) [3] as only way to subscribe to a node and unsubscribe from a node, as it is necessary to keep track of subscriptions.

3. Glossary

In this documentation, PAM service refers to a PEP service implementing Pubsub Account Management (XEP-0376) [3].

4. Use Cases

4.1 Public Subscription

Romeo wants to subscribe to the blog of his cousin Benvolio and he wants to make it public, so other peoples can discover Benvolio blog more easily.

He does that as usual by sending a subscription request as explained in XEP-0376 §Subscribing but he adds a <public> element with the 'urn:xmpp:pps:0' namespace:

Example 1. Romeo Makes a Public Subscription to Benvolio Blog
<iq type='set' id='sub1'>
  <pam xmln='urn:xmpp:pam:0' jid='benvolio@montague.lit'>
    <subscribe xmlns='http://jabber.org/protocol/pubsub'
        <public xmlns='urn:xmpp:pps:0'/>

Romeo also wants to follow the blog of this girl that he met at the ball, however, he doesn't want yet to make it public for political reasons. He then does the subscription as usual and does not include the <public> element:

Example 2. Romeo Makes a Non Public Subscription to Juliet Blog
<iq type='set' id='sub2'>
  <pam xmln='urn:xmpp:pam:0' jid='juliet@capulet.lit'>
    <subscribe xmlns='http://jabber.org/protocol/pubsub'

4.2 Retrieving Public Subscriptions

Mercutio is a friend of Romeo and he wants to know which nodes Romeo is subscribed to, as it may be a way to discover new and interesting peoples. To do this, Romeo's PAM service manages a special node named 'urn:xmpp:pps:subscriptions:0'. This node is created and managed by the PAM service itself, it can be subscribed to and unsubscribed from as an usual PubSub node, and it contains an item for each public subscription that has been made by node owner (Romeo in our example). Each items payload is a <subscription> element with the 'urn:xmpp:pps:0' namespace containing a 'node' attribute with the name of the subscribed node, and a 'jid' attribute with the JID of the pubsub service containing the subscribed node.

The node owner can't add or retract items directly on the node: if Romeo wants to add or public subscription, it does this by doing a public subscription as explained in Public Subscription, and if he wants to retract a public subscription, he can do as explained in the next section. Result Set Management (XEP-0059) [4] and Pubsub Message Archive Management (XEP-0442) [5] apply normally if they are implemented.

Example 3. Mercutio Get Public Subscriptions of Romeo
<iq type='get'
  <pubsub xmlns='http://jabber.org/protocol/pubsub'>
    <items node='urn:xmpp:pps:subscriptions:0'/>
Example 4. Romeo's PAM Service Replies With Public Subscriptions
<iq type='result'
  <pubsub xmlns='http://jabber.org/protocol/pubsub'>
    <items node='urn:xmpp:pps:subscriptions:0'>
      <item id='abcd'>
          <subscription xmlns='urn:xmpp:pps:0' node='urn:xmpp:microblog:0' jid='benvolio@montague.lit' />

4.3 Retracting Public Subscriptions

Romeo can retract a public subscription in 2 ways:

4.4 Retrieving Public Subscribers to a node

If Mercutio wants to know who is publicly subscribing to Romeo's blog, he request the PAM Service by using a special node managed by the service in a similar way as 'urn:xmpp:pps:0' node from Retrieving Public Subscriptions section (i.e. a node which can be subscribed to normally, but whose items can't be publised or retracted directly). This node is named by prefixing the name of the target node with 'urn:xmpp:pps:subscribers:0/'. So to check who is subscribed to Romeo's blog, Mercutio must request 'urn:xmpp:pps:subscribers:0/urn:xmpp:microblog:0' node. The service will answer with items whose payload is a <subscriber> element with the 'urn:xmpp:pps:0' namespace, and a 'jid' attribute whose value is the JID of the public subscriber:

Example 5. Mercutio Get Public Subscribers of Romeo's blog
<iq type='get'
  <pubsub xmlns='http://jabber.org/protocol/pubsub'>
      <items node='urn:xmpp:pps:subscribers:0/urn:xmpp:microblog:0'/>
Example 6. Romeo's PAM Service Replies With Public Subscribers
<iq type='result'
  <pubsub xmlns='http://jabber.org/protocol/pubsub'>
    <items node=''urn:xmpp:pps:subscribers:0/urn:xmpp:microblog:0>
      <item id='defg'>
          <subscriber xmlns='urn:xmpp:pps:0' jid='benvolio@montague.lit' />

note:Public subscribers is not restricted to PAM service, if a generic pubsub service implements this XEP, it MUST also returns the public subscribers when the special node is requested.

5. Business Rules

If a user wants to create, purge or delete a special node used in this XEP, or if they want to manually publish or retract items, the service MUST return a <forbidden/> error to the user.

6. discovering support

If a PEP or Pubsub service supports the "Pubsub Public Subscriptions" protocol, it must advertize it by including the "urn:xmpp:pps:0" discovery feature (see Protocol Namespaces regarding issuance of one or more permanent namespaces) in response to a Service Discovery (XEP-0030) [6] information request:

Example 7. service discovery information request
<iq from='example.org'
  <query xmlns='http://jabber.org/protocol/disco#info'/>
Example 8. service discovery information response
<iq from='example.com'
  <query xmlns='http://jabber.org/protocol/disco#info'>
    <feature var='urn:xmpp:pps:0'/>

7. Security Considerations

Publishing publicly subscriptions of a user has pricacy implications: those public subscriptions may be used by someone to get a user interests or to know they network of contacts.

It may be used by bad actors for many reasons like advertising, or it may even be life threating in some countries/situation as it may be used to known political opinion, religion, sexual orientation, etc. A client SHOULD make the subscription public only if there is no doubt that this is what the user wants, by using an opt-in system, and SHOULD display a well visible warning about the consequences of making a subscription public.

By having subscription public, an entity JID can be checked or harvested by doing a request on the public subscriptions node. A client SHOULD display a warning clearly indicating that making subscriptions public makes its JID discoverable.

For the same reason, a server SHOULD respond identically to a pubsub request to public subscriptions node if the user doesn't exist or if they exist but they don't have any public subscriptions.

8. IANA Considerations


9. XMPP Registrar Considerations


10. XML Schema



Appendix A: Document Information

XMPP Standards Foundation
Standards Track
Last Updated
Approving Body
XMPP Council
XMPP Core, XEP-0001, XEP-0060, XEP-0376
Superseded By
Short Name
Source Control

This document in other formats: XML  PDF

Appendix B: Author Information

Jérôme Poisson


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


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/about/discuss.shtml> for a complete list.

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

Appendix F: Requirements Conformance

The following requirements keywords as used in this document are to be interpreted as described in RFC 2119: "MUST", "SHALL", "REQUIRED"; "MUST NOT", "SHALL NOT"; "SHOULD", "RECOMMENDED"; "SHOULD NOT", "NOT RECOMMENDED"; "MAY", "OPTIONAL".

Appendix G: Notes

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

2. XEP-0330: Pubsub Subscription <https://xmpp.org/extensions/xep-0330.html>.

3. XEP-0376: Pubsub Account Management <https://xmpp.org/extensions/xep-0376.html>.

4. XEP-0059: Result Set Management <https://xmpp.org/extensions/xep-0059.html>.

5. XEP-0442: Pubsub Message Archive Management <https://xmpp.org/extensions/xep-0442.html>.

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

Appendix H: Revision History

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

  1. Version 0.1.1 (2022-07-25)
    Update Security Considerations according to council feedback.
    Jérôme Poisson (jp)
  2. Version 0.1.0 (2022-05-17)
    Accepted by vote of Council on 2022-04-13.
    XEP Editor (jsc)
  3. Version 0.0.1 (2022-03-30)

    First draft.


Appendix I: Bib(La)TeX Entry

  title = {Pubsub Public Subscriptions},
  author = {Poisson, Jérôme},
  type = {XEP},
  number = {0465},
  version = {0.1.1},
  institution = {XMPP Standards Foundation},
  url = {https://xmpp.org/extensions/xep-0465.html},
  date = {2022-03-30/2022-07-25},