paint-brush
ActivityPub에 대한 간략한 소개: 소셜 네트워크의 미래~에 의해@thebojda
7,893 판독값
7,893 판독값

ActivityPub에 대한 간략한 소개: 소셜 네트워크의 미래

~에 의해 Laszlo Fazekas10m2023/10/07
Read on Terminal Reader

너무 오래; 읽다

ActivityPub은 World Wide Web에 의해 표준화된 개방형 분산 소셜 네트워크 프로토콜입니다. 유일한 약점은 중앙 서버가 필요한 HTTP 프로토콜을 사용한다는 것입니다. ActivityPub 프로토콜은 이미 존재하는 분산형 프로토콜에 대한 지원으로 확장되어야 하며, 이를 통해 Fediverse는 더욱 개방적이고 분산화된 방향으로 발전할 수 있습니다.
featured image - ActivityPub에 대한 간략한 소개: 소셜 네트워크의 미래
Laszlo Fazekas HackerNoon profile picture

ActivityPub은 World Wide Web Consortium에서 표준화한 개방형 분산 소셜 네트워크 프로토콜입니다. 2018년에 첫 번째 버전이 출시되었기 때문에 새로운 것은 아닙니다. 이는 Elon Musk가 트위터를 인수하고 많은 사람들을 만족시키지 못하는 변경을 가했을 때 최근 인기가 크게 증가한 Mastodon을 포함한 여러 소셜 네트워크에서 사용됩니다.


또한 Tumblr와 Facebook의 Twitter 대신 Threads도 향후 이 프로토콜을 지원할 것이라는 신호를 보냈습니다. 새로운 프로토콜은 아니지만 ActivityPub은 이제 점점 인기를 얻고 있습니다.


유럽연합과 미국은 오랫동안 대규모 소셜 네트워크의 시장 독점을 우려해왔기 때문에 앞으로는 정부의 압력을 받아 페이스북, 트위터 등 기존의 최대 소셜 네트워크도 프로토콜을 지원하고 Fediverse 의 일부입니다. (Fediverse는 ActivityPub을 지원하는 제공업체로 구성된 소셜 네트워크의 세계입니다.)


앞으로는 트위터나 페이스북이 폐쇄되고 다른 선택의 여지가 없기 때문에 우리는 선택하지 않을 것이라고 믿습니다.


각 플랫폼의 강점은 들어오는 엄청난 양의 데이터를 필터링하고 사용자에게 가장 중요한 정보를 선별, 선택 및 요약하는 더 나은 인공 지능을 갖춘 사람에게서 나옵니다.


물론 이를 위해서는 사용자를 잘 알아야 하며, 이는 사용자에게도 이익이 됩니다. 그 대가로 인공지능은 훨씬 더 관련성이 높은 광고를 제공할 수 있습니다.


개방적이고 접근 가능한 시스템에서 경쟁은 더 이상 소셜 네트워크 사이가 아니라 인공 지능 기반 알고리즘 사이에서 이루어집니다.


ActivityPub이 어떻게 작동하는지 살펴보겠습니다. 기본 기능은 이 매우 간단한 다이어그램에 잘 요약되어 있습니다.

ActivityPub 설명


출처: https://activitypub.rocks/



프로토콜에는 받은 편지함과 보낸 편지함이라는 두 가지 주요 구성 요소가 있습니다. 이는 HTTP 프로토콜을 통해 액세스할 수 있는 두 개의 API 엔드포인트입니다. 사용자가 외부 세계와 무언가 통신하고 싶을 때(예: 일부 콘텐츠 게시) 이를 보낼 편지함으로 보냅니다. 여기에서 시스템은 팔로워가 보낼 편지함을 읽어 액세스할 수 있는 적절한 목록에 이를 추가합니다.


외부 세계의 누군가가 사용자에게 무언가(예: 특정 사용자만 볼 수 있는 비공개 게시물)를 보내려는 경우 암호화된 형식으로 받은 편지함으로 보냅니다. 받은 편지함은 들어오는 콘텐츠가 수집되고 사용자가 액세스할 수 있는 이메일 받은 편지함과 같습니다.


WebFinger 프로토콜을 사용하여 받은 편지함과 보낸 편지함의 위치를 검색할 수 있습니다. 이는 프로토콜을 실험하고 이해하기 위한 뛰어난 도구인 ActivityPub Explorer 의 도움으로 테스트할 수도 있습니다.


