Hacker News new | past | comments | ask | show | jobs | submit login

It's https://masto.ai/users/mg. You can see it by running curl -H "Accept: application/ld+json".

https://www.w3.org/TR/activitypub/#obj-id




That is one of the aliases. The same holds true for ...

    https://masto.ai/users/mg
    https://masto.ai/@mg
... and the server could povide as many aliases as it wants to.

I wouldn't call those "identities". As the server could just change the aliases and the handle "@mg@masto.ai" would still work. Because it resolves to whatever aliases the server provides via the webfinger endpoint.

I have not seen anything in the specs that says the aliases are identities or should stay the same over time.


Try this:

    curl -H "Accept: application/json" https://masto.ai/users/mg/following?page=1 | jq .
Notice the people you are following are referenced by URL. If you try /followers instead, and look up the following URLs of some of your followers, you'll find that they follow you by the URL

    https://masto.ai/users/mg
If you do:

    curl -H "Accept: application/json" https://masto.ai/@mg | jq .id
You'll see that the returned document shows the id of your ActivityPub Person actor as https://masto.ai/users/mg, not https://masto.ai/@mg or @mg@masto.ai.

@mg@masto.ai can change and nothing will happen (even old mentions should still work, as at least Mastodon resolves the mentions to the Actor url and includes a mapping in the post). But if the https://masto.ai/users/mg URL changes, you will need to trigger a move, or you'll lose your followers, because from their servers point of view, that URL is your identity or in ActivityPub speak it's the identity of your Person Actor and for most purposes that's all ActivityPub cares about.

So while you can introduce aliases in webfinger, and for the purposes of webinger your id is mg@masto.ai, if the primary ID of the ActivityPub Person actor changes, you need a "movedTo" element to point to the new one, an "alsoKnownAs" to point to the old one, and trigger notifications to the servers of your followers and following for things not to break horribly. See e.g.:

    curl -H "Accept: application/json" https://mastodon.social/@vidarh | jq .movedTo
And

    curl -H "Accept: application/json" https://m.galaxybound.com/users/vidar | jq .alsoKnownAs
This is not in the ActivityPub spec - it was added as an extension as people started to want to be able to move more smoothly.

(I personally don't like this dependency on the old server in the move process, and so one of the few things I actually like about BlueSky is the ability for a user to take their data to a new server unilaterally; that could be fixed for the Fediverse without an entirely new protocol, however - it just needs a mechanism similar to the recovery key mechanism of BlueSky to let users prove who they are on a new server)

In effect, you have two identities in the Fediverse:

* You have a webfinger identity acct:mg@masto.ai

* You have an ActivityPub Person actor identity https://masto.ai/users/mg

Changing the former, or adding more of them (you can even just add a redirect on your own domain and user@yourowndomain will work and resolve to your https://masto.ai/users/mg identity; this is how my Mastodon is on m.galaxybound.com but my preferred Mastodon handle is @vidar@galaxybound.com without the "m."), is easy. Changing the latter is complex (more than it should be).


    curl -H "Accept: application/json" https://masto.ai/users/mg/following?page=1 | jq .
    Notice the people you are following are referenced by URL.
That we can see entries of the form hostname/users/username in the output of a that specific curl command is proof that it is the identity of a user as defined by the ActivityPub protocol?

Shouldn't we be able to look at the ActivityPub specs and see how the identity of a users is defined?


To quote the spec:

    'In ActivityPub, a user is represented by "actors" via the user's accounts on servers.'
and:

    'All Objects in [ActivityStreams] should have unique global identifiers. ActivityPub extends this requirement; all objects distributed by the ActivityPub protocol MUST have unique global identifiers, unless they are intentionally transient (short lived activities that are not intended to be able to be looked up, such as some kinds of chat messages or game notifications). These identifiers must fall into one of the following groups:

    1. Publicly dereferencable URIs, such as HTTPS URIs, with their authority belonging to that of their originating server. (Publicly facing content SHOULD use HTTPS URIs).

    2. An ID explicitly specified as the JSON null object, which implies an anonymous object (a part of its parent context)'
and:

    'All objects have the following properties:

    id
    The object's unique global identifier (unless the object is transient, in which case the id MAY be omitted).'
So a user is represented by an Actor, an Actor must have a global identifier, and that global identifier is the "id" field in the JSON. https://masto.ai/users/mg in your case.

(You may also search the ActivityPub spec for "webfinger"; it is not mentioned - it's a convenience offered by implementations like Mastodon, and not required by the ActivityPub spec at all; your interop with Mastodon will be harmed if you don't support it, but it'll work - users just need to input your url instead)

EDIT: to further underline the relationship of Webfinger to ActivityPub, look at the section for Actor's [1], and how the use of webfinger lookups violate the spec ("otherwise, the entered value should be considered invalid") - it's an extension/change used by things like Mastodon for user convenience, and not part of ActivityPub itself at all.

[1] https://w3c.github.io/activitypub/#actors


Awesome!

That's pretty cool. So the ID of an ActivityPub actor is simply a url.

That is great.

I think Mastodon should have made it so that the url for their users is hostname/username and that is their ID as well. That would have prevented a ton of confusion.


I think there'd have been confusion either way, with people expecting to put the URLs into a browser rather than a social app, especially as there's no uniform way of recognising that they're Fediverse-related without visiting the URL first, so I think having an indicator of that there is worth it, but e.g. the masto.ai/@mg style URL are a lot better than the masto.ai/users/mg.

The webfinger support also potentially enables some cool functionality by letting users use the same handle for multiple services. That said, I'd love to see someone set up a webfinger service that 1) lets people bring their own custom domains, 2) shows a linktree style UI if you hit host/username, 3) optionally redirects or transparently caches certain settings, 4) offer to transparently redirect requests to the user page a given resource based on Accept: header where possible (e.g. ActivityPub/ActivityStreams technically expect 'application/ld+json; profile="https://www.w3.org/ns/activitystreams" ' with the caveat that the "profile" bit is likely to be left out by a lot of clients)




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: