# ActivityPub
ActivityPub is a decentralized social networking protocol published as a W3C Recommendation in 2018. It enables different servers and applications to communicate, allowing users on one platform to interact with users on another—forming the technical foundation of the [[Fediverse]]. The protocol was developed by [[Christine Lemmer-Webber]], [[Jessica Tallon]], and others.
Built on the ActivityStreams 2.0 data format, ActivityPub defines how servers exchange activities (posts, likes, follows) and how clients interact with servers. Its adoption by [[Mastodon]], PeerTube, Pixelfed, and dozens of other applications has made it the dominant federation protocol, enabling a network of millions of users across thousands of independently operated servers.
## How It Works
ActivityPub has two layers:
1. **Server-to-Server (Federation)**: Servers deliver activities to each other
2. **Client-to-Server**: Apps post activities to user's outbox
```
┌─────────────┐ POST activity ┌─────────────┐
│ Server A │ ────────────────────────────►│ Server B │
│ │ (signed HTTP request) │ │
│ Outbox ────┼───► ────►│──── Inbox │
└─────────────┘ └─────────────┘
```
## Core Concepts
| Concept | Description |
|---------|-------------|
| **Actor** | Entity that can perform activities (user, bot, group) |
| **Inbox** | Where an actor receives activities from others |
| **Outbox** | Where an actor's activities are published |
| **Activity** | An action (Create, Like, Follow, Announce, Delete) |
| **Object** | The target of an activity (Note, Image, Video, Article) |
## Activity Types
Common activities in ActivityPub:
- **Create**: Publish new content
- **Follow**: Subscribe to an actor
- **Like**: Express appreciation
- **Announce**: Share/boost content (retweet equivalent)
- **Delete**: Remove content
- **Update**: Modify existing content
- **Accept/Reject**: Respond to follow requests
- **Undo**: Reverse a previous activity
## Example Activity (JSON-LD)
```json
{
"@context": "https://www.w3.org/ns/activitystreams",
"type": "Create",
"actor": "https://example.com/users/alice",
"object": {
"type": "Note",
"content": "Hello, Fediverse!",
"to": "https://www.w3.org/ns/activitystreams#Public"
}
}
```
## Security
- **HTTP Signatures**: Verify message authenticity
- **Object capabilities**: Control who can perform actions
- **HTTPS required**: Encrypted transport
- **Blocklists**: Instances can refuse federation
## Implementations
| Software | Type | Notes |
|----------|------|-------|
| Mastodon | Microblogging | Most popular implementation |
| PeerTube | Video | Federated YouTube alternative |
| Pixelfed | Photos | Instagram-like |
| Lemmy | Forums | Reddit-like link aggregation |
| WriteFreely | Blogging | Federated Medium |
| Pleroma | Microblogging | Lightweight alternative |
## References
- https://www.w3.org/TR/activitypub/
- https://activitypub.rocks/
- https://en.wikipedia.org/wiki/ActivityPub
## Related
- [[Fediverse]]
- [[Mastodon]]
- [[Christine Lemmer-Webber]]
- [[W3C]]
- [[JSON-LD]]
- [[Decentralized Systems]]
- [[Open Source]]