1kx: In-depth Interpretation of Decentralized Social Protocols

Foresight News
2023-12-02 10:10:08
Collection
Compare the technical solutions of mainstream Web3 social platforms from the dimensions of identity, data, and storage.

Author: 1kx

Compiled by: Luffy, Foresight News


Driven by commercial motives, corporate-controlled social media platforms have emerged and greatly undermined the initial hopes for online participatory culture. Internet information technology was supposed to fundamentally democratize cultural production, but today, these profit-driven platforms limit and shape online behavior—"likes" are not expressions of gratitude for content, but rather a commercial tool.

Alternative social media platforms built on decentralized technology and federated protocols recreate the original vision of online socializing. Data is controlled by users and recorded in decentralized databases, the front end is community-driven, moderation is an expression of community preferences, and algorithms are chosen by users. This is an innovation driven by an open-source spirit.

History of Decentralized and Alternative Social Media

Before the internet became the center of commerce, entertainment, and social interaction, it was primarily a tool for academic and military domains. Tim Berners-Lee held an egalitarian vision when developing the first web protocols: the original design of the internet was a decentralized network where information could flow freely between nodes, with no individual in control and no single point of failure.

However, with the commercialization of the internet, centralized platforms like search engines and social media giants became dominant. While these entities provide tremendous value, they have strayed from the original decentralized spirit, leading to our current Web2 environment.

1kx: In-depth Interpretation of Decentralized Social Protocols

A key innovation in the development of alternative social networks is the emergence of the federated protocol concept. A federated network refers to a system composed of multiple independent servers or "nodes" that cooperate to form a social network, as opposed to a centralized platform where one organization controls all servers.

In a federated network system, each server runs software that adheres to a shared protocol, enabling them to communicate with each other. Users registered on one server can seamlessly follow users on other servers, interact with users on other servers, and share content as if they were on the same platform. Examples of federated protocols include ActivityPub and OStatus, which support federated platforms like Mastodon and PeerTube.

In a federated system setup, users can choose the servers they trust, and they may migrate to different servers or set up their own servers, granting them more autonomy. The term "Fediverse" (a portmanteau of "federation" and "universe") is used to describe such systems. The Fediverse began with the GNU Social platform and its predecessors (Statusnet and Laconica), but the real turning point was the development and widespread adoption of the ActivityPub protocol, which was published as a W3C recommendation in 2018.

In Web3, once data is ported onto the chain, federated social networks become the default state of decentralized systems. The blockchain acts as a backend server for storing content, while the front end indexes this content and delivers it directly to users. Identities are bound to public and private key pairs that manage user wallets, allowing users to easily verify any data or content they generate. Additionally, using on-chain primitives like NFTs can bundle stored content with metadata and serve as domain names or decentralized identities (DIDs).

Similar to how ActivityPub operates, Web3 protocols seek to guide social graphs through authenticated relationships between user nodes. Since any front end can index and provide this content, there is fierce competition at the front end layer, and new features flourish. Furthermore, since data is stored on-chain, users can choose their preferred algorithms and can be incentivized to regain value from their data using certain algorithms. This, combined with more direct content monetization methods, provides a better overall experience for creators who have largely been excluded from monetization, even though their content drives demand for these platforms.

Protocol Comparison

To truly understand the innovations of decentralized social media protocols, it is necessary to understand the technologies that enable them. Notably, we do not include all social protocols here but rather select some of the most popular social protocols:

1kx: In-depth Interpretation of Decentralized Social Protocols

Identity / Namespace

In federated and decentralized social graphs or network protocols, "namespace" refers to a unique domain for user identifiers or other resources. It is a way to distinguish one domain/server from another, ensuring there are no conflicts or ambiguities when integrating or communicating across multiple domains.

The identity and associated namespaces of different decentralized social protocols range from simple key pairs (Nostr, Scuttlebutt) to URIs pointing to hosted profiles (ActivityPub), and to more complex models using on-chain primitives like NFTs (and recent ERC-6551 extensions, such as Lens V2).

Farcaster is a good example of these technologies. Farcaster accounts represent a unique entity on the network. Each account has a unique digital identifier called a Farcaster ID (fid). Identities are managed on-chain using an Ethereum contract called IdRegistry, where users initiate transactions to IdRegistry to obtain a new fid. The address that holds the fid is the user's management address. IdRegistry ensures that fids can be transferred between addresses and that no two addresses have the same fid. Farcaster also extends this namespace to support on-chain or off-chain published ENS domain names. Users must submit signed proofs to the network to claim usernames.

