Hello everyone.
I am relatively new here on Lemmy, and the Fediverse, and there is still a lot I am trying to learn.
I think I understand the general theory of how the different instances and communities work here on Lemmy, but I’m struggling to understand how the different federated software interacts with each other.
For example, I understand that it is possible to follow a community, commenting on its posts, or a user subscribed to Lemmy even from Mastodon. Similarly, it is possible to follow an author on Write.as, again through Mastodon.
What I wanted to understand is what software in the Fediverse interacts with each other, how, and how do you get them to interact.
I hope someone can help me better understand how things work, as I find the idea of the Fediverse absolutely fascinating, a real breath of fresh air in the modern Internet landscape.

  • polaris64@lemmy.ml
    link
    fedilink
    English
    arrow-up
    15
    ·
    1 year ago

    Every user, post, community, etc. on each of these services is represented as an ActivityPub object. Let’s take the example of following your Lemmy user from Mastodon. I can search for @[email protected] in Mastodon and in the background my Mastodon instance will issue the following WebFinger request to lemmy.ml: https://lemmy.ml/.well-known/webfinger?resource=acct:[email protected]. This will return the following JSON: -

    {
      "subject": "acct:[email protected]",
      "links": [
        {
          "rel": "http://webfinger.net/rel/profile-page",
          "type": "text/html",
          "href": "https://lemmy.ml/u/Gohos"
        },
        {
          "rel": "self",
          "type": "application/activity+json",
          "href": "https://lemmy.ml/u/Gohos",
          "properties": {
            "https://www.w3.org/ns/activitystreams#type": "Person"
          }
        }
      ]
    }
    

    From here I can request the application/activity+json URL at https://lemmy.ml/u/Gohos and if I request JSON I get: -

    {
      "@context": [
        "https://www.w3.org/ns/activitystreams",
        "https://w3id.org/security/v1",
        {
          "lemmy": "https://join-lemmy.org/ns#",
          "litepub": "http://litepub.social/ns#",
          "pt": "https://joinpeertube.org/ns#",
          "sc": "http://schema.org/",
          "ChatMessage": "litepub:ChatMessage",
          "commentsEnabled": "pt:commentsEnabled",
          "sensitive": "as:sensitive",
          "matrixUserId": "lemmy:matrixUserId",
          "postingRestrictedToMods": "lemmy:postingRestrictedToMods",
          "removeData": "lemmy:removeData",
          "stickied": "lemmy:stickied",
          "moderators": {
            "@type": "@id",
            "@id": "lemmy:moderators"
          },
          "expires": "as:endTime",
          "distinguished": "lemmy:distinguished",
          "language": "sc:inLanguage",
          "identifier": "sc:identifier"
        }
      ],
      "type": "Person",
      "id": "https://lemmy.ml/u/Gohos",
      "preferredUsername": "Gohos",
      "inbox": "https://lemmy.ml/u/Gohos/inbox",
      "outbox": "https://lemmy.ml/u/Gohos/outbox",
      "publicKey": {
        "id": "https://lemmy.ml/u/Gohos#main-key",
        "owner": "https://lemmy.ml/u/Gohos",
        "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAwDc9TbmcvR/eRx0zuXl5\nqUu8vwcU3K1/70BqLdae/HtbjqXoHbVUI3exSVOTLVmPQ4oHjf6Lq5axyRRwihTh\nbDgWYSBCqZ07L6VrgXVg2APCkFpX32XlbFbbMQDXf+kodj6YrzwelXEJ03eTDKaa\nuFkFt0Uelu1k0AZVydGYT3U2iZ0jNGvpUMWQycTJ/k0r8n61JLuEMkvkVlH4ZDGb\nGTjwjLRds/zawe8FAK/Grn+AW/UTmW/1kBLcqhkeRYzWhyrVy+/f9jf03s0rW92w\n8PWM02AAE9edIpnK2XgElfkVWJenQzw7WDp045XPHMlUh5iizAJGcPAzdeEVNLq8\nGQIDAQAB\n-----END PUBLIC KEY-----\n"
      },
      "endpoints": {
        "sharedInbox": "https://lemmy.ml/inbox"
      },
      "published": "2023-06-03T17:30:16.990908+00:00"
    }
    

    This includes two important properties: inbox and outbox. Using ActivityPub I now know I can send you a message by POSTing a request to your inbox and I can fetch posts, comments, etc. you’ve made via your outbox.

    Your public key is also included. This is how, if you sent me a message, I can verify that the message actually came from you.

    That’s a very brief overview but I hope that helps!