XEP-0173: Pubsub Subscription Storage

This document defines an XMPP protocol extension for storing subscriptions to Pubsub nodes.
Magnus Henoch
© 2005 – 2006 XMPP Standards Foundation. SEE LEGAL NOTICES.


WARNING: This document has been automatically Deferred after 12 months of inactivity in its previous Experimental state. Implementation of the protocol described herein is not recommended for production systems. However, exploratory implementations are encouraged to resume the standards process.
0.1 (2006-02-09)
Document Lifecycle
  1. Experimental
  2. Deferred
  3. Proposed
  4. Active

1. Introduction

Publish-Subscribe (XEP-0060) [1] allows Jabber entities to subscribe to various kinds of information, but provides no way of remembering which nodes a user has subscribed to. Other protocols (e.g. User Geolocation (XEP-0080) [2], User Avatar (XEP-0084) [3]) allow information about a certain entity to be published to a Pubsub node. These protocols use Service Discovery (XEP-0030) [4] to allow other entities to find the pubsub node used by a certain entity, but provide no way of performing the opposite mapping, from pubsub node to information source. This document attempts to fill that void, using Private XML Storage (XEP-0049) [5] for storing information about subscriptions.

2. Requirements

This protocol enables Jabber clients to do the following:

3. Protocol

The <subscriptions/> element qualified by the 'storage:pubsubs' namespace is the root element used in the jabber:iq:private transactions. It has zero or more <subscription/> child elements, each of which MUST possess the following attributes:

Additionally, the <subscription/> element MAY possess these attributes:

4. Use Cases

4.1 Retrieving Existing Subscriptions

In this example, the user already has a subscription to Juliet's geolocation, possibly established through another client.

Example 1. Client requests existing subscriptions
<iq type='get' id='retrieve1'>
  <query xmlns='jabber:iq:private'>
    <subscriptions xmlns='storage:pubsubs'/>
Example 2. Server returns existing subscriptions
<iq type='result' id='retrieve1'>
  <query xmlns='jabber:iq:private'>
    <subscriptions xmlns='storage:pubsubs'>
      <subscription user='juliet@capulet.com'

4.2 Updating Subscriptions

Due to the nature of XEP-0049, incremental updates are not possible; a client MUST send the entire <subscriptions/> node for each update. Before performing the update, the client SHOULD retrieve the stored subscriptions, and incorporate any changes.

In this example, the user has just subscribed to Romeo's tune (see User Tune (XEP-0118) [6]). Assuming that retrieving happened as in the previous use case, updating the subscriptions proceeds as follows:

Example 3. Client sends updated subscriptions
<iq type='set' id='update1'>
  <query xmlns='jabber:iq:private'>
    <subscriptions xmlns='storage:pubsubs'>
      <subscription user='juliet@capulet.com'
      <subscription user='romeo@montague.net'
Example 4. Server reports success
<iq type='result' id='update1'/>

4.3 Identifying Incoming Events

Having recorded the retrieved mappings, the client is now prepared to identify incoming pubsub events. Assume that the following event arrives:

Example 5. Client receives pubsub event
  <event xmlns='http://jabber.org/protocol/pubsub#event'>
    <items node='5017cdc9f4a3d1450445c9096064e459'>
      <item id='current'>
        <tune xmlns='http://jabber.org/protocol/tune'>
          <title>Heart of the Sunrise</title>

The client now knows that this information comes from romeo@montague.net.

5. Security Considerations

Pubsub events offer an opportunity to spoof sender addresses e.g. through 'replyto' data (as specified by the Extended Stanza Addressing (XEP-0033) [7] protocol). This protocol attempts to close that hole. It does so by the following rules and assumptions:

6. IANA Considerations

This document requires no interaction with the Internet Assigned Numbers Authority (IANA) [8].

7. XMPP Registrar Considerations

No namespaces or parameters need to be registered with the XMPP Registrar [9] as a result of this document.

8. XML Schema

<?xml version='1.0' encoding='UTF-8'?>


  <xs:element name='subscriptions'>
	<xs:element ref='subscription' minOccurs='0' maxOccurs='unbounded'/>

  <xs:element name='subscription'>
      <xs:attribute name='jid' type='xs:string' use='required'/>
      <xs:attribute name='node' type='xs:string' use='required'/>
      <xs:attribute name='subscription' use='required'>
          <xs:restriction base='xs:NCName'>
            <xs:enumeration value='none'/>
            <xs:enumeration value='pending'/>
            <xs:enumeration value='subscribed'/>
            <xs:enumeration value='unconfigured'/>
      <xs:attribute name='resource' type='xs:string' use='optional'/>
      <xs:attribute name='user' type='xs:string' use='optional'/>
      <xs:attribute name='targetns' type='xs:string' use='optional'/>



Appendix A: Document Information

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

This document in other formats: XML  PDF

Appendix B: Author Information

Magnus Henoch


This XMPP Extension Protocol is copyright © 1999 – 2024 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/community/> 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-0080: User Geolocation <https://xmpp.org/extensions/xep-0080.html>.

3. XEP-0084: User Avatar <https://xmpp.org/extensions/xep-0084.html>.

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

5. XEP-0049: Private XML Storage <https://xmpp.org/extensions/xep-0049.html>.

6. XEP-0118: User Tune <https://xmpp.org/extensions/xep-0118.html>.

7. XEP-0033: Extended Stanza Addressing <https://xmpp.org/extensions/xep-0033.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/>.

9. The XMPP Registrar maintains a list of reserved protocol namespaces as well as registries of parameters used in the context of XMPP extension protocols approved by the XMPP Standards Foundation. For further information, see <https://xmpp.org/registrar/>.

Appendix H: Revision History

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

  1. Version 0.1 (2006-02-09)

    Initial version; changed title to Pubsub Subscription Storage; changed namespace to storage:pubsubs for consistency with other storage XEPs.

  2. Version 0.0.4 (2005-12-11)

    Add resource attribute.

  3. Version 0.0.3 (2005-11-13)

    Add subscription attribute.

  4. Version 0.0.2 (2005-10-28)

    Fix typo and schema.

  5. Version 0.0.1 (2005-10-25)

    First draft.


Appendix I: Bib(La)TeX Entry

  title = {Pubsub Subscription Storage},
  author = {Henoch, Magnus},
  type = {XEP},
  number = {0173},
  version = {0.1},
  institution = {XMPP Standards Foundation},
  url = {https://xmpp.org/extensions/xep-0173.html},
  date = {2005-10-25/2006-02-09},