
ActivityPub is a protocol which connects social media sites, like Mastodon, together to form a network called the fediverse.
Let's start with an example.
Once upon a time, your goddaughter Marigold decided to follow you on social media. You received a message containing a JSON object:
{
"@context": "https://www.w3.org/ns/activitystreams",
"id": "https://pegs.example.org/activity/1234",
"type": "Follow",
"actor": "https://pegs.example.org/users/marigold",
"object": "https://house.example.com/users/godmother"
}
"@context": "https://www.w3.org/ns/activitystreams",
"id": "https://pegs.example.org/activity/1234",
"type": "Follow",
"actor": "https://pegs.example.org/users/marigold",
"object": "https://house.example.com/users/godmother"
}
As you can probably guess, someone named "https://pegs.example.org/users/marigold" (that's Marigold) is asking to follow someone called "https://house.example.com/users/godmother" (that's you).
You are delighted! You reply, accepting Marigold's message:
{
"@context": "https://www.w3.org/ns/activitystreams",
"id": "https://house.example.com/activity/9876",
"type": "Accept",
"actor": "https://house.example.com/users/godmother",
"object": "https://pegs.example.org/activity/1234"
}
"@context": "https://www.w3.org/ns/activitystreams",
"id": "https://house.example.com/activity/9876",
"type": "Accept",
"actor": "https://house.example.com/users/godmother",
"object": "https://pegs.example.org/activity/1234"
}
Now Marigold is following you, and will hear all your news.
Next time: how did we know the message was really from Marigold?
Click for: next part, all parts.