ActivityPub의 사용자 이름은 이메일 주소와 유사합니다. 예를 들어 내 Mastodon 사용자 이름은 @[email protected]입니다. 이는 내 사용자 정보가 thebojda라는 이름으로 dm.me 서버에 저장된다는 의미입니다.


ActivityPub Explorer에 들어가면 WebFinger 프로토콜에 따라 다음 URL을 쿼리하여 데이터를 검색합니다.


 https://me.dm/.well-known/webfinger?resource=acct:thebojda%40me.dm


응답은 다음과 같은 JSON 개체입니다.


 { "subject":"acct:[email protected]", "aliases":[ "https://me.dm/@thebojda", "https://me.dm/users/thebojda" ], "links":[ { "rel":"http://webfinger.net/rel/profile-page", "type":"text/html", "href":"https://me.dm/@thebojda" }, { "rel":"self", "type":"application/activity+json", "href":"https://me.dm/users/thebojda" }, { "rel":"http://ostatus.org/schema/1.0/subscribe", "template":"https://me.dm/authorize_interaction?uri={uri}" } ] }


ActivityPub 정보는 https://me.dm/users/thebojda URL에서 액세스할 수 있음을 여기에서 확인할 수 있습니다. 이를 ActivityPub Explorer에 입력하면 다음 JSON이 반환됩니다.


 { "@context": [ "https://www.w3.org/ns/activitystreams", "https://w3id.org/security/v1", { "manuallyApprovesFollowers": "as:manuallyApprovesFollowers", "toot": "http://joinmastodon.org/ns#", "featured": { "@id": "toot:featured", "@type": "@id" }, "featuredTags": { "@id": "toot:featuredTags", "@type": "@id" }, "alsoKnownAs": { "@id": "as:alsoKnownAs", "@type": "@id" }, "movedTo": { "@id": "as:movedTo", "@type": "@id" }, "schema": "http://schema.org#", "PropertyValue": "schema:PropertyValue", "value": "schema:value", "discoverable": "toot:discoverable", "Device": "toot:Device", "Ed25519Signature": "toot:Ed25519Signature", "Ed25519Key": "toot:Ed25519Key", "Curve25519Key": "toot:Curve25519Key", "EncryptedMessage": "toot:EncryptedMessage", "publicKeyBase64": "toot:publicKeyBase64", "deviceId": "toot:deviceId", "claim": { "@type": "@id", "@id": "toot:claim" }, "fingerprintKey": { "@type": "@id", "@id": "toot:fingerprintKey" }, "identityKey": { "@type": "@id", "@id": "toot:identityKey" }, "devices": { "@type": "@id", "@id": "toot:devices" }, "messageFranking": "toot:messageFranking", "messageType": "toot:messageType", "cipherText": "toot:cipherText", "suspended": "toot:suspended", "focalPoint": { "@container": "@list", "@id": "toot:focalPoint" } } ], "id": "https://me.dm/users/thebojda", "type": "Person", "following": "https://me.dm/users/thebojda/following", "followers": "https://me.dm/users/thebojda/followers", "inbox": "https://me.dm/users/thebojda/inbox", "outbox": "https://me.dm/users/thebojda/outbox", "featured": "https://me.dm/users/thebojda/collections/featured", "featuredTags": "https://me.dm/users/thebojda/collections/tags", "preferredUsername": "thebojda", "name": "Laszlo Fazekas", "summary": "<p>Software developer, contributing writer</p>", "url": "https://me.dm/@thebojda", "manuallyApprovesFollowers": false, "discoverable": false, "published": "2023-03-02T00:00:00Z", "devices": "https://me.dm/users/thebojda/collections/devices", "publicKey": { "id": "https://me.dm/users/thebojda#main-key", "owner": "https://me.dm/users/thebojda", "publicKeyPem": "-----BEGIN PUBLIC KEY----- MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAxlvpgcOxBikiXfm9snZt EB3Y2BSnBW3s8nd1d4Z1wCzaNfa/woB6RDQJoQYEISbMpkEyWhDzI4jRDafpn5/j YiyyGka9U2KZHv1to0Ej9uVwUcQOnsq9iUtJGhOWCP27blKGTLKFEHtPL2Y4hp4Z kYzlh1x0aAyw8YC7/nbS8WDAeZNS7R3ET7Syhp3LKiCMmL1aCLSoOQJ5DdxVikMJ rJ9bzlUjxzCsm1aNBB0i269t4fD1evBO8QDhEAOnAZ6wLEV74j9SCjYMvKRV8z5i PQbhbKntXjn1XhbkIkj1D+yGRYYfnm1XyWTuaM4mDllvuOyqJ8GQVFADLc6KCQYz 7QIDAQAB -----END PUBLIC KEY----- " }, "tag": [], "endpoints": { "sharedInbox": "https://me.dm/inbox" }, "icon": { "type": "Image", "mediaType": "image/jpeg", "url": "https://media.me.dm/accounts/avatars/109/955/144/019/799/820/original/fe8e930e0f1467ac.jpeg" } }


