ActivityPub is an open, decentralized social networking protocol standardized by the World Wide Web Consortium (W3C). It allows independent servers, or instances, to communicate with each other, enabling users on different platforms to interact seamlessly. This creates a federated network, often called the Fediverse, where services like Mastodon, PeerTube, and Pixelfed can share content and follow users across server boundaries. The protocol defines a client-to-server API for user interactions and a server-to-server API (often called the Federation Protocol) for inter-instance communication using the ActivityStreams 2.0 data format.
ActivityPub
What is ActivityPub?
ActivityPub is a decentralized social networking protocol that enables different platforms to interoperate, forming a federated web.
At its core, ActivityPub models social interactions as Activities—such as Create, Like, Follow, and Announce (boost/repost)—performed by Actors (users, groups, applications). These activities are serialized as JSON-LD and exchanged between servers over HTTP. This design allows for a pub/sub (publish-subscribe) model: when a user posts a message, their server delivers Create activities to the inboxes of followers, which may be on remote servers. This decentralized delivery mechanism is the foundation of federation, eliminating the need for a central controlling entity.
A key architectural principle of ActivityPub is actor-centric addressing. Every user and resource has a globally unique identifier, typically a URL (e.g., @user@instance.social). This WebFinger identifier allows servers to discover a user's profile and endpoints. The protocol emphasizes privacy and access control, allowing servers to enforce permissions and authenticate requests using HTTP signatures. Unlike monolithic platforms, this federation model gives instance administrators control over their own community rules, data policies, and moderation tools, while still participating in the broader network.
The practical impact of ActivityPub is the creation of an interoperable social web. For example, a user on a Mastodon instance can follow a channel from a PeerTube video platform or an artist on a Pixelfed photo-sharing instance. All interactions—likes, comments, shares—flow between these disparate applications. This challenges the walled garden model of traditional social media by preventing platform lock-in and promoting user choice, data ownership, and resilience against single points of failure or censorship.
For developers, implementing ActivityPub involves supporting the standardized ActivityStreams vocabulary and the two primary APIs. The Client-to-Server API handles user authentication, posting, and inbox management, similar to a traditional social media app. The Server-to-Server (Federation) API handles the POSTing of activities to remote inboxes and GETing from remote outboxes. This separation allows for diverse client applications while ensuring reliable federation between server software, fostering a rich ecosystem of compatible services.
How ActivityPub Works
A technical breakdown of the decentralized social networking protocol that powers the Fediverse.
ActivityPub is a decentralized social networking protocol that enables servers, called ActivityPub servers, to communicate and share social activities—such as posts, likes, and follows—using a standardized data format and client-server API. It is the foundational protocol for the Fediverse, a network of interconnected but independent social platforms like Mastodon, PeerTube, and Pixelfed. The protocol is defined by the World Wide Web Consortium (W3C) as a Recommendation, ensuring it is an open, vendor-neutral standard for building interoperable social applications.
The protocol operates on two primary layers: the Client-to-Server (C2S) API and the Server-to-Server (S2S) API. The C2S API allows a user's client application (e.g., a Mastodon web app) to interact with their home server to create, update, and delete content. The S2S API, also known as the Federation Protocol, is how servers discover and communicate with each other to deliver activities across the network. This dual-API structure separates local user management from cross-instance federation, providing both flexibility and scalability.
At its core, ActivityPub uses ActivityStreams 2.0 as its data format, representing all interactions as JSON-LD objects with specific types like Note, Create, Like, and Follow. When a user on one server (e.g., mastodon.social) follows a user on another server (e.g., pixelfed.instance), their server sends a Follow Activity to the target user's inbox. The receiving server authenticates the request and, if accepted, adds the follower and begins delivering the target user's future posts to the follower's inbox, establishing a federated connection.
Delivery and Inboxes are central to the protocol's operation. Each actor (a user, group, or application) has an inbox and an outbox. The inbox receives all activities destined for the actor, while the outbox contains activities the actor has produced. Servers use HTTP POST requests with signed JSON payloads to deliver activities to remote inboxes. For discovery and identity, servers expose a WebFinger endpoint and an actor object at a predictable URL, allowing other servers to look up and retrieve public key information for secure, authenticated delivery.
A key feature of ActivityPub is its support for decentralized moderation and access control. Server administrators can implement instance-level blocks to prevent all communication with another server, while users can block or mute other individual accounts. Content can be addressed to specific audiences using the to, cc, bto, and bcc fields, enabling both public posts and private direct messages. This architecture allows for a diverse ecosystem where communities can set their own rules while still participating in a global network.
Key Features of ActivityPub
ActivityPub is a decentralized social networking protocol that defines a client-to-server API for creating, updating, and deleting content, and a server-to-server API for federating these activities across different instances.
Decentralized Federation
ActivityPub enables a federated network where independent servers (called instances or servers) can communicate. Unlike centralized platforms, there is no single controlling entity. Users on one instance (e.g., Mastodon) can seamlessly follow and interact with users on another (e.g., Pixelfed). This is achieved through the server-to-server (S2S) protocol, where instances exchange standardized ActivityStreams messages.
Actor Model & Inbox/Outbox
Every entity (user, group, service) is an Actor, represented by a unique URI. Each Actor has an inbox and an outbox, which are central to the protocol's operation.
- Inbox: Receives all activities (posts, likes, follows) addressed to the Actor, both from local users and the federated network.
- Outbox: Contains all activities the Actor has published. Servers deliver activities from an Actor's outbox to the inboxes of followers on other servers. This model ensures a consistent flow of data.
ActivityStreams 2.0 Data Format
ActivityPub uses ActivityStreams 2.0 as its core data format, expressed in JSON-LD. This provides a standardized vocabulary for social activities. Key object types include:
- Note: A basic post or update.
- Create, Update, Delete: Verbs that define actions on objects.
- Follow, Like, Announce: Verbs for social interactions. This shared vocabulary allows different software implementations to understand each other's messages, enabling interoperability across the fediverse.
Client-to-Server (C2S) API
The C2S API allows client applications (like a mobile app or web interface) to interact with a user's home server. It handles authentication and authorized actions such as:
- Posting new content to the user's outbox.
- Fetching the user's timeline from their inbox.
- Managing followers and followed collections. This separation allows for diverse client applications while the server handles federation and storage.
Server-to-Server (S2S) Federation
The S2S API (or Federation Protocol) is how servers communicate to deliver activities across the network. When a user posts something, their server:
- Creates an ActivityStreams object.
- Delivers HTTP POST requests containing the activity to the inboxes of all relevant followers on remote servers.
- Remote servers authenticate the request (often using HTTP Signatures) and process the activity into their local user's inboxes.
Interoperability & The Fediverse
ActivityPub's primary goal is interoperability, creating the fediverse—a network of interconnected but independent social platforms. Different applications specializing in microblogging (Mastodon), photo sharing (Pixelfed), or video (PeerTube) can all use ActivityPub, allowing users to interact across software boundaries. A user on a Mastodon instance can follow a channel on a PeerTube instance, with all interactions federated seamlessly.
Examples & Implementations
ActivityPub is not a single platform but a protocol enabling a federated social web. These are prominent implementations that demonstrate its core concepts.
ActivityPub vs. Traditional & Web3 Models
A technical comparison of the ActivityPub protocol against traditional centralized and blockchain-based Web3 models across key architectural dimensions.
| Architectural Feature | ActivityPub (Fediverse) | Traditional Centralized (Web2) | Blockchain Web3 |
|---|---|---|---|
Core Architecture | Federated Servers | Monolithic Servers | Distributed Ledger |
Data Ownership & Portability | |||
Censorship Resistance | Server-level | Protocol-level | |
Consensus Mechanism | Social/Server Agreement | Platform Policy | Cryptographic (e.g., PoS, PoW) |
Primary Data Structure | Activity Streams (JSON-LD) | Platform DB (SQL/NoSQL) | Append-only Blockchain |
Identity & Authentication | Decentralized Identifiers (DIDs) | Platform Accounts (OAuth) | Cryptographic Key Pairs |
Monetization Model | Donations, Membership | Advertising, Data Sales | Tokenomics, Transaction Fees |
Interoperability Standard | W3C Recommendation | Proprietary APIs | Varies by Chain/Protocol |
Etymology & History
The development of ActivityPub traces a path from early web decentralization efforts to its establishment as a modern standard for federated social networking.
The term ActivityPub is a portmanteau of Activity Streams, a prior format for representing social activities, and Pub for Publish-Subscribe, indicating its core mechanism. The protocol was formally standardized by the World Wide Web Consortium (W3C) in January 2018 as a successor to the OStatus protocol, which powered early federated networks like GNU Social. Its design is deeply rooted in Linked Data principles and the Activity Vocabulary, aiming to create an interoperable social web where different servers (instances) can communicate.
The historical impetus for ActivityPub came from the limitations of walled garden social media platforms and the desire for user-controlled, decentralized alternatives. Prior federated protocols were often brittle and lacked a unified standard. ActivityPub's development within the W3C's Social Web Working Group provided a rigorous, vendor-neutral specification. Its architecture is heavily influenced by the ActivityStreams 2.0 data format, which provides a JSON-LD vocabulary for describing social interactions like Create, Follow, and Like, ensuring a common semantic understanding across implementations.
A pivotal moment in ActivityPub's adoption was its integration into the Mastodon microblogging platform starting in 2017, which demonstrated the protocol's viability at scale. This created the Fediverse (federated universe), a network of interconnected but independent servers. The protocol's history is marked by its pragmatic design, prioritizing practical federation over theoretical perfection, which led to rapid adoption by diverse platforms including PeerTube (video), Pixelfed (images), and Lemmy (link aggregation), each extending the core ActivityPub vocabulary for their specific needs.
The evolution of ActivityPub continues as the W3C's SocialCG (Social Web Community Group) maintains the specification. Key historical challenges have included scaling federation, mitigating abuse across servers, and refining the semantics of interactions. Its success lies in providing a foundational API layer that separates the social graph from the application, enabling innovation while preserving interoperability—a direct response to the centralized history of the early 21st-century social web.
Common Misconceptions
ActivityPub is a foundational protocol for decentralized social networking, but its architecture and capabilities are often misunderstood. This section clarifies frequent points of confusion.
No, ActivityPub is not the same as the Fediverse; it is the underlying W3C standard protocol that enables the Fediverse. The Fediverse (Federated Universe) is the collective network of interconnected, independently operated servers (instances) that use ActivityPub to communicate. Think of ActivityPub as the common language (like SMTP for email) and the Fediverse as the global network of servers and users (like the entire world's email system) that speak that language. Other protocols, like OStatus or Zot, can also power federated networks, but ActivityPub is the most widely adopted standard for modern federated social platforms like Mastodon, PeerTube, and Pixelfed.
Security & Moderation Considerations
While ActivityPub enables open, decentralized social networking, its federated architecture introduces unique security and moderation challenges that differ from centralized platforms.
Spam & Sybil Attacks
The open nature of federation makes it easy for malicious actors to create many fake accounts (Sybil nodes) and broadcast spam or malicious content across the network. Defenses include:
- Instance-level blocking: Admins can block entire malicious servers.
- Proof-of-Work challenges: Requiring computational work for posts to deter mass spamming.
- Reputation systems: Using web-of-trust models to identify good actors.
Content Moderation at Scale
Moderation is delegated to individual server administrators (instance admins), creating a patchwork of policies. Key mechanisms include:
- Access Control Lists (ACLs): For limiting post visibility.
- Federated Block Lists: Shared lists of known bad servers (e.g., the Mastodon Blocklist project).
- Silence, Suspend, & Limit: Granular controls to restrict interactions from problematic accounts or entire instances.
Data Integrity & Poisoned Objects
ActivityPub objects (posts, likes) are signed, but their content can be altered by the originating server after distribution, leading to content poisoning. This can be used for harassment or disinformation. Mitigations involve:
- Object immutability: Treating the
idand core content as immutable after federation. - Signed activities: Verifying the signature of the
CreateorAnnounceactivity itself. - Content warnings: Flagging potentially altered or unsafe content.
Denial-of-Service (DoS) Vectors
The protocol can be abused to overwhelm target servers. Common vectors include:
- Mass mentions (@): Tagging thousands of users in a single post.
- Infinite federation loops: Poorly implemented servers causing notification storms.
- Actor enumeration: Scraping user lists from public endpoints. Defenses require rate limiting, loop detection (via the
ccandtofields), and careful API design.
Privacy & Access Control
The default public visibility of many activities conflicts with user privacy expectations. Implementations must manage:
- Audience targeting: Correct use of
to,cc,bto, andbccfields for direct messages and limited audiences. - Collection leaking: Ensuring private posts aren't added to public collections.
- Server trust: Users must trust their instance admin not to misuse their private data, as all data passes through that server.
Protocol-Level Vulnerabilities
Inherent protocol features can be exploited if not carefully implemented:
- ID Duplication: Relying on non-unique
idfields can cause confusion. - Inbox Forwarding: A server accepting an activity for another can lead to spoofing.
- Undelivered Activities: Lack of guaranteed delivery can be used for harassment (sending then deleting). Security relies on strict specification compliance and input validation.
Frequently Asked Questions
ActivityPub is a foundational protocol for decentralized social networking. These questions address its core concepts, implementation, and relationship to other technologies.
ActivityPub is a decentralized social networking protocol that enables different servers, or instances, to communicate and share social activities. It works by defining a standard way for servers to exchange Activity Streams, which are JSON-LD formatted messages representing actions like 'Create', 'Like', 'Follow', and 'Announce'. Each user has a unique inbox and outbox on their home server. When a user posts a message, their server sends an activity to the inboxes of followers, which may be on the same server or on remote, federated servers. This federation model allows for an interconnected network of independent platforms, such as Mastodon and PeerTube, to interact seamlessly.
Get In Touch
today.
Our experts will offer a free quote and a 30min call to discuss your project.