visit
The protocol has two main components: the inbox and the outbox. These are two API endpoints that can be accessed through the HTTP protocol. When a user wants to communicate something with the outside world (e.g., post some content), they send it to the outbox. Here, the system adds it to an appropriate list, which followers can access by reading the outbox.
A username in ActivityPub is similar to an email address. For example, my Mastodon username is @[email protected]. This means that my user information is stored on the dm.me server under the name thebojda.
//me.dm/.well-known/webfinger?resource=acct:thebojda%40me.dm
{
"subject":"acct:[email protected]",
"aliases":[
"//me.dm/@thebojda",
"//me.dm/users/thebojda"
],
"links":[
{
"rel":"//webfinger.net/rel/profile-page",
"type":"text/html",
"href":"//me.dm/@thebojda"
},
{
"rel":"self",
"type":"application/activity+json",
"href":"//me.dm/users/thebojda"
},
{
"rel":"//ostatus.org/schema/1.0/subscribe",
"template":"//me.dm/authorize_interaction?uri={uri}"
}
]
}
{
"@context": [
"//www.w3.org/ns/activitystreams",
"//w3id.org/security/v1",
{
"manuallyApprovesFollowers": "as:manuallyApprovesFollowers",
"toot": "//joinmastodon.org/ns#",
"featured": {
"@id": "toot:featured",
"@type": "@id"
},
"featuredTags": {
"@id": "toot:featuredTags",
"@type": "@id"
},
"alsoKnownAs": {
"@id": "as:alsoKnownAs",
"@type": "@id"
},
"movedTo": {
"@id": "as:movedTo",
"@type": "@id"
},
"schema": "//schema.org#",
"PropertyValue": "schema:PropertyValue",
"value": "schema:value",
"discoverable": "toot:discoverable",
"Device": "toot:Device",
"Ed25519Signature": "toot:Ed25519Signature",
"Ed25519Key": "toot:Ed25519Key",
"Curve25519Key": "toot:Curve25519Key",
"EncryptedMessage": "toot:EncryptedMessage",
"publicKeyBase64": "toot:publicKeyBase64",
"deviceId": "toot:deviceId",
"claim": {
"@type": "@id",
"@id": "toot:claim"
},
"fingerprintKey": {
"@type": "@id",
"@id": "toot:fingerprintKey"
},
"identityKey": {
"@type": "@id",
"@id": "toot:identityKey"
},
"devices": {
"@type": "@id",
"@id": "toot:devices"
},
"messageFranking": "toot:messageFranking",
"messageType": "toot:messageType",
"cipherText": "toot:cipherText",
"suspended": "toot:suspended",
"focalPoint": {
"@container": "@list",
"@id": "toot:focalPoint"
}
}
],
"id": "//me.dm/users/thebojda",
"type": "Person",
"following": "//me.dm/users/thebojda/following",
"followers": "//me.dm/users/thebojda/followers",
"inbox": "//me.dm/users/thebojda/inbox",
"outbox": "//me.dm/users/thebojda/outbox",
"featured": "//me.dm/users/thebojda/collections/featured",
"featuredTags": "//me.dm/users/thebojda/collections/tags",
"preferredUsername": "thebojda",
"name": "Laszlo Fazekas",
"summary": "<p>Software developer, contributing writer</p>",
"url": "//me.dm/@thebojda",
"manuallyApprovesFollowers": false,
"discoverable": false,
"published": "2023-03-02T00:00:00Z",
"devices": "//me.dm/users/thebojda/collections/devices",
"publicKey": {
"id": "//me.dm/users/thebojda#main-key",
"owner": "//me.dm/users/thebojda",
"publicKeyPem": "-----BEGIN PUBLIC KEY----- MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAxlvpgcOxBikiXfm9snZt EB3Y2BSnBW3s8nd1d4Z1wCzaNfa/woB6RDQJoQYEISbMpkEyWhDzI4jRDafpn5/j YiyyGka9U2KZHv1to0Ej9uVwUcQOnsq9iUtJGhOWCP27blKGTLKFEHtPL2Y4hp4Z kYzlh1x0aAyw8YC7/nbS8WDAeZNS7R3ET7Syhp3LKiCMmL1aCLSoOQJ5DdxVikMJ rJ9bzlUjxzCsm1aNBB0i269t4fD1evBO8QDhEAOnAZ6wLEV74j9SCjYMvKRV8z5i PQbhbKntXjn1XhbkIkj1D+yGRYYfnm1XyWTuaM4mDllvuOyqJ8GQVFADLc6KCQYz 7QIDAQAB -----END PUBLIC KEY----- "
},
"tag": [],
"endpoints": {
"sharedInbox": "//me.dm/inbox"
},
"icon": {
"type": "Image",
"mediaType": "image/jpeg",
"url": "//media.me.dm/accounts/avatars/109/955/144/019/799/820/original/fe8e930e0f1467ac.jpeg"
}
}
{
"@context": "//www.w3.org/ns/activitystreams",
"id": "//me.dm/users/thebojda/outbox",
"type": "OrderedCollection",
"totalItems": 1,
"first": "//me.dm/users/thebojda/outbox?page=true",
"last": "//me.dm/users/thebojda/outbox?min_id=0&page=true"
}
{
"@context": [
"//www.w3.org/ns/activitystreams",
{
"ostatus": "//ostatus.org#",
"atomUri": "ostatus:atomUri",
"inReplyToAtomUri": "ostatus:inReplyToAtomUri",
"conversation": "ostatus:conversation",
"sensitive": "as:sensitive",
"toot": "//joinmastodon.org/ns#",
"votersCount": "toot:votersCount"
}
],
"id": "//me.dm/users/thebojda/outbox?page=true",
"type": "OrderedCollectionPage",
"prev": "//me.dm/users/thebojda/outbox?min_id=5562038&page=true",
"partOf": "//me.dm/users/thebojda/outbox",
"orderedItems": [
{
"id": "//me.dm/users/thebojda/statuses/5562038/activity",
"type": "Create",
"actor": "//me.dm/users/thebojda",
"published": "2023-03-02T18:47:47Z",
"to": [
"//www.w3.org/ns/activitystreams#Public"
],
"cc": [
"//me.dm/users/thebojda/followers"
],
"object": {
"id": "//me.dm/users/thebojda/statuses/5562038",
"type": "Note",
"summary": null,
"inReplyTo": null,
"published": "2023-03-02T18:47:47Z",
"url": "//me.dm/@thebojda/5562038",
"attributedTo": "//me.dm/users/thebojda",
"to": [
"//www.w3.org/ns/activitystreams#Public"
],
"cc": [
"//me.dm/users/thebojda/followers"
],
"sensitive": false,
"atomUri": "//me.dm/users/thebojda/statuses/5562038",
"inReplyToAtomUri": null,
"conversation": "tag:me.dm,2023-03-02:objectId=1406005:objectType=Conversation",
"content": "<p>My "ars poetica": How to Change the World?! Pocket Guide for People With a Messiah Complex <a href=\"//medium.com/geekculture/how-to-change-the-world-pocket-guide-for-people-with-a-messiah-complex-dd2d16bb92a\" target=\"_blank\" rel=\"nofollow noopener noreferrer\"><span class=\"invisible\">//</span><span class=\"ellipsis\">medium.com/geekculture/how-to-</span><span class=\"invisible\">change-the-world-pocket-guide-for-people-with-a-messiah-complex-dd2d16bb92a</span></a></p>",
"contentMap": {
"en": "<p>My "ars poetica": How to Change the World?! Pocket Guide for People With a Messiah Complex <a href=\"//medium.com/geekculture/how-to-change-the-world-pocket-guide-for-people-with-a-messiah-complex-dd2d16bb92a\" target=\"_blank\" rel=\"nofollow noopener noreferrer\"><span class=\"invisible\">//</span><span class=\"ellipsis\">medium.com/geekculture/how-to-</span><span class=\"invisible\">change-the-world-pocket-guide-for-people-with-a-messiah-complex-dd2d16bb92a</span></a></p>"
},
"attachment": [],
"tag": [],
"replies": {
"id": "//me.dm/users/thebojda/statuses/5562038/replies",
"type": "Collection",
"first": {
"type": "CollectionPage",
"next": "//me.dm/users/thebojda/statuses/5562038/replies?only_other_accounts=true&page=true",
"partOf": "//me.dm/users/thebojda/statuses/5562038/replies",
"items": []
}
}
}
}
]
}
As can be seen, ActivityPub is a relatively simple standard that is easy to understand and implement. Its only weakness is that it uses the HTTP protocol, which requires a central server. This gave rise to alternative protocols such as Nostr, which is Jack Dorsey's (the founder of Twitter) favorite project.
One perfect solution for decentralizing descriptive data and feeds is to use or (I have a full article about these protocols). In the case of Ethereum Swarm, the feed identifier is a Swarm address, while in the case of IPNS, it is a public key.
With these few small extensions, ActivityPub can be made completely decentralized and "web3 compatible", without the need for introducing new protocols like Nostr.