Introduction to ActivityPub

This guide is a collaboratively-edited introduction to ActivityPub and provides links to sources of more information.

What is ActivityPub?

ActivityPub is a standard that allows different web applications to interact so that users can pool their information and collaborate across instances (websites, applications), even ones running different software.

Although only adopted as an official World Wide Web Consortium recommendation in 2018, the ActivityPub protocol is already implemented in a significant range of projects. These include:

ActivityPub supports common social network activities like following, liking, announcing, adding, and blocking. For example, if you have an account on a Mastodon instance like mastodon.social, you can follow someone on a WriteFreely instance like Qua and receive updates whenever they have a new blog post.

Why ActivityPub?

Christopher Lemmer Webber, one of the co-authors of ActivityPub, noted in a post announcing the standard:

Increasingly, much of our lives is mediated through social networks, and so network freedom in these spaces – and thus removing central control over them – is critical. One thing you may have noticed in the last decade is that many decentralized free software social networking applications have been written. Sadly, most of those applications can’t actually speak to each other – a fractured federation. I hope that with ActivityPub, we’ve improved that situation.

Terminology

Federation

In IT, a federation is:

a group of computing or network providers agreeing upon standards of operation in a collective fashion.

Federation is the term used to describe the interoperability that ActivityPub and other protocols can enable between different websites running different softwares. Sites that are connected in this way are said to be federated.

Fediverse

See Fediverse.Party for a good introduction:

It is a common name for federated social networks running on free open software on a myriad of servers across the world.

The term Fediverse includes but is not limited to applications supporting ActivityPub. There are other standards such as diaspora, Zot, OStatus and DFRN (this list from Fediverse.Party).

Resources

There’s a growing set of information out there about ActivityPub and how to use it. Here are some places to look.

Discussion, news and announcements

  • The ActivityPub Rocks site has a general intro and historical announcements.
  • The forum on ActivityPub Rocks is an active discussion site with many categories and topics.
  • The Feneas forum is “a neutral place for all federated projects (and their users!) to come and discuss.” It includes ActivityPub discussion as well as broader topics to do with the Fediverse.
  • Some technical discussion related to the ActivityPub specification takes place in the issue queue for the ActivityPub specification.
  • We Distribute is “a publication dedicated to Free Software, decentralized communication technologies, and sustainability” with lots of Fediverse-related news.

Conferences

ActivityPub Conference 2019, Prague

Extensive conference materials, including session videos, are posted on the conference site. This is a great place to get up to speed on current discussions and initiatives in the ActivityPub space.

FedConf 2020, Barcelona

A Fediverse conference will take place September 25 - 27, 2020 in Barcelona. See:

Introductions and overviews

Fediverse aggregators

Various projects that crawl, aggregate, and map the different instances that form the fediverse provide potentially valuable insights into what’s currently done in ActivityPub and the other federation protocols.

Fediverse network

search.social

a fediverse search engine.

fediverse.space

a tool to visualize networks and communities on the fediverse. It works by crawling every instance it can find and aggregating statistics on communication between these.

the-federation.info

Provides an opt-in listing of Fediverse instances and the software that runs them.

instances.social

Offers a wizard-based interface to identify suitable Mastodon instance based on user preferences.

Organizations

Feneas

Federated Networks Association (Feneas) is:

a non-profit volunteer organization that aims to spread knowledge about federated web projects and help people and projects involved in this area.

Social Web Incubator Community Group

The Social Web Incubator Community Group exists:

to continue and extend the development of vocabularies, formats and protocols to support the distributed / federated social web, as well as related technologies (such as anti-abuse and anti-spam techniques suitable for an open web). This group continues the work of the W3C Social Web Working Group.

More information

See the accompanying guides:

1 Like

Nice !
A friend just told about fed.ialis.me
https://github.com/ialisme/fed.ialis.me –
maybe they can link this and we can link to them here …

I dont know if this is the right thread to make my question but, like it is an introduction…

I am implementing activitypub spec and going through available projects source code to get a general idea…I what i dont still get completely is the inbox/outbox part for every user… Let try to explain…

Lets say that as user (in my server I have 5 followers, 3 local and 2 remotes in the same instance)I post a Note… I dont need an inbox for my local user(inbox is for federation only rigth?) they can get the notes from publications of who they follow. In the case of the remote users at the same instance It would be just necessary the inbox of the remote instance to post the note(which have an scope …followers) and the users in that remote instance can get all posts created for someone who they follow. Why would I need to make two requests one for each user to do the same thing? the first request create the note and in the second request like that note exist do nothing…Thats what i have seen in some implementations, and makes no sense to me.

Am i missing something? :thinking: :thinking:

[2020-03-02 15:10:32+0000] Yusto via SocialHub:

I dont know if this is the right thread to make my question but, like it is an introduction…

I am implementing activitypub spec and going through available projects source code to get a general idea…I what i dont still get completely is the inbox/outbox part for every user… Let try to explain…

Lets say that as user (in my server I have 5 followers, 3 local and 2 remotes in the same instance)I post a Note… I dont need an inbox for my local user(inbox is for federation only rigth?) they can get the notes from publications of who they follow. In the case of the remote users at the same instance It would be just necessary the inbox of the remote instance to post the note(which have an scope …followers) and the users in that remote instance can get all posts created for someone who they follow. Why would I need to make two requests one for each user to do the same thing? the first request create the note and in the second request like that note exist do nothing…Thats what i have seen in some implementations, and makes no sense to me.

Am i missing something? :thinking: :thinking:

I’m not so sure in your message as it is quite confusing, but I’ll try anyway:

Thanks for your reply.
I quite understand all that, but from programming point of view…its where i am struggling with inbox/outbox. Let me try to explain again…
User A its following user B and C, they are all in the same server, so to get a timeline for user A, I just need to query all objects created by B and C. In this case I dont need an inbox here right. User A is also following user D in a remote server, so every time user D create a Note, it is posted to user A Inbox, but why, that will be fine if it was just user A, but what if there are 100 users in that same server following User D? if user D has more people following him on that remote server it has to post in every user inbox? It wouldnt be easier to post to server inbox(why the difference between shared inbox and personal inbox?)? User D create a Note which is sent to the server inbox (where are hosted A,B,C) with a to: attr pointing to its followers, and all followers can get that object(Note) the same way as it was a local user. User D server just need to filter per unique domain of his followers, that it is to where it will send any specific activity for his followers or an specific user. It would use less band width.

I hope I could be clear enough.

[2020-03-03 13:49:27+0000] Yusto via SocialHub:

but what if there are 100 users in that same server following User D? if user D has more people following him on that remote server it has to post in every user inbox? It wouldnt be easier to post to server inbox
(why the difference between shared inbox and personal inbox?)?
User D create a Note which is sent to the server inbox (where are hosted A,B,C) with a to: attr pointing to its followers, and all followers can get that object(Note) the same way as it was a local user. User D server just need to filter per unique domain of his followers, that it is to where it will send any specific activity for his followers or an specific user. It would use less band width.

sharedInbox is what you want there, instead of sending to each user’s inbox you send to a common one. It is called shared because ActivityPub has no concept of an instance/server/node, https://example.org/users/A and https://example.org/users/B could completely use different software.

I would recommend looking at other software to get an idea of how to use ActivityPub btw, in the same way that you quite need to look at other websites to see how to use HTML.
For example in Pleroma/Mastodon/… an user inbox is /users/:username/inbox and the sharedInbox is /inbox.

And to take your example again, D sending to A, B, C would:

  • take all their sharedInbox urls (if there is one, inbox otherwise)
  • deduplicate the urls (will likely obtain only one url as A, B, C are on the same server)
  • proceed to sending it

@moderators, I think this should be split to its own topic (for findability, and to keep this one on-topic).