标签: ActivityPub

  • Analysis of Decentralized Social Protocols: Nostr, ActivityPub, Farcaster, and Lens Protocol

    This article provides a comparative analysis of four prominent decentralized social protocols: Nostr, ActivityPub, Farcaster, and Lens Protocol. It delves into their design philosophies, underlying mechanisms, target audiences, and potential competitive advantages.

    Key Considerations for Evaluating Decentralized Social Protocols:

    • Account Creation and Communication: How do users establish identities and interact within the decentralized framework? This aspect examines the mechanisms for account registration, content posting, and private messaging without relying on centralized servers.
    • Data Storage and Social Graph: Where is user data, including social connections and content, stored? This is crucial for understanding data ownership, portability, and censorship resistance.
    • Content Moderation: How does the protocol address content moderation challenges, such as spam and harmful content, while upholding free speech principles?
    • Incentive Mechanisms: What incentives are in place to encourage participation from service providers and users, ensuring the protocol’s sustainability and growth?

    1. Nostr:

    • Focus: Censorship resistance and simplicity.
    • Mechanism:
      • Relies on a decentralized network of relays for message propagation.
      • Users connect to multiple relays, and messages are delivered to those shared between users.
      • Public-key cryptography ensures message authenticity and optional end-to-end encryption for private messages.
    • Data Storage: Distributed across connected relays, with optional data export and self-custody.
    • Content Moderation: Relay-specific, with most relays adopting a minimal moderation approach.
    • Incentives:
      • Low operational costs for basic relays.
      • Potential for premium services like extended data storage and content moderation as paid subscriptions.
    • Ecosystem:
      • Growing rapidly, fueled by the popularity of the Damus app.
      • Attracting a significant user base of Bitcoin enthusiasts.
      • Still in early stages, with many applications in the prototype phase.

    2. ActivityPub:

    • Focus: Decentralized alternative to traditional social media platforms.
    • Mechanism:
      • Employs a federated network of instances (servers).
      • Users register on specific instances, which communicate with each other to deliver messages.
    • Data Storage: Stored on the user’s chosen instance, with the option for export and migration.
    • Content Moderation: Instance-specific, allowing for diverse moderation policies across the network.
    • Incentives:
      • Primarily driven by community contributions and volunteer efforts.
      • Sustainability concerns due to the lack of robust monetization models for instance operators.
    • Ecosystem:
      • Mature ecosystem with established applications like Mastodon.
      • Attracts users seeking refuge from centralized censorship and control.

    3. Farcaster:

    • Focus: Building a decentralized social network with a user-friendly experience.
    • Mechanism:
      • Three-layer architecture: Ethereum blockchain for user registration, a network of hubs for data synchronization, and client applications.
      • Hubs maintain a real-time synchronized copy of the network’s data.
    • Data Storage: User IDs on the Ethereum blockchain, content and social graph on the network of hubs.
    • Content Moderation:
      • Currently unclear, potentially delegated to individual applications.
      • Early focus on curated growth through an invitation-only system.
    • Incentives:
      • Short-term reliance on low costs and community enthusiasm.
      • Long-term plans for protocol revenue sharing with hub operators.
    • Ecosystem:
      • Early stage but well-funded.
      • Aiming to balance decentralization with a smooth user experience.

    4. Lens Protocol:

    • Focus: Decentralized social graph that empowers creators and communities.
    • Mechanism:
      • Built on the Polygon blockchain, leveraging its scalability and lower transaction fees.
      • Users own their social graph data as NFTs (non-fungible tokens).
    • Data Storage:
      • Social graph data stored on the Polygon blockchain.
      • Content can be stored on-chain or off-chain using IPFS (InterPlanetary File System).
    • Content Moderation:
      • Can be implemented at the application level or through community governance mechanisms.
    • Incentives:
      • Native token ($LENS) for governance and potential monetization opportunities.
      • Enables new forms of creator monetization through NFTs and social tokens.
    • Ecosystem:
      • Rapidly growing ecosystem of applications and communities.
      • Strong focus on creator empowerment and ownership.

    Conclusion:

    The decentralized social media landscape is evolving rapidly, with each protocol offering a unique approach to address the limitations of centralized platforms. The success of these protocols will depend on their ability to attract users, foster vibrant ecosystems, and navigate the challenges of content moderation and sustainability.

  • ActivityPub:去中心化社交网络协议

    ActivityPub 是一个去中心化的社交网络协议,基于 ActivityStreams 2.0 数据格式。它提供了从客户端到服务器的 API,用于创建、更新和删除内容,以及一个从服务器到服务器的 API,用于传递通知和内容。本文将深入探讨 ActivityPub 的核心概念和实现方式。

    什么是 ActivityPub?

    ActivityPub 是一种标准化的协议,旨在实现去中心化的社交网络。它包括两个主要部分:

    1. 客户端到服务器的协议:允许用户(包括真实用户、机器人和其他自动化进程)通过他们在服务器上的账户与 ActivityPub 通信。这可以通过手机、桌面应用或网页应用实现。
    2. 服务器到服务器的协议:使去中心化网站能够共享信息和内容。

    基本概念

    在 ActivityPub 中,用户通过其在服务器上的账户表示为“actors”。每个 actor 都有一个收件箱(inbox)和发件箱(outbox),用于接收和发送消息。

    {
      "@context": "https://www.w3.org/ns/activitystreams",
      "type": "Person",
      "id": "https://social.example/alyssa/",
      "name": "Alyssa P. Hacker",
      "preferredUsername": "alyssa",
      "summary": "Lisp enthusiast hailing from MIT",
      "inbox": "https://social.example/alyssa/inbox/",
      "outbox": "https://social.example/alyssa/outbox/",
      "followers": "https://social.example/alyssa/followers/",
      "following": "https://social.example/alyssa/following/",
      "liked": "https://social.example/alyssa/liked/"
    }

    客户端到服务器的交互

    客户端通过向 actor 的发件箱(outbox)发送 POST 请求来发布活动。请求必须包含一个 Activity 对象,服务器随后会将其处理并传递到目标收件箱。

    发布活动示例

    假设 Alyssa 想给她的朋友 Ben 发送一条消息,询问他是否还书。她的消息可以表示为一个 ActivityStreams 对象,并通过 POST 请求发送到她的 outbox。

    {
      "@context": "https://www.w3.org/ns/activitystreams",
      "type": "Note",
      "to": ["https://chatty.example/ben/"],
      "attributedTo": "https://social.example/alyssa/",
      "content": "Say, did you finish reading that book I lent you?"
    }

    服务器会将此消息包装在一个 Create 活动中,并将其 POST 到 Ben 的收件箱。

    接收消息

    Alyssa 的手机会通过 GET 请求轮询她的收件箱,以获取新消息。当 Ben 回复了她的消息,她会看到如下内容:

    {
      "@context": "https://www.w3.org/ns/activitystreams",
      "type": "Create",
      "id": "https://chatty.example/ben/p/51086",
      "to": ["https://social.example/alyssa/"],
      "actor": "https://chatty.example/ben/",
      "object": {
        "type": "Note",
        "id": "https://chatty.example/ben/p/51085",
        "attributedTo": "https://chatty.example/ben/",
        "to": ["https://social.example/alyssa/"],
        "inReplyTo": "https://social.example/alyssa/posts/49e2d03d-b53a-4c4c-a95c-94a6abf45a19",
        "content": "<p>Argh, yeah, sorry, I'll get it back to you tomorrow.</p><p>I was reviewing the section on register machines, since it's been a while since I wrote one.</p>"
      }
    }

    服务器到服务器的交互

    服务器之间通过向 actor 的收件箱发送 POST 请求来传递消息。这种交互方式允许去中心化的社交网络跨不同服务器传递信息。

    示例:服务器间的消息传递

    当 Alyssa 发布一条消息到她的 outbox,服务器会查找消息的目标收件箱,并将消息 POST 到这些收件箱。这样,Ben 的服务器就能接收到 Alyssa 的消息,并将其存储在 Ben 的收件箱中。

    安全性与认证

    ActivityPub 使用认证机制来验证客户端与服务器之间、以及服务器与服务器之间的互动。为了确保内容的真实性,服务器应验证接收到的内容,确保其来自声称的 actor,并且该 actor 有权限更新资源。

    验证示例

    服务器在接收到一个活动后,应验证该活动的 idactor 属性,确保其真实性。例如:

    {
      "@context": "https://www.w3.org/ns/activitystreams",
      "type": "Like",
      "actor": "https://example.net/~mallory",
      "to": ["https://hatchat.example/sarah/", "https://example.com/peeps/john/"],
      "object": {
        "@context": {"@language": "en"},
        "id": "https://example.org/~alice/note/23",
        "type": "Note",
        "attributedTo": "https://example.org/~alice",
        "content": "I'm a goat"
      }
    }

    服务器应确保 idactor 属性合法,并查验对象是否由 actor 创建。

    结论

    ActivityPub 通过提供去中心化的社交网络协议,实现了更高的自由度和隐私保护。无论是客户端到服务器的交互,还是服务器到服务器的消息传递,ActivityPub 都为构建去中心化的社交网络提供了强大的工具。

    参考文献

    通过了解和实现 ActivityPub,我们可以构建一个更加自由和开放的互联网社交网络环境。

    image.png

人生梦想 - 关注前沿的计算机技术 acejoy.com 🐾 步子哥の博客 🐾 背多分论坛 🐾 借一步网
Page Stats: PV: 34 | UV: 30
Last updated: 2025-05-11 07:48:50
沪ICP备2024052574号-1