markjgsmith

What’s ActivityPub like really?

2023-04-26 14:14:00 +07:00 by Mark Smith

David Pierce from the Verge has an article out about ActivityPub and the future of social media protocols. It’s a great piece, well researched and really sells the decentralised social networks vision.

The crux of his pitch:

If our current social system was decentralized, you’d be able to post a picture on Instagram and I could see it and comment on it in the Twitter app. Your friends could read your tweets in their TikTok app. I could exclusively use Tumblr, and you could read all my posts in Telegram. Different apps would have different strengths and weaknesses, different moderation policies and creator tools, but you’d have the same set of followers and follow the same accounts no matter which platform you use

Sounds pretty cool.

So what is ActivityPub?

It’s a technology through which social networks can be made interoperable, connecting everything to a single social graph and content-sharing system. It’s an old standard based on even older ideas about a fundamentally different structure for social networking, one that’s much more like email or old-school web chat than any of the platforms we use now. It’s governed by open protocols, not closed platforms. It aims to give control back to users and to make sure that the social web is bigger than any single company

This new world would be very different, better in many ways:

A couple of dominant platforms would be replaced by millions of interoperable smaller ones

and

No one will be tied to a platform and any platform that tries to tie down users will lose them instead

Great I love the vision. Sounds amazing. It’s worth reading the whole article to get the full picture.

After reading that I wondered how difficult would it be to post a link from my linkblog into the ActivityPub. At which point I realised I’d brushed up against the first hurdle, because one does not simply “post to the ActivityPub”. It’s not a website, it’s a protocol. First you have to find a website that supports ActivityPub and then you post to there using the ActivityPub protocol. Fine it’s not as simple as just using the Twitter API, but how complicated can it be?

The first thing I did was check npm for ActivityPub nodejs modules. Lots of search results, but they are almost all for creating your own ActivityPub server. The activitypub-express module indeed looks very comprehensive. It appears to be quite straight forward to add ActivityPub routes and functionality to an express server. That’s great but way more than what I want to do, probably would need to hook up a database. I just want to post a link mate.

Next step was to do a Google search to find the specification, and some tutorials. The spec shows up immediately, but one glance at that will have most developers running for the exits. No one reads the W3C specifications. Fuck that shit.

But look there’s an ActivityPub Rocks! website. Hey that reminds me of when HTML5 got released. They had cool HTML5 Rocks websites for that too. This must be what I’m looking for. Click…page loads…uh…there must be some kind of mistake. This website most definitely does not rock. There’s nothing on there about posting a link. It’s all about implementing servers.

I then decide to look at existing implementations. I find that Mastondon has a tutorial about posting a message, which looks somewhat doable but it’s got Ruby code in it. Yeah I know, I should be able to replace it with nodejs but I already don’t understand a lot of the terminology, and my brain is already going yuk, especially after skimming through the horror that was the W3C spec earlier. And why do the JSON examples have property names that have differing font sizes. That’s not normal. What is this JSONish text blob? I’ll come back to this.

A bit more googling and I find this article which is a bit rambley and very hodge podge, but is reassuringly clean and nicely formatted black text on white background. It basically points out which are the important parts of the spec, and which parts can be safely skipped.

That was actually quite useful with a few good examples.

Ok so ActivityPub uses a special type of JSON called JSON-LD that includes URLs where you fetch sub parts of an object from different locations on the web. Sounds interesting but potentially complicated.

Anyway after reading the full article I have a better idea of the vocabulary being used, the various entities etc. Still feels very complicated. Plus it appears to take the form very similar to email where users have inboxes and outboxes. Which is weird because haven’t we spent the last 10 years trying to specifically get away from email?

I go back and re-read the mastodon tutorial, which makes a lot more sense now. Basically just some HTTP post requests with JSON payloads, and some sort of complicated crypto signatures. Feels quite doable but also I’m feeling like the reality of ActivityPub is very scattered and messy. I’m certainly not super eager to dive in. It has all the signs of an ecosystem littered with cracks and crevices, though there are a few large implementations so it likely does work.

The vision sounds amazing, but existing developer resources are a bit underwhelming and disorganised. I want to like ActivityPub and suspect that I probably would end up liking it, but I don’t have the time or resources to get involved, I’ll have to put a pin in this for now.

Update: this just dropped in my podcatcher as I was publishibg this blog post. I havent had a chance to download and listen to it yet but their shows are usually very good quality and sometimes include suprisingly good opto-electronic based AI generated rap:

For enquiries about my consulting, development, training and writing services, aswell as sponsorship opportunities contact me directly via email. More details about me here.