Skip to content

Bob follows Alice

given: "alice" created an actor on "abel" called "alice"

send.alice.request.create_actor
{
  "base_url": "http://abel",
  "preferred_username": "alice",
  "profile": {},
  "automatically_accept_followers": null,
  "name": null
}
receive.alice.response.create_actor
{
  "attachment": null,
  "@context": [
    "https://www.w3.org/ns/activitystreams",
    "https://w3id.org/security/v1"
  ],
  "publicKey": {
    "id": "http://abel/actor/07-Dg2zwuBXBfOHLWVRJsg#legacy-key-1",
    "owner": "http://abel/actor/07-Dg2zwuBXBfOHLWVRJsg",
    "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA4s7m9quUe/zX0DK8ShmR\nikPC352GTJzoMDOkpdSHt3+GSx5rC1kojiE3X0i5Eggi01cAPYh0R+8wTrFd/bUq\n9UP06VZNCC5j1BPn7LhsjLLp1+x3wpe/xYwSyD0VqxmG1T7ZxbbLIvUzFVOMCGmf\n9YjdIS27jwo2s+6PLcymIx6AVIjpWpLMAniBAzDgAE3ejOAaGeuukGitJ9BclNZ0\n0TiaigAdWFlRPzCVv4ZqG0t6W8rABp2ujZWLplbBaDE1xjnHvvaxz3mdSfypOZIF\nRXU6kJAG7pM23CCwIyEWFcrccw07WRR8/Y/wmiOcPa5t77EcLRdijOn08FyHv+I1\nPQIDAQAB\n-----END PUBLIC KEY-----\n"
  },
  "id": "http://abel/actor/07-Dg2zwuBXBfOHLWVRJsg",
  "type": "Person",
  "inbox": "http://abel/inbox/PXn1o7iP8SmsafYFkCSqQg",
  "outbox": "http://abel/outbox/gpuWJeP_G2LRYf8pcFmgSA",
  "followers": "http://abel/followers/mKQ6dmUG8QC2ynqdQn9lbw",
  "following": "http://abel/following/r5S9g2BQEKSnhycXXL6fcw",
  "preferredUsername": "alice",
  "name": "alice",
  "identifiers": [
    "acct:alice@abel",
    "http://abel/actor/07-Dg2zwuBXBfOHLWVRJsg"
  ],
  "endpoints": {
    "sharedInbox": "http://abel/shared_inbox"
  }
}

given: "bob" created an actor on "banach" called "bob"

send.bob.request.create_actor
{
  "base_url": "http://banach",
  "preferred_username": "bob",
  "profile": {},
  "automatically_accept_followers": null,
  "name": null
}
receive.bob.response.create_actor
{
  "attachment": null,
  "@context": [
    "https://www.w3.org/ns/activitystreams",
    "https://w3id.org/security/v1"
  ],
  "publicKey": {
    "id": "http://banach/actor/OhppXmXzNfRvcWiwJ2FLcQ#legacy-key-1",
    "owner": "http://banach/actor/OhppXmXzNfRvcWiwJ2FLcQ",
    "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAxUpx4PQw1kZxgTLmCKD/\n60Kw10tMnJorjK97QpyZ3y/pjHkUZ9PR/5HpkUf7XKROZ9Nb0hr6Ot+tXAxcWK9a\nw2/nokhxDz3xLimFn9wGNfFKt/kAEltGw2tsLa46BO4roesvFuGTwMnhpjLDida4\nR+GTl/9NjuEyAk+YTVAo4CogJRt2X4hVn/gkCzjHUV/h0HuWLqiEpfUN3kFrE/Hy\n525JDmflF5djz9Vq2Wc82TsA6natnWEGPEJ9WRd8efQEg1cZQ5bnUGsd7u1gl/J8\ny+Nsd5mS3uVvogmlsL1hh9VqvK6lcn+c1VrJ/Fy2xHsV1EerLf6bFNtkGHh2Up+V\nTQIDAQAB\n-----END PUBLIC KEY-----\n"
  },
  "id": "http://banach/actor/OhppXmXzNfRvcWiwJ2FLcQ",
  "type": "Person",
  "inbox": "http://banach/inbox/VnfxbxPJtK9MrSz9Q99VJA",
  "outbox": "http://banach/outbox/vwT-XqTxL1xuqavqYaAeQQ",
  "followers": "http://banach/followers/pbZwVDNNzO_d47bvpx3Glw",
  "following": "http://banach/following/fGp2S_9rf-w63IfWhMGvoA",
  "preferredUsername": "bob",
  "name": "bob",
  "identifiers": [
    "acct:bob@banach",
    "http://banach/actor/OhppXmXzNfRvcWiwJ2FLcQ"
  ],
  "endpoints": {
    "sharedInbox": "http://banach/shared_inbox"
  }
}