On the other hand, ActivityPub identifies each user through a unique URI (usually an HTTPS URL). This URI points to the user's profile and serves as their global identifier within the Fediverse. To make these URIs more user-friendly, many ActivityPub platforms use a system called Webfinger. Webfinger allows users to have identifiers like "@username@domain.com".

Lens and CyberConnect manage user profiles as NFTs. For example, in Lens, a user address holds a Profile NFT, and a single address can hold multiple Profile NFTs. Each Profile NFT encapsulates the entire history of user activity. Additionally, the Profile NFT has a FollowModule, which is essentially a set of rules for managing how different accounts can acquire Follow NFTs. These Follow NFTs directly record the relationship between accounts and profiles on-chain. There are also handles that can be created separately from profiles and can link to or unlink from another profile. Handles exist in their own namespace (e.g., lens/@alice).

Data

Data can be said to be the most important feature of decentralized networks, as the creation and standardization of data form the foundation of these systems. The most common technology for managing data here is the use of standardized formats, such as JSON and common relational objects (e.g., likes, follows). Core data objects typically include:

  • Subject & Object: Defined "subject" (e.g., user) and "object" (e.g., post or message).

  • Publication: Posts or comments are encapsulated as "publications," typically linked to external content via URL.

  • Append-only log content: Each entry (whether a post or an update) is a log of discrete content items, added and stored in sequence.

Let's delve into a few examples to understand how specific protocols work.

ActivityPub utilizes the ActivityStreams 2.0 data format (a JSON-based data structure) to represent various social interactions, such as posts or likes. The protocol consists of two main components: client-to-server (C2S) and server-to-server (S2S). C2S allows users to interact with their respective servers through client applications. In contrast, S2S facilitates communication between servers, enabling the robust federated features of the protocol.

In ActivityPub, entities are classified as "subjects" (typically user accounts or groups) and "objects" (content or actions, such as posts or likes). When a subject performs an action on an object, it creates an "activity" object, such as "create," "follow," or "like."

The Web3 social graph borrows many core ideas from ActivityPub but applies them to the blockchain. For example, the Lens Protocol introduces "publications," which encapsulate various user-generated content, such as posts, mirrors, comments, and other forms of media. Each publication is associated with a ContentURI that points to specific content stored on decentralized protocols (like IPFS or Arweave) or centralized storage services (like AWS S3). This design ensures that users' profiles and all related publications are securely stored in their personal wallets, eliminating reliance on centralized databases.

Moreover, compared to Web2 architectures, Web3 provides a more direct way to monetize user content and influence. Users can charge for the minting of Follow NFTs or integrate Collect Modules with their publications. The latter option allows them to charge minting fees for NFTs linked to their publications' ContentURI. In addition to these features, the Lens Protocol also offers a GraphQL API to abstract blockchain components from the front-end interface, providing a more user-friendly experience than previous decentralized social networks.

Ultimately, many decentralized social network protocols create append-only data structures and authenticate through user keys. For instance, on CyberConnect, each user-centered piece of data is represented as a data stream, where only the data owner is allowed to update. Each update to the data is appended to the data stream in the form of an append-only commit log, and the generated data structure becomes a hash-linked data structure known as a Merkle DAG. Data types include content, collections, comments, and subscriptions.

Scuttlebutt also employs an append-only log data structure. Each user has their own log, where each new message or action is appended after being signed by the user's identity. It also supports sharing binary data known as "blobs." These blobs can be images, videos, or any other binary content. Blobs are stored separately from the append-only logs, but references (hashes) to these blobs can be included in the logs.

For Farcaster, messages are public updates, such as posting, following, or adding profile pictures, which are encoded as protobuf and must be hashed and signed by the account signer. As long as there is sufficient storage space, users can publish messages to the Hub. The Hub checks the validity of the signer before accepting each message.

Storage

