Elon Musk took over Twitter with $44 billion and began a radical reform. He wanted to create Twitter 2.0, but unexpectedly, his actions included massive layoffs and implementing dictatorship. The series of actions that followed turned Twitter into a personal publishing platform for self-promotion and marketing for some people. It seems that they made a fortune by manipulating virtual currencies through Twitter. It wouldn't be surprising if Elon Musk uses Twitter to promote his entry into politics in the future. As a result, many people started considering leaving the authoritarian Twitter platform and looking for a more open, free, and decentralized platform. With years of technical accumulation, a beautiful UI, and Twitter-like interaction logic, Mastodon has entered the public's view.
Mastodon#
Mastodon, also known as the Mammoth, I first heard about it around 2021 on a forum called "Strawberry County" (cmx.im), which led me to learn about Mastodon. Mastodon has been in development since 2016, and when I first encountered it, the UI was already very beautiful. It's not surprising that it entered the public's view in 2022 and became popular. The accumulation of such a long time made Mastodon's success inevitable.
Mastodon's open-source and decentralized (federated) nature allows individuals and organizations to set up their own Mastodon instances and join this social network. People can gather in specific instances based on their interests and beliefs, while also interacting with users from other instances. This decentralized social model is truly popular.
In simple terms, as a user, you can choose one instance from many based on your preferences, register an account, and then you can post "toots" (similar to tweets) and follow other users, as well as view your timeline, just like on Twitter. One difference from Twitter is that if the user you follow is registered on another instance, you need to locate them using their username and domain name. One thing to note is that different instances may have multiple users with the same username, so the domain name of the instance is also a crucial part. Therefore, if you want to build a personal brand, you need to consider preventing others from impersonating you by copying your username, avatar, introduction, etc. Providing a GPG public key might be a good choice. It seems that Mastodon currently does not have a mature integrated solution to prevent impersonation.
As far as I know, some universities in China have formed their own small federation. Each school is an independent Mastodon instance, and each instance is autonomously managed by students from that school. All instances in this federation can interact with each other. This small federation is called Closed Social. Interested students can check it out and set up their own school's instance and join.
Fediverse#
Actually, Mastodon is not the only platform in the Fediverse, and the term "Fediverse" was not coined by Mastodon. As early as 2008, someone proposed this concept and envisioned social and content publishing platforms that meet the criteria of independent hosting and communication through standardized protocols. If you think about it, aren't these concepts similar to email? Email has been a popular protocol since the early days of the Internet. It seems that the development process of the Internet is cyclical, with periods of centralization (better user experience in commercial companies) and decentralization (freedom and autonomy). I recommend reading this article: Mastodon, the rise of the Fediverse.
Currently, the most popular platforms in the Fediverse are Mastodon in the social domain and Matrix in the instant messaging domain. From what I know, Matrix has a more thriving technical ecosystem with numerous server and client implementations. It can also integrate with various communication apps such as Slack, Discord, Telegram, QQ, and WeChat. However, it seems that Matrix is not widely used by non-technical users, and most users are developers and tech enthusiasts. While Mastodon has many clients, there is only one official server implementation, so its technical ecosystem is not as prosperous. However, it has a large user base, especially among non-technical users. This phenomenon requires reflection. Although technology can change the world, it is not the only factor. Better UI, better interaction, and better user experience are the external driving forces for product development.
Currently, my main social media platform is still Twitter, but I am gradually transitioning to Mastodon because many people I want to follow have not settled in the Mastodon universe. As for instant messaging, apart from using QQ and WeChat for necessary communication with acquaintances, I am gradually abandoning Telegram because it is also becoming closed, authoritarian, and commercialized. I have anonymous accounts on many Matrix instances, but my friends are not willing to join the Matrix network. Therefore, my main method of communication with strangers is email. I will publicly share my email address, and anyone can email me to communicate.
In addition to the aforementioned Fediverse platforms, there are other Fediverse platforms that are not well-known to the public, covering various fields such as communication, social networking, images, music, and videos. You can explore them through the following websites:
- https://fediverse.party/en/fediverse/
- https://fediverse.info/
- https://fedi.tips/
- https://joinfediverse.wiki/Main_Page
By the way, I want to highlight one more thing, Lemmy, a forum developed in Rust for the Fediverse. It can be used as an alternative to Reddit and HackerNews, and it is lightweight and easy to use. Lemmy
ActivityPub Protocol#
I mentioned earlier that the Fediverse requires standardized protocols for communication, and Mastodon is based on the ActivityPub protocol. This protocol has a longer history than Mastodon and was recommended as a standard by the W3C in 2018.
This protocol specifies various aspects of decentralized social network interactions, including user interactions (messaging, following, liking) and activities (publishing, updating, deleting, liking, blocking, etc.).
If different platforms adhere to the same protocol, users of different platforms can interact within the same Fediverse. For example, I can perform simple interactions between Mastodon and Pixelfed, two different platforms.
I tested using a Pixelfed account (@[email protected]
) to follow my Mastodon account (@[email protected]
). I was able to successfully search for the user and view their avatar, bio, and follower count, and successfully follow them. On the Mastodon platform, I also received a notification of being followed and could view the account information of Pixelfed through Mastodon.
However, I cannot see the content I posted on Pixelfed from Mastodon, which indicates that although both applications use the ActivityPub protocol, they have their own proprietary sub-protocols for content encapsulation. These sub-protocols are not mutually compatible, and only those common compatible protocols can be used across applications, such as account information and following.
I also tried using Mastodon to view users on Lemmy and found that I could see user information and some of the posted content, but there were some inconsistencies, indicating that there are also incompatibilities between the two.
Based on the issue and PR lists of Lemmy, I see that Lemmy is working on compatibility with Mastodon. This is great, and I support it!
In addition, a GitHub employee has developed an interesting tool called ActivityPub to Mastodon bridge. The purpose of pub is not to host the ActivityPub community but to allow people who have their own domains and thus control their identity to participate in the Fediverse. This means that you can join the Mastodon federation with your own domain name without having to set up a Mastodon instance. It's convenient and easy to use.
Mastodon Performance Issues#
The official implementation of Mastodon currently uses the Ruby language, and Ruby, with the help of the Rails framework, is very suitable for developing web applications with rapidly changing requirements. However, Ruby's performance is not optimistic. Last year, Shopify developed YJIT in Rust for Ruby, which was successfully merged upstream to Ruby and officially released with Ruby 3.2. This improved Ruby's performance by about 40%, but Ruby's performance still cannot match the popular JavaScript (mainly due to the V8 engine), let alone Golang and Rust. After searching, I found that there is no server-side implementation in Golang and Rust, and even if there is, development has already stopped. How will Mastodon support hundreds of millions of users in the future? How will it compete with Twitter? Of course, the existing instances do not have such a large user base yet, but when there is a need for such performance in the future, there will naturally be commercial companies willing to invest money and effort to solve this problem.
However, I don't really want that day to come. If one Mastodon instance has tens of millions of users, it will become another "Twitter." A large number of users will gather on a single or a few mainstream instances operated by commercial companies, and the concepts of federation and decentralization will become meaningless. Let's not forget the original intention of leaving Twitter and coming to Mastodon!
That being said, I still hope that Mastodon's performance can be improved. I have also seen efforts to optimize Mastodon's performance. With the increasing number of Mastodon instances, a single Mastodon instance often needs to connect to many other instances for interaction, which puts a huge network performance pressure and forces small instance owners to spend more money on server costs. This is likely to cause some instances to detach from the Fediverse and form their own closed federations with only a few nodes. This is not what we want to see. I have seen that someone has developed an ActivityPub relay and a list of relays. Relay servers connect to numerous instances, aggregate content, and then provide it to small and medium-sized servers, allowing them to achieve the same scale of information retrieval without connecting to a large number of instances.
Social and communication platforms are undergoing changes abroad, with some breaking away from large companies. However, due to various legal restrictions in China, ordinary people have no power to create social and communication platforms. Will we miss this wave of change? Let's wait and see.
Original article link: https://zu1k.com/posts/tutorials/p2p/fediverse/