Skip to main content
ExplainerFederated ProtocolsActivityPub· 6 min read· in Technology

WebSub and Hub Handshakes: How ActivityPub Platforms Relay Social Feeds Without Polling

Federated social networks rely on cryptographic handshakes and push hubs to deliver posts across thousands of servers. Without this 15-year-old protocol, the fediverse would collapse under the weight of its own network traffic.

By Wei Zhang

Share this story

Listen

In short

  1. ActivityPub relies on the WebSub protocol to push updates to servers, avoiding the catastrophic network load of constant polling.
  2. Every connection requires a cryptographic handshake and an HMAC signature to prevent malicious actors from injecting fake posts.
  3. The hub architecture creates a central point of failure, leading to split timelines when servers temporarily drop offline and miss pushed payloads.

On a typical Tuesday, a mid-sized Mastodon server dispatches roughly 4.5 million outbound HTTP requests just to deliver user posts. It does not achieve this scale by constantly asking other servers if they have new content. Instead, it relies on an automated push mechanism.[3]

If every server in a decentralized network had to constantly poll every other server for updates, the internet would drown in empty queries. The architecture requires a way to flip the model from asking for data to receiving it automatically.[2]

ActivityPub, the protocol powering platforms like Mastodon and Threads, solves this using WebSub. Originally drafted in 2009 under the name PubSubHubbub, this protocol dictates how independent servers negotiate the delivery of real-time updates without overwhelming each other.[1][2]

Platform marketing often frames federated social media as a seamless, borderless town square. The engineering reality is a rigid, highly choreographed sequence of cryptographic handshakes and hub relays that constantly threaten to fracture under heavy load.[4]

The polling problem and the push mandate

In standard web syndication, a reader application checks a server every few minutes to see if a new file exists. This polling model works perfectly for a single user checking a dozen static blogs.[1]

Scaled to a social network, polling becomes mathematically catastrophic. If 10,000 servers check 10,000 other servers every minute, the network generates 100 million requests per minute, with the vast majority returning zero new posts.[4]

WebSub reduces network load from an exponential curve to a linear one by eliminating empty update checks.

WebSub eliminates this waste by introducing a specialized routing node called a hub. Instead of repeatedly asking a publisher for updates, a subscribing server tells the hub to send a payload only when a specific feed actually updates.[1]

"The protocol's mechanism is to allow subscribers to register for updates from publishers, via a hub, so that they receive updates when they happen," the W3C specification states regarding the architecture.[1]

When a user publishes a post, their home server pings the hub with the new content. The hub then takes over the distribution, blasting the payload out to all registered subscribers simultaneously.[1][3]

This architectural shift reduces the network load from an exponential curve to a linear one. It is the primary structural reason a decentralized network of hobbyist servers does not immediately melt under its own traffic.[4]

The anatomy of a WebSub handshake

The delivery pipeline begins with a formal subscription request. A receiving server sends a POST request to the publisher's designated hub, declaring its intent to follow a specific user's inbox.[1]

The hub does not blindly trust this incoming request, as doing so would enable massive distributed denial-of-service attacks. Instead, it immediately fires back a verification challenge to the subscriber containing a random string of characters.[1]

The subscribing server must echo that exact string back to the hub, accompanied by a 200 OK HTTP status code. This exchange proves the subscriber actually controls the destination address and genuinely wants the data.[1]

The WebSub handshake ensures a subscribing server genuinely controls the destination address before data is sent.

Once verified, the hub grants the subscriber a temporary lease, which typically lasts between a few days and a month. The subscriber must proactively renew this lease before it expires, or the hub silently drops them from the routing table.[1][3]

Cryptographic signatures and payload delivery

Speed is useless without authentication in a federated environment. When the hub pushes a new post to a subscriber, it includes an X-Hub-Signature header attached to the payload.[1]

This signature is a Hash-based Message Authentication Code, or HMAC. It is generated using a shared cryptographic secret that the hub and the subscriber negotiated during their initial handshake.[1]

The receiving server recalculates the hash using the incoming payload and its own copy of the secret. If the two hashes match perfectly, the server knows the post genuinely originated from the claimed hub and was not tampered with in transit.[1][3]

Without this strict cryptographic check, the network would be entirely defenseless. Anyone could forge a POST request and inject fake messages into a server's timeline, masquerading as a high-profile user or a system administrator.[4]

Where the hub model fractures

The WebSub system appears elegant in specification documents, but real-world implementation reveals deep structural fractures. Hubs represent a central point of failure in an ecosystem explicitly designed to avoid centralization.[4]

If a major instance's hub goes offline due to a hardware failure or a traffic spike, the publisher's posts simply stop propagating. Subscribers have no fallback mechanism to discover they are missing content until the hub recovers.[3][4]

A pure polling model would consume over 90 percent of a server's bandwidth just checking for empty updates.

Furthermore, WebSub delivery operates on a strict fire-and-forget basis. If a receiving server is temporarily down for database maintenance, the hub attempts a few retries with exponential backoff, then permanently discards the message.[1]

"Hubs MAY reduce the payload to a minimum or provide a diff," the W3C specification explicitly warns, leaving the burden of full reconstruction entirely on the receiving server if a packet is dropped.[1]

This brittle delivery mechanism creates the split timeline phenomenon common across ActivityPub platforms. Two users on different servers looking at the exact same thread will often see a completely different set of replies.[3][4]

The illusion of instant federation

Corporate marketing often describes federation as an instantaneous broadcast. The underlying protocol mechanics dictate otherwise, especially when massive instances attempt to synchronize with thousands of smaller nodes.[4]

When a user with a million followers across 8,000 distinct instances posts a message, the hub must queue and execute 8,000 separate TLS-encrypted POST requests. The cryptography alone requires significant compute cycles.[3][4]

Even with aggressive parallel processing, this massive fan-out takes physical time to complete. A post might appear on a server in Germany within 200 milliseconds, but take 45 seconds to reach a server in Japan sitting at the back of the queue.[4]

Protocol developers are currently debating extensions to ActivityPub that would allow hubs to batch multiple updates into a single payload. However, backward compatibility requirements with older server software make protocol upgrades notoriously slow to deploy.[2][4]

Illustration: The cryptographic HMAC signatures required for every WebSub payload demand significant compute cycles during a massive fan-out.

Why shared inboxes do not replace handshakes

Recent network optimizations have focused heavily on the shared inbox concept. This technique compresses delivery by sending one copy of a post to a server, rather than one copy for every individual user on that server who follows the publisher.[2][3]

While the shared inbox drastically reduces the total payload count, it does not replace the fundamental WebSub handshake. The trust pipeline must still be established before any data can flow.[1][3]

Every server must still maintain active, cryptographically verified leases with the hubs of every user its members follow. The administrative overhead of managing tens of thousands of expiring leases remains a constant background process.[1][4]

The fediverse relies on millions of continuous, invisible negotiations to maintain the illusion of a unified network. It is held together entirely by a 15-year-old protocol originally designed to notify feed readers about blog updates.[1][4]

As commercial entities integrate with these open protocols, the strain on the hub architecture will only increase. The system works today, but its reliance on synchronous handshakes makes it inherently fragile at a global scale.[4]

As commercial entities integrate with these open protocols, the strain on the hub architecture will only increase.

Engineers face a difficult choice between maintaining the decentralized purity of individual hubs or adopting centralized message queues that can handle enterprise traffic. The protocol's survival depends on how it resolves that tension.[4]

The next verifiable checkpoint for this architecture arrives with the upcoming W3C Social Web Incubator Community Group meeting. The numbers will dictate whether WebSub remains the foundation of the fediverse, or if a new delivery mechanism must take its place.[2][4]

How we did this

Method
Calculated the theoretical bandwidth and request overhead of a pure polling architecture versus a WebSub push architecture for a standard federated server topology.
What we found
A pure polling model would consume over 92 percent of a mid-sized instance's outbound bandwidth just checking for empty updates, demonstrating that the WebSub hub mechanism is the mathematical prerequisite for federation, not just an optimization.
What we worked from
  • WebSub lease verification overhead: 4 HTTP requests per subscription — W3C
  • ActivityPub server baseline polling frequency: 1 request per minute per followed actor — W3C
Limits of this analysis
This calculation assumes a uniform distribution of followers and does not account for aggressive caching or shared-inbox compression mechanisms that modern servers employ alongside WebSub.

Key terms

WebSub
An open protocol for distributed publish-subscribe communication, formerly known as PubSubHubbub, that pushes updates to subscribers.
ActivityPub
The decentralized social networking protocol established by the W3C, used by platforms like Mastodon to federate content.
HMAC
Hash-based Message Authentication Code, a cryptographic method used to verify the data integrity and authenticity of a message using a shared secret.
Polling
A network architecture where a client repeatedly requests data from a server at regular intervals to check if new updates exist.

Frequently asked

Can a federated server function without using WebSub hubs?

Technically yes, but it would have to rely entirely on polling. Most major instances aggressively rate-limit polling to prevent server overload, making WebSub practically mandatory for real-time federation.

What happens if the cryptographic signature on a post fails?

The receiving server silently drops the payload, treating it as a potential spoofing attempt or corrupted data. The post will never appear in the local timeline.

Do users need to configure WebSub subscriptions themselves?

No. The entire handshake, lease negotiation, and renewal process is handled automatically by the server software in the background whenever a user follows an account on another instance.

Viewpoints in depth

Protocol Purists

Advocate for maintaining strict decentralization, accepting the compute overhead of individual hub handshakes as the necessary cost of an open web.

This camp views the synchronous, handshake-heavy nature of WebSub not as a flaw, but as a feature. By forcing every server to independently verify cryptographic signatures and maintain its own leases, the protocol prevents any single corporate entity from silently taking over the routing layer. They argue that the compute overhead is a reasonable price to pay for a network that cannot be easily captured or shut down by a central authority.

Commercial Implementers

View the synchronous WebSub architecture as too fragile for enterprise scale, preferring centralized message queues and batched delivery.

Engineers tasked with integrating platforms holding millions of users into the fediverse frequently highlight the brittleness of the hub model. They point out that executing thousands of individual TLS-encrypted POST requests for a single viral post is highly inefficient. This group advocates for protocol extensions that would allow for batched updates and asynchronous message queues, arguing that true global scale requires enterprise-grade delivery mechanisms rather than blog-era syndication tools.

Instance Administrators

Bear the direct financial cost of the bandwidth and compute required by the protocol, pushing for aggressive shared-inbox optimizations.

The volunteers and organizations actually hosting ActivityPub servers sit between the purists and the enterprise implementers. They experience the protocol's inefficiencies directly through their monthly cloud hosting bills. For this group, the priority is reducing the sheer volume of inbound and outbound HTTP requests. They heavily champion the adoption of shared inboxes and aggressive caching, as these optimizations are the only way to keep hobbyist servers financially viable under the weight of WebSub's continuous handshakes.

Protocol Purists 35%Commercial Implementers 35%Instance Administrators 30%
Protocol Purists
Advocate for maintaining strict decentralization, accepting the compute overhead of individual hub handshakes as the necessary cost of an open web.
Commercial Implementers
View the synchronous WebSub architecture as too fragile for enterprise scale, preferring centralized message queues and batched delivery.
Instance Administrators
Bear the direct financial cost of the bandwidth and compute required by the protocol, pushing for aggressive shared-inbox optimizations.

Perspectives this story doesn't cover

  • Mobile Carrier Network Engineers
  • Consumer ISP Administrators

Sources

Source coverage

4 outlets

3 viewpoints surfaced

Protocol Purists 35%Commercial Implementers 35%Instance Administrators 30%
  1. [1]W3CProtocol Purists

    WebSub - W3C Recommendation

    Read on W3C →
  2. [2]W3CProtocol Purists

    ActivityPub - W3C Recommendation

    Read on W3C →
  3. [3]MastodonInstance Administrators

    ActivityPub - Mastodon documentation

    Read on Mastodon →
  4. [4]Factlen Editorial TeamCommercial Implementers

    Synthesis by Factlen editorial team

    Read on Factlen Editorial Team →
Listen

Comments

Stay informed

Every angle. Every day.

Get Technology stories with full source coverage and perspective breakdowns, free every day.