-
Notifications
You must be signed in to change notification settings - Fork 19
Supporting DID links to sphere content #51
Comments
It is worth noting that these are both structurally valid DID URLs:
However,
References:
|
One approach we could take is to only allow "absolute" did links, without petnames.
To traverse from one sphere to another, you would "absolutize" the slashlink, at each step, so there is never a traversal path. This keeps the did path simple. This is in keeping with the idea that the did is an "unknown", so the petnames in their address book do not provide much information security. This is a valid DID URL, with caveats:
Regex for whole match (markup would require two regex cases, one for did, one for petname slashlink) (?:(?<did>did:key:[a-zA-Z0-9_\-%]+)|(?<petname>@[\w\-]+(?:\.[\w\-]+)*))?(?<slug>\/[\w\-]+(?:\/[\w\-]+)*)? |
Another approach could be to allow slashlinks after a did, with or without petnames.
This gets visually complicated quickly. The petnames in the path are not really providing much value. I believe this is a valid DID URL, with same caveats as above. |
DIDs are the only stable way to address 3p content, since the petname for that content could change. To index 3p content, we need to introduce the concept of an "absolute" slashlink (a slashlink that is rooted to a did, rather than a petname). To put it another way, Slashlinks are locators. We also need a stable identifier. This PR introduces several new types to resolve the issue: - `Peer` is an enum that can be either a Did or a Petname. It makes Slashlink a type that holds a peer and a slug. This concept mirrors the [Subtext Rust parser](https://github.com/subconsciousnetwork/subtext/blob/9d61c0461568d1d6168537955a91221ff1ebc34f/parsers/rust/subtext/src/slashlink.rs#L4) and Noosphere's treatment of Slashlink types. - `Slashlink` now contains a `Peer` and a `Slug`. - `Link`, a type containing a `Did` and `Slug`, which provides a stable identifier for indexing. We use `Slashlink` wherever we can, and in the few cases where we need an identifier (database), we resolve the `Slashlink` to a `Link` at point of use. This PR also updates the way the database indexes content to use DIDs. Note this PR deliberately does not address the markup form of did-slashlinks, only the datatype. For markup form, we are tracking here subconsciousnetwork/subtext#51 Lays groundwork toward #323, #551, #518 ## Limitations This PR will not correctly re-relativize the slashlinks of 3P content saved to the database. So if you put something in the database and then query it again, you'll get a slashlink with a did, instead of a petname. To get nice petname-slashlinks, we'll need to integrate a new FFI function to get a petname from a did subconsciousnetwork/noosphere#358. However, this PR does not yet index 3P content. It just updates the system so we can. We should be safe to land it, and then start indexing 3P content once we get the new `DID -> Petname` FFI.
This is interesting, but possibly premature? Other systems mostly don't know what to do with DIDs at all, and haven't thought about the interfaces. Maybe @-syntax is correct? So either @petname (which resolves to a DID) or @did:key (which may get looked up and replaced with a label or a petname). Also: what about other mentions that themselves resolve to a DID? So, @bmann.ca has an _atproto subdomain / TXT record which contains a DID. @boris.fission.name contains a _did subdomain / TXT record. DNS flavoured links that resolve to DIDs at well known locations could be a good start? |
Did slashlink syntaxI'm strongly partial to
If DID, no petname. If petname, no DID. Rationale:
I like not having the For now, we have implemented DNS namesWorth noting that I'm not sure if this decision should belong to Subtext, or the app implementing it. Spec'ing this into subtext seems like too much app domain knowledge leaking back into a markup spec. Perhaps if we pursue it, it could belong to an "extension spec". |
Recently the team has been discussing the value of supporting a did link form for sphere content. This has many upsides.
DIDs are identifiers (stable and globally unique). Slashlinks are locators (they tell you how to find stuff), but not identifiers. Given that slashlinks dereference to sphere DIDs under the hood, it would be a nice fallback if slashlinks could reference DIDs directly. It would also be nice if that form were a stable identifier.
This choice has cascading effects on the UX of Subconscious, the UX of writing Subtext, the parsing of Subtext, and more. Design is navigating tradeoffs by values. To that end, This note is an attempt to explore and reflect on these interconnected aspects, how they intersect with the design values of Subtext, and to find a balance of tradeoffs that best suit our values.
Values:
@petnames
are.@petnames
, while supportingdids
.> blockquote
)._italic_
or@handles
).Previously-resolved tradeoffs:
([\w\-]+)(\/[\w\-]+)*
The text was updated successfully, but these errors were encountered: