Skip to main content
Back to Standards
ActivityPub logo

ActivityPub

A W3C Recommendation that defines a decentralized social networking protocol based on the ActivityStreams 2.0 data format. ActivityPub provides both a client-to-server API for creating and managing content and a server-to-server federation protocol that enables independent servers to exchange social activities. Published in January 2018, it is the protocol that underpins the fediverse, powering platforms such as Mastodon, Pixelfed, PeerTube, and Lemmy.

Overview

ActivityPub is a W3C Recommendation that defines a decentralized social networking protocol, enabling independent servers to federate social activities with one another. It is the technical backbone of the fediverse, a growing ecosystem of interconnected platforms where users on one server can follow, interact with, and share content with users on entirely separate servers running different software. Published in January 2018, ActivityPub has driven one of the most significant shifts toward decentralized communication on the web.

Background

The origins of ActivityPub lie in the broader movement toward decentralized social networking that gained momentum in the early 2010s. Early projects like StatusNet, GNU Social, and pump.io explored federated alternatives to centralized platforms like Twitter and Facebook. The W3C Social Web Working Group, established in 2014, undertook the task of standardizing these efforts. ActivityPub emerged from this group, drawing heavily on the pump.io protocol developed by Evan Prodromou. It was published as a W3C Recommendation on 23 January 2018, alongside the Activity Streams 2.0 data format on which it relies.

Purpose & Scope

ActivityPub defines two complementary protocol layers:

Layer Description
Client-to-Server (C2S) API for applications to create, update, and delete content on a server
Server-to-Server (S2S) Federation protocol for servers to deliver activities to remote servers

The server-to-server protocol is by far the more widely implemented. When a user on one server (say, a Mastodon instance) follows a user on another server (say, a Pixelfed instance), the follow request is delivered as an ActivityStreams 2.0 Follow activity via HTTP POST to the remote user's inbox. Subsequent posts by the followed user are delivered to the follower's server as Create activities. Each user has an inbox (for receiving activities) and an outbox (a record of their activities), both accessible as ActivityStreams 2.0 OrderedCollections.

Key Concepts

  • Actor -- A user, organization, or service with an inbox and outbox, identified by a URI
  • Inbox -- An endpoint where an actor receives activities from other servers
  • Outbox -- A collection of activities an actor has published
  • Followers/Following -- Collections tracking social graph relationships
  • Shared Inbox -- An optimization allowing a server to receive activities for multiple actors at a single endpoint

Content addressing and discovery typically rely on WebFinger for mapping human-readable identifiers (like @user@example.org) to ActivityPub actor URIs.

Serializations & Technical Formats

ActivityPub uses JSON-LD as its serialization format, specifically the Activity Streams 2.0 JSON-LD context. Messages are transmitted as HTTP POST requests with the content type application/ld+json; profile="https://www.w3.org/ns/activitystreams". Authentication between servers uses HTTP Signatures, though this mechanism is not formally specified in the W3C Recommendation and has been a source of interoperability challenges.

Governance & Maintenance

The specification was developed by the W3C Social Web Working Group, which concluded its charter after publishing ActivityPub and its companion specifications. The W3C Social Web Incubator Community Group and the Fediverse Enhancement Proposals (FEP) process now serve as forums for proposing extensions and addressing interoperability issues. Because the W3C working group has closed, any formal revision of ActivityPub would require chartering a new group.

Notable Implementations

Mastodon is the most prominent ActivityPub implementation, with millions of users across thousands of independently operated instances. Other major implementations include Pixelfed (photo sharing), PeerTube (video hosting), Lemmy (link aggregation and discussion), Misskey and its forks (microblogging), WriteFreely (blogging), BookWyrm (book reviews), and Funkwhale (music sharing). In 2023, Meta's Threads began testing ActivityPub federation, marking the first integration by a major centralized platform. WordPress also added ActivityPub support via an official plugin, enabling any WordPress site to participate in the fediverse.

Related Standards

  • Activity Streams 2.0 -- The JSON-LD data format that ActivityPub uses for all messages
  • WebFinger -- The discovery protocol used to resolve user identifiers to ActivityPub actor URIs
  • HTTP Signatures -- The authentication mechanism commonly used between federating servers

Further Reading