document proposed translations between protocols in docs

pull/520/head
Ryan Barrett 2023-05-25 18:45:40 -07:00 zatwierdzone przez Ryan Barrett
rodzic 15e3daff5e
commit c277686e13
2 zmienionych plików z 181 dodań i 0 usunięć

Wyświetl plik

@ -445,6 +445,42 @@ a img.shadow:hover
list-style: none;
}
.docs table {
border-collapse: collapse;
width: 100%;
font-size: .8em;
border: 1px solid steelblue;
margin-left: 0.25em;
margin-right: 0.25em;
margin-top: 2em;
margin-bottom: 2em;
}
.docs th, .docs td {
padding: .5em;
}
.docs tbody th {
text-align: right;
}
.docs thead th {
text-align: center;
}
.docs table code {
white-space: nowrap;
background-color: transparent !important;
}
.docs th {
background-color: #ebecf6;
}
.docs tr:nth-child(even) {
background-color: #f6f6f6;
}
.question {
margin-top: 2em;
margin-bottom: .5em;

Wyświetl plik

@ -69,6 +69,10 @@ Bridgy Fed takes some technical know-how to set up, and there are simpler (but l
<li><a href="#terms">What are the terms of service?</a></li>
<li><a href="#bug">I found a bug! I have a feature request!</a></li>
<li><a href="#vulnerability">I found a security vulnerability!</a></li>
<br>
<p><em>Development</em></p>
<li><a href="#translate">How are the different protocols translated?</a></li>
</ul>
<ul class="docs">
@ -479,6 +483,147 @@ I'm <a href="https://snarfed.org/">Ryan Barrett</a>. I'm just a guy who likes <a
<p>Otherwise, <a href="https://github.com/snarfed/bridgy-fed/">the code is open source</a>, feel free to try to break in, let us know if you succeed!</p>
</li>
<br>
<h3 id="development">Development</h3>
<li id="translate" class="question">How are the different protocols translated?</li>
<li class="answer">
<p>Here are internal details on how Bridgy Fed translates user identity and events between protocols, including some like <a href="https://github.com/nostr-protocol/nostr">Nostr</a> and <a href="https://blueskyweb.xyz/">Bluesky</a>/<a href="https://atproto.com/">AT Protocol</a> that aren't launched yet. This includes in progress ideas that may not be implemented yet or fully thought through. Caveat hacker!
</p>
<p>Here's how we (plan to) translate <em>user identity</em> between protocols. Specifically, each square shows how a user in a given row is identified to the protocol in a given column. BF is Bridgy Fed. <em>Enhanced</em> is users who have done extra setup for BF, <em>basic</em> is users who haven't.
</p>
<table>
<thead>
<tr>
<th></th>
<th>IndieWeb</th>
<th>ActivityPub</th>
<th>AT Protocol</th>
<th>Nostr</th>
</tr>
</thead>
<tbody>
<tr>
<th>IndieWeb</th>
<td>-</td>
<td><em>basic</em>: <code>@[domain]@fed.brid.gy</code><br>
<em>enhanced</em>: <code>@[domain]@[domain]</code>
</td>
<td><em>users</em>: domain as handle<br>
<em>code</em>: <code><a href="https://atproto.com/specs/did-plc">did:plc</a></code> generated by BF
</td>
<td><em>basic and code</em>: <code>npub...</code> public key generated by BF<br>
<em>enhanced</em>: domain, if <a href="https://github.com/nostr-protocol/nips/blob/master/05.md">NIP-05</a> enabled
</td>
</tr>
<tr>
<th>ActivityPub</th>
<td>Fediverse profile URL</td>
<td>-</td>
<td><em>users</em>: <code>[username].[instance]</code> (fabricated domain)<br>
<em>code</em>: <code><a href="https://atproto.com/specs/did-plc">did:plc</a></code> generated by BF
</td>
<td><code>npub...</code> public key generated by BF</td>
</tr>
<tr>
<th>AT Protocol</th>
<td><a href="https://atproto.com/guides/data-repos">PDS</a> web frontend profile URL (how will we get this?)</td>
<td><code>@[handle]@fed.brid.gy</code></td>
<td>-</td>
<td><em>basic and code</em>: <code>npub...</code> public key generated by BF<br>
<em>enhanced</em>: handle domain, if <a href="https://github.com/nostr-protocol/nips/blob/master/05.md">NIP-05</a> enabled
</td>
</tr>
<tr>
<th>Nostr</th>
<td><a href="https://github.com/nostr-protocol/nips/blob/master/05.md">NIP-05</a> domain or BF user page</td>
<td><code>@[NIP-05]@fed.brid.gy</code> or <code>@[npub...]@fed.brid.gy</code></td>
<td><em>users</em>: <a href="https://github.com/nostr-protocol/nips/blob/master/05.md">NIP-05</a> domain, if available<br>
<em>code</em>: <code><a href="https://atproto.com/specs/did-plc">did:plc</a></code> generated by BF
</td>
<td>-</td>
</tr>
</tbody>
</table>
<p>Here's how we (plan to) translate <em>events and operations</em> between protocols, both inbound to and outbound from Bridgy Fed.
</p>
<table>
<thead>
<tr>
<th></th>
<th>IndieWeb</th>
<th>ActivityPub</th>
<th>AT Protocol</th>
<th>Nostr</th>
</tr>
</thead>
<tbody>
<tr>
<th>User discovery inbound</th>
<td>serve <code><a href="https://microformats.org/wiki/h-card">h-card</a></code> on BF user page</td>
<td><em>basic</em>: serve <a href="https://webfinger.net/">WebFinger</a> and <a href="https://www.w3.org/TR/activitypub/#actors">AP actor</a> on fed.brid.gy<br>
<em>enhanced</em>: user's site serves and redirects <a href="https://webfinger.net/">WebFinger</a> to fed.brid.gy
</td>
<td>resolve <a href="https://www.w3.org/TR/did-core/">DID</a>, serve DID document with fed.brid.gy <a href="https://atproto.com/guides/data-repos">PDS</a></td>
<td><a href="https://github.com/nostr-protocol/nips/blob/master/.md">NIP-39</a> (kind 0) query to BF (or other?) relay</td>
</tr>
<tr>
<th>User discovery outbound</th>
<td>Fetch home page, parse <code><a href="https://microformats.org/wiki/h-card">h-card</a></code></td>
<td>look up <a href="https://webfinger.net/">WebFinger</a>, fetch <a href="https://www.w3.org/TR/activitypub/#actors">AP actor</a></td>
<td>resolve <a href="https://www.w3.org/TR/did-core/">DID</a>, subscribe to <a href="https://atproto.com/guides/data-repos">PDS</a> repo, extract profile object?</td>
<td>discover user's relays with <a href="https://github.com/nostr-protocol/nips/blob/master/.md">NIP-65</a>, query <a href="https://github.com/nostr-protocol/nips/blob/master/.md">NIP-39</a> to get profile</td>
</tr>
<tr>
<th>Publish inbound</th>
<td><a href="https://webmention.net/">webmention</a> to fed.brid.gy</td>
<td>deliver to fed.brid.gy <a href="https://www.w3.org/TR/activitypub/#inbox">inbox</a>, user or shared</td>
<td>subscribe to user's <a href="https://atproto.com/guides/data-repos">PDS</a> repo on fed.brid.gy</td>
<td>publish <a href="https://github.com/nostr-protocol/nips/blob/master/01.md#events-and-signatures">event</a> to BF relay</td>
</tr>
<tr>
<th>Publish outbound</th>
<td>serve on BF user page followings <code><a href="https://microformats.org/wiki/h-feed">h-feed</a></code></td>
<td>deliver to recipient's <a href="https://www.w3.org/TR/activitypub/#inbox">inbox</a></td>
<td>serve repo diff via <a href="https://atproto.com/lexicons/com-atproto-sync"><code>sync</code> XRPCs</a> to subscribing <a href="https://blueskyweb.xyz/blog/5-5-2023-federation-architecture">BGSes</a></td>
<td>serve to subscribers</td>
</tr>
<tr>
<th>Follow inbound</th>
<td><em>users</em>: UI on BF user page<br>
<em>code</em>: <a href="https://webmention.net/">webmention</a> with <code><a href="https://indieweb.org/follow#How_to_publish">u-follow-of</a></code></td>
<td><code><a href="https://www.w3.org/TR/activitystreams-vocabulary/#dfn-follow">Follow</a></code> activity delivered to BF user <a href="https://www.w3.org/TR/activitypub/#inbox">inbox</a></td>
<td>receive <code><a href="https://atproto.com/lexicons/com-atproto-sync#comatprotosyncsubscriberepos">sync.subscribeRepos</a></code>?</td>
<td>user's client sends <code><a href="https://github.com/nostr-protocol/nips/blob/master/01.md#from-client-to-relay-sending-events-and-creating-subscriptions">REQ</a></code> to BF relay</td>
</tr>
<tr>
<th>Follow outbound</th>
<td><a href="https://webmention.net/">webmention</a> with BF proxy HTML page as source</td>
<td>deliver <code><a href="https://www.w3.org/TR/activitystreams-vocabulary/#dfn-follow">Follow</a></code> to followee's <a href="https://www.w3.org/TR/activitypub/#inbox">inbox</a></td>
<td>call <code><a href="https://atproto.com/lexicons/com-atproto-sync#comatprotosyncsubscriberepos">sync.subscribeRepos</a></code> on followee's <a href="https://atproto.com/guides/data-repos">PDS</a>?</td>
<td>discover followee's relay(s) with <a href="https://github.com/nostr-protocol/nips/blob/master/.md">NIP-65</a>, send them a <code><a href="https://github.com/nostr-protocol/nips/blob/master/01.md#from-client-to-relay-sending-events-and-creating-subscriptions">REQ</a></code></td>
</tr>
<tr>
<th>Response inbound</th>
<td><a href="https://webmention.net/">webmention</a> to a BF proxy page</td>
<td><code><a href="https://www.w3.org/TR/activitystreams-vocabulary/#dfn-create">Create</a></code>, <code><a href="https://www.w3.org/TR/activitystreams-vocabulary/#dfn-like">Like</a></code>, <code><a href="https://www.w3.org/TR/activitystreams-vocabulary/#dfn-announce">Announce</a></code> delivered to BF user <a href="https://www.w3.org/TR/activitypub/#inbox">inbox</a></td>
<td>response object received from a subscribed repo?<br>
(what if it's from a user we don't subscribe to?)</td>
<td><a href="https://github.com/nostr-protocol/nips/blob/master/.md">NIP-10</a> response <a href="https://github.com/nostr-protocol/nips/blob/master/01.md#events-and-signatures">event</a> received at BF relay or other relay</td>
</tr>
<tr>
<th>Response outbound</th>
<td colspan="4">same as follow outbound, with the corresponding response data type</td>
</tr>
</tbody>
</table>
</li>
</ul>
</div>