when: "bob" sends "alice" a Follow Activity

send.bob.trigger.send_message
{
  "actor": "http://banach/actor/OhppXmXzNfRvcWiwJ2FLcQ",
  "data": {
    "@context": "https://www.w3.org/ns/activitystreams",
    "type": "Follow",
    "actor": "http://banach/actor/OhppXmXzNfRvcWiwJ2FLcQ",
    "to": [
      "http://abel/actor/07-Dg2zwuBXBfOHLWVRJsg"
    ],
    "id": "follow:9e8ce039-8f89-4ac5-a380-c3d7797c459d",
    "published": "2025-02-23T08:46:05Z",
    "object": "http://abel/actor/07-Dg2zwuBXBfOHLWVRJsg"
  }
}
receive.bob.outgoing
{
  "actor": "http://banach/actor/OhppXmXzNfRvcWiwJ2FLcQ",
  "event_type": "outgoing",
  "data": {
    "raw": {
      "@context": "https://www.w3.org/ns/activitystreams",
      "type": "Follow",
      "actor": "http://banach/actor/OhppXmXzNfRvcWiwJ2FLcQ",
      "to": [
        "http://abel/actor/07-Dg2zwuBXBfOHLWVRJsg"
      ],
      "id": "follow:9e8ce039-8f89-4ac5-a380-c3d7797c459d",
      "published": "2025-02-23T08:46:05Z",
      "object": "http://abel/actor/07-Dg2zwuBXBfOHLWVRJsg"
    },
    "recipients": {
      "recipients": [
        "http://abel/actor/07-Dg2zwuBXBfOHLWVRJsg"
      ],
      "public": false
    }
  }
}
receive.alice.incoming
{
  "actor": "http://abel/actor/07-Dg2zwuBXBfOHLWVRJsg",
  "event_type": "incoming",
  "data": {
    "raw": {
      "@context": "https://www.w3.org/ns/activitystreams",
      "type": "Follow",
      "actor": "http://banach/actor/OhppXmXzNfRvcWiwJ2FLcQ",
      "to": [
        "http://abel/actor/07-Dg2zwuBXBfOHLWVRJsg"
      ],
      "id": "follow:9e8ce039-8f89-4ac5-a380-c3d7797c459d",
      "published": "2025-02-23T08:46:05Z",
      "object": "http://abel/actor/07-Dg2zwuBXBfOHLWVRJsg"
    },
    "recipients": {
      "recipients": [
        "http://abel/actor/07-Dg2zwuBXBfOHLWVRJsg"
      ],
      "public": false
    }
  }
}

when: "alice" sends an Accept to this Follow Activity

send.alice.trigger.send_message
{
  "actor": "http://abel/actor/07-Dg2zwuBXBfOHLWVRJsg",
  "data": {
    "@context": "https://www.w3.org/ns/activitystreams",
    "type": "Accept",
    "actor": "http://abel/actor/07-Dg2zwuBXBfOHLWVRJsg",
    "to": [
      "http://banach/actor/OhppXmXzNfRvcWiwJ2FLcQ"
    ],
    "published": "2025-02-23T08:46:06Z",
    "object": "follow:9e8ce039-8f89-4ac5-a380-c3d7797c459d",
    "id": "accept:6830e649-10a3-453f-9b4a-768a901ae1a0"
  }
}
receive.alice.outgoing
{
  "actor": "http://abel/actor/07-Dg2zwuBXBfOHLWVRJsg",
  "event_type": "outgoing",
  "data": {
    "raw": {
      "@context": "https://www.w3.org/ns/activitystreams",
      "type": "Accept",
      "actor": "http://abel/actor/07-Dg2zwuBXBfOHLWVRJsg",
      "to": [
        "http://banach/actor/OhppXmXzNfRvcWiwJ2FLcQ"
      ],
      "published": "2025-02-23T08:46:06Z",
      "object": "follow:9e8ce039-8f89-4ac5-a380-c3d7797c459d",
      "id": "accept:6830e649-10a3-453f-9b4a-768a901ae1a0"
    },
    "recipients": {
      "recipients": [
        "http://banach/actor/OhppXmXzNfRvcWiwJ2FLcQ"
      ],
      "public": false
    }
  }
}
receive.bob.incoming
{
  "actor": "http://banach/actor/OhppXmXzNfRvcWiwJ2FLcQ",
  "event_type": "incoming",
  "data": {
    "raw": {
      "@context": "https://www.w3.org/ns/activitystreams",
      "type": "Accept",
      "actor": "http://abel/actor/07-Dg2zwuBXBfOHLWVRJsg",
      "to": [
        "http://banach/actor/OhppXmXzNfRvcWiwJ2FLcQ"
      ],
      "published": "2025-02-23T08:46:06Z",
      "object": "follow:9e8ce039-8f89-4ac5-a380-c3d7797c459d",
      "id": "accept:6830e649-10a3-453f-9b4a-768a901ae1a0"
    },
    "recipients": {
      "recipients": [
        "http://banach/actor/OhppXmXzNfRvcWiwJ2FLcQ"
      ],
      "public": false
    }
  }
}

then: The "followers" collection of "alice" contains "bob"

send.alice.request.fetch
{
  "actor": "http://abel/actor/07-Dg2zwuBXBfOHLWVRJsg",
  "uri": "http://abel/followers/mKQ6dmUG8QC2ynqdQn9lbw"
}
receive.alice.response.fetch
{
  "actor": "http://abel/actor/07-Dg2zwuBXBfOHLWVRJsg",
  "uri": "http://abel/followers/mKQ6dmUG8QC2ynqdQn9lbw",
  "data": {
    "@context": "https://www.w3.org/ns/activitystreams",
    "id": "http://abel/followers/mKQ6dmUG8QC2ynqdQn9lbw",
    "type": "OrderedCollection",
    "totalItems": 1,
    "orderedItems": [
      "http://banach/actor/OhppXmXzNfRvcWiwJ2FLcQ"
    ]
  }
}

then: The "following" collection of "bob" contains "alice"

send.bob.request.fetch
{
  "actor": "http://banach/actor/OhppXmXzNfRvcWiwJ2FLcQ",
  "uri": "http://banach/following/fGp2S_9rf-w63IfWhMGvoA"
}
receive.bob.response.fetch
{
  "actor": "http://banach/actor/OhppXmXzNfRvcWiwJ2FLcQ",
  "uri": "http://banach/following/fGp2S_9rf-w63IfWhMGvoA",
  "data": {
    "@context": "https://www.w3.org/ns/activitystreams",
    "id": "http://banach/following/fGp2S_9rf-w63IfWhMGvoA",
    "type": "OrderedCollection",
    "totalItems": 1,
    "orderedItems": [
      "http://abel/actor/07-Dg2zwuBXBfOHLWVRJsg"
    ]
  }
}