Early decentralized protocols primarily stored data off-chain. For example, Scuttlebutt uses a peer-to-peer gossip network to store data on users' local devices. This approach ensures data sovereignty, as users have complete control over their information. However, it also means that data availability depends on whether users' devices are online or if other nodes in the network have copies of the data. Over time, to manage storage space, some Scuttlebutt clients may need to implement garbage collection strategies to delete old or less relevant data.

An alternative to this peer-to-peer approach is the emergence of data storage servers. For instance, in Matrix, multiple home servers store copies of room histories and synchronize with each other. When a user sends a message (or any event) in a room, their home server broadcasts that event to other home servers, which then store the event and forward it to their connected clients. Similarly, ActivityPub allows each instance (or server) in the network to store its data, typically in a database. The choice of database (relational, NoSQL, etc.) depends on the specific implementation of the ActivityPub software. For example, the popular ActivityPub platform Mastodon uses a PostgreSQL database.

Protocols like CyberConnect, Farcaster, and Lens have adopted blockchain for storage. On-chain storage ensures data immutability and verifiability, providing a solid foundation for decentralized applications that synchronize state using underlying consensus mechanisms. However, this approach may pose scalability challenges, as each piece of data needs to be stored on-chain, potentially leading to high transaction fees and slower retrieval times.

This has led many Web3 social protocols to attempt hybrid approaches, using on-chain storage for low-frequency operations (e.g., profiles, subscriptions) while using off-chain storage for high-frequency events (e.g., likes, shares, comments) or using off-chain storage as a temporary measure to batch upload data to the chain at certain intervals.

CyberConnect employs a hash-linked list in decentralized data storage to efficiently handle frequent updates between user connections. When a connection is initiated, an "operation log" is created. Subsequent state changes (e.g., toggling between following and unfollowing) are added as new nodes to this log. While these updates are initially stored on centralized servers, they are periodically batch uploaded to decentralized storage platforms like Arweave or IPFS. To achieve fast data retrieval, nodes in the operation log are centrally stored. However, users can independently verify data integrity by browsing this hash-linked list. Even if some data queries rely on centralized servers, CyberConnect's system is designed to be fully decentralized while providing high performance.

Farcaster uses a similar hybrid approach: on-chain contracts are used for low-frequency operations that are important for consistency and decentralization. Accounts, usernames, storage, and keys are managed using a series of Ethereum contracts. Off-chain systems are used for high-frequency operations that rely on performance. Messages created by user accounts are stored and propagated on the peer-to-peer network of the Farcaster hub.

Discussion

Decentralized social protocols have the potential to radically change user experiences in digital interactions. With the acceleration of public and private key adoption driven by Web3, a broader understanding of identity primitives in this context will emerge, and the ongoing moderation and data capture by Web2 social media companies will drive more users to seek alternatives. We expect the adoption curve of these decentralized social protocols to accelerate.

To facilitate the development of innovative applications, protocol developers and open-source contributors urgently need to move beyond the basic data types and relational objects currently used at the infrastructure layer. While existing primitives adequately encompass the functionalities of traditional Web2 social media, there remains significant potential for expansion and innovation. Most of the protocols discussed here inherently support scalability within the system, providing a solid foundation for future development and open-source contributions.

However, interoperability is also crucial. While front-end developers can independently enhance functionalities, if these enhancements cannot interoperate with other applications built on the same underlying protocol, doing so may undermine the overall benefit of the system. Ensuring compatibility and seamless integration between various applications is vital for the long-term success and adoption of decentralized social protocols.

In the realm of data storage, Web3 social protocols tend to favor hybrid approaches. Allocating high-value assets like identity and primary content to on-chain primitives while assigning lower-risk content like likes to off-chain solutions, this balanced approach not only preserves the integrity and security of critical data but also provides a user experience closer to traditional social media platforms.

Decentralized networks have the potential to transform interpersonal communication, information sharing, and community building. By prioritizing user autonomy, privacy, and fostering organic relationships, these networks are paving the way for a more equitable and user-centered digital environment. Moreover, the decentralized nature of these networks contributes to the democratization of access to information and resources, alleviating the risks associated with centralized control.


ChainCatcher reminds readers to view blockchain rationally, enhance risk awareness, and be cautious of various virtual token issuances and speculations. All content on this site is solely market information or related party opinions, and does not constitute any form of investment advice. If you find sensitive information in the content, please click "Report", and we will handle it promptly.
ChainCatcher Building the Web3 world with innovators