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).