여기에서 나에 대한 모든 사용자별 정보를 찾을 수 있지만 가장 중요한 것은 받은 편지함 및 보낸 편지함 끝점의 URL과 나에게 보낸 메시지를 암호화하기 위한 공개 키가 여기에 있다는 것입니다. 보낼 편지함의 콘텐츠를 쿼리하면 다음 JSON이 반환됩니다.


 { "@context": "https://www.w3.org/ns/activitystreams", "id": "https://me.dm/users/thebojda/outbox", "type": "OrderedCollection", "totalItems": 1, "first": "https://me.dm/users/thebojda/outbox?page=true", "last": "https://me.dm/users/thebojda/outbox?min_id=0&page=true" }


게시물이 페이지로 나누어져 있으므로 여기서는 첫 번째 페이지와 마지막 페이지의 URL을 볼 수 있습니다. 첫 번째 페이지의 URL에 액세스하면 현재 항목이 하나만 있는 내 항목을 볼 수 있습니다.


 { "@context": [ "https://www.w3.org/ns/activitystreams", { "ostatus": "http://ostatus.org#", "atomUri": "ostatus:atomUri", "inReplyToAtomUri": "ostatus:inReplyToAtomUri", "conversation": "ostatus:conversation", "sensitive": "as:sensitive", "toot": "http://joinmastodon.org/ns#", "votersCount": "toot:votersCount" } ], "id": "https://me.dm/users/thebojda/outbox?page=true", "type": "OrderedCollectionPage", "prev": "https://me.dm/users/thebojda/outbox?min_id=109955178005562038&page=true", "partOf": "https://me.dm/users/thebojda/outbox", "orderedItems": [ { "id": "https://me.dm/users/thebojda/statuses/109955178005562038/activity", "type": "Create", "actor": "https://me.dm/users/thebojda", "published": "2023-03-02T18:47:47Z", "to": [ "https://www.w3.org/ns/activitystreams#Public" ], "cc": [ "https://me.dm/users/thebojda/followers" ], "object": { "id": "https://me.dm/users/thebojda/statuses/109955178005562038", "type": "Note", "summary": null, "inReplyTo": null, "published": "2023-03-02T18:47:47Z", "url": "https://me.dm/@thebojda/109955178005562038", "attributedTo": "https://me.dm/users/thebojda", "to": [ "https://www.w3.org/ns/activitystreams#Public" ], "cc": [ "https://me.dm/users/thebojda/followers" ], "sensitive": false, "atomUri": "https://me.dm/users/thebojda/statuses/109955178005562038", "inReplyToAtomUri": null, "conversation": "tag:me.dm,2023-03-02:objectId=1406005:objectType=Conversation", "content": "<p>My &quot;ars poetica&quot;: How to Change the World?! Pocket Guide for People With a Messiah Complex <a href=\"https://medium.com/geekculture/how-to-change-the-world-pocket-guide-for-people-with-a-messiah-complex-dd2d16bb92a\" target=\"_blank\" rel=\"nofollow noopener noreferrer\"><span class=\"invisible\">https://</span><span class=\"ellipsis\">medium.com/geekculture/how-to-</span><span class=\"invisible\">change-the-world-pocket-guide-for-people-with-a-messiah-complex-dd2d16bb92a</span></a></p>", "contentMap": { "en": "<p>My &quot;ars poetica&quot;: How to Change the World?! Pocket Guide for People With a Messiah Complex <a href=\"https://medium.com/geekculture/how-to-change-the-world-pocket-guide-for-people-with-a-messiah-complex-dd2d16bb92a\" target=\"_blank\" rel=\"nofollow noopener noreferrer\"><span class=\"invisible\">https://</span><span class=\"ellipsis\">medium.com/geekculture/how-to-</span><span class=\"invisible\">change-the-world-pocket-guide-for-people-with-a-messiah-complex-dd2d16bb92a</span></a></p>" }, "attachment": [], "tag": [], "replies": { "id": "https://me.dm/users/thebojda/statuses/109955178005562038/replies", "type": "Collection", "first": { "type": "CollectionPage", "next": "https://me.dm/users/thebojda/statuses/109955178005562038/replies?only_other_accounts=true&page=true", "partOf": "https://me.dm/users/thebojda/statuses/109955178005562038/replies", "items": [] } } } } ] }


이러한 예제를 바탕으로 다른 사람의 공개 게시물을 읽거나 공개 게시물을 외부에 게시할 수 있는 최소한의 클라이언트를 쉽게 구현할 수 있습니다. 여기서는 개별 JSON 파일의 정확한 구조와 받은 편지함의 기능에 대해 다루지 않겠습니다.


이는 ActivityPub 문서 에서 찾을 수 있습니다.


보시다시피 ActivityPub은 이해하고 구현하기 쉬운 비교적 간단한 표준입니다. 유일한 약점은 중앙 서버가 필요한 HTTP 프로토콜을 사용한다는 것입니다. 이로 인해 Jack Dorsey(Twitter 창립자)가 가장 좋아하는 프로젝트인 Nostr과 같은 대체 프로토콜이 탄생했습니다.


그러나 나는 이것이 필요하지 않으며 소셜 네트워크를 더욱 분열시킬 뿐이라고 생각합니다. 대신, ActivityPub 프로토콜은 이미 존재하는 분산형 프로토콜에 대한 지원으로 확장되어야 하며, 이를 통해 Fediverse는 더욱 개방적이고 분산화된 방향으로 발전할 수 있습니다. 다음에서는 이것이 어떻게 달성될 수 있는지 보여드리겠습니다.


설명 데이터와 피드를 분산화하기 위한 완벽한 솔루션 중 하나는 Swarm Feed 또는 IPNS 를 사용하는 것입니다(이러한 프로토콜에 대한 전체 기사가 있습니다). Ethereum Swarm의 경우 피드 식별자는 Swarm 주소이고 IPNS의 경우 공개 키입니다.


이를 사용하면 ActivityPub 사용자는 {swarm address}@swarm 또는 {IPNS address}@IPNS와 같습니다. 여기에서 사용자 설명을 쿼리할 수 있습니다.


이전 버전과의 호환성을 위해 {swarm address}@gateway.ethswarm.org와 같은 게이트웨이 서버를 사용할 수도 있습니다. 이는 Webfinger 프로토콜을 통해 Swarm에 저장된 사용자 설명을 반환하여 기존 시스템(예: Mastodon)이 아무런 정보 없이 이 데이터를 읽을 수 있도록 합니다. 수정.


보낼 편지함의 구현은 Swarm 또는 IPNS 피드를 통해서도 수행됩니다. 이전 버전과의 호환성을 유지하려면 Swarm 피드(bzz://...) 또는 IPNS(ipns://...) 주소가 위치하는 "decentralized_outbox" 필드를 도입해야 합니다.


이전 버전과의 호환성을 유지하기 위해 기존 클라이언트가 변경 없이 이러한 피드를 읽을 수 있도록 원래 "발신함" 필드에 추가 게이트웨이 주소를 포함할 수 있습니다.


받은편지함 구현은 여러 가지 방법으로 수행할 수 있습니다. Ethereum Swarm에는 PSS 라는 메시징 시스템이 있지만 Waku 와 같은 다른 대안도 있습니다. 여기서 PSS 또는 Waku 주소는 "decentralized_inbox" 필드에 배치되고 원래 받은 편지함 필드에는 게이트웨이 주소가 포함됩니다.


이러한 몇 가지 작은 확장을 통해 ActivityPub은 Nostr과 같은 새로운 프로토콜을 도입할 필요 없이 완전히 분산화되고 "web3 호환"되도록 만들 수 있습니다.


Nostr의 GitHub 저장소 에 따르면 새로운 프로토콜과 릴레이 시스템이 필요한 이유는 ActivityPub 서버에 의한 사용자 검열 가능성과 인센티브 시스템 부족 때문입니다. 그러나 이 문제는 위의 확장으로 완전히 해결되었습니다.


IPNS와 Swarm은 모두 검열에 강하며 Swarm은 완전한 익명성을 제공합니다. 또한 Swarm에는 자체 인센티브 시스템이 있으며 FileCoin은 IPNS에 사용할 수 있습니다.


저는 미래가 분명히 ActivityPub에 속한다고 믿습니다. 개발자는 포괄적이고 진정으로 통합된 Fediverse를 구축하기 위해 새로운 프로토콜을 만드는 대신 ActivityPub을 발전시키고 발전시키는 데 집중해야 합니다.