22
33This is a proposal of a URI scheme to identify Matrix resources in a wide
44range of applications (web, desktop, or mobile) both throughout Matrix software
5- and (especially) outside of it. It supersedes
5+ and (especially) outside it. It supersedes
66[ MSC455] ( https://github.com/matrix-org/matrix-doc/issues/455 ) in order
77to continue the discussion in the modern GFM style.
88
@@ -28,7 +28,7 @@ Specific use cases include:
2828
2929Matrix identifiers as defined by the current specification have a form distinct
3030enough from other identifiers to mostly fulfil the representation use case.
31- Since they are not URIs they can not cover the two integration use cases.
31+ Since they are not URIs, they can not cover the two integration use cases.
3232https://matrix.to somehow compensates for this; however:
3333* it requires a web browser to run JavaScript code that resolves identifiers
3434 (basically limiting first-class support to browser-based clients), and
@@ -50,7 +50,7 @@ it merely defines a mapping between URIs with the scheme name `matrix:`
5050and Matrix identifiers, as well as operations on them. The MSC should be
5151sufficient to produce an implementation that would convert Matrix URIs to
5252a series of CS API calls, entirely on the client side. It is recognised,
53- however, that most of URI processing logic can and should (eventually)
53+ however, that most of the URI processing logic can and should (eventually)
5454be on the server side in order to facilitate adoption of Matrix URIs;
5555further MSCs are needed to define details for that, as well as to extend
5656the mapping to more resources (including those without equivalent
@@ -59,7 +59,7 @@ Matrix identifiers, such as room state or user profile data).
5959The Matrix identifier (or identifiers) can be reconstructed from
6060` {id without sigil} ` by prepending a sigil character corresponding to ` {type} ` .
6161To support a hierarchy of Matrix resources, more ` /{type}/{id without sigil} `
62- pairs can be appended, identifying resources inside of other resources.
62+ pairs can be appended, identifying resources within other resources.
6363As of now, there's only one such case, with exactly one additional pair -
6464pointing to an event in a room.
6565
@@ -92,7 +92,7 @@ Further text uses the following terms:
9292
9393The following considerations drive the requirements for Matrix URIs:
94941 . Follow existing standards and practices.
95- 1 . Endorse the principle of least surprise.
95+ 1 . Endorse the principle of the least surprise.
96961 . Humans first, machines second.
97971 . Cover as many entities as practical.
98981 . URIs are expected to be extremely portable and stable;
@@ -117,9 +117,8 @@ The following requirements resulted from these drivers:
117117 1 . Event IDs (` $arbitrary_eventid_with_or_without_serverpart ` )
1181181 . The mapping MUST take into account that some identifiers
119119 (e.g. aliases) can have non-ASCII characters - reusing
120- [ RFC 3987] ( https://tools.ietf.org/html/rfc3987 ) is RECOMMENDED
121- but an alternative encoding can be used if there are reasons
122- for that.
120+ [ RFC 3987] ( https://tools.ietf.org/html/rfc3987 ) is RECOMMENDED,
121+ but an alternative encoding can be used if there are reasons for that.
1231221 . The mapping between Matrix identifiers and Matrix URIs MUST
124123 be extensible (without invalidating previous URIs) to:
125124 1 . new classes of identifiers (there MUST be a meta-rule to produce
@@ -136,7 +135,7 @@ The following requirements resulted from these drivers:
1361351 . Matrix URI SHOULD have a human-readable, if not necessarily
137136 human-friendly, representation - to allow visual sanity-checks.
138137 In particular, characters escaping/encoding should be reduced
139- to bare minimum in that representation. As a food for thought, see
138+ to bare minimum in that representation. As food for thought, see
140139 [ Wikipedia: Clean URL, aka SEF URL] ( https://en.wikipedia.org/wiki/Clean_URL ) and
141140 [ a use case from RFC 3986] ( https://tools.ietf.org/html/rfc3986#section-1.2.1 ) .
1421411 . It SHOULD be easy to parse Matrix URI in popular programming
@@ -181,7 +180,7 @@ The proposed scheme name is `matrix`.
181180Other considered options were ` mx ` and ` web+matrix ` ;
182181[ comments to MSC455] ( https://github.com/matrix-org/matrix-doc/issues/455 )
183182mention two scheme names proposed and one more has been mentioned
184- in ` #matrix-core:matrix.org ` ) .
183+ in ` #matrix-core:matrix.org ` .
185184
186185The scheme name is a definitive indication of a Matrix URI and MUST NOT
187186be omitted. As can be seen below, Matrix URI rely heavily on [ relative
@@ -225,7 +224,7 @@ type-qualifier = segment-nz "/" ; as defined in RFC 3986, see also below
225224id-without-sigil = string ; as defined in Matrix identifier spec, see below
226225```
227226The path component consists of 1 or more descriptors separated by a slash
228- (` / ` ) character. This is a generic pattern intended for reuse in future
227+ (` / ` ) character. This is a generic pattern intended for reusing in future
229228extensions.
230229
231230This MSC only proposes mappings along ` type-qualifier id-without-sigil ` syntax;
@@ -346,8 +345,9 @@ comparisons are case-INsensitive.
346345 ` query ` , and ` fragment ` ), decoding special or international characters
347346 as directed by [ RFC 3986] ( https://tools.ietf.org/html/rfc3986 ) and
348347 (for IRIs) [ RFC 3987] ( https://tools.ietf.org/html/rfc3987 ) . Authors are
349- strongly RECOMMENDED to find an existing implementation of that step for
350- their language and SDK, rather than implement it from scratch based on RFCs.
348+ strongly RECOMMENDED that they find an existing implementation of that step
349+ for their language and SDK, rather than implement it from scratch based
350+ on RFCs.
351351
3523521 . Check that ` scheme name ` is exactly ` matrix ` , case-insensitive. If
353353 the scheme name doesn't match, exit parsing: this is not a Matrix URI.
@@ -466,7 +466,7 @@ extensions. Here are a few ideas:
466466
467467* Add specifying a segment of the room timeline (` from=$evtid1&to=$evtid2 ` ).
468468
469- * Unlock bare event ids (` matrix:event/$event_id ` ) - subject to changes in
469+ * Unlock bare event ids (` matrix:event/$event_id ` ) - subject to change in
470470 other areas of the specification.
471471
472472* Bring tangible semantics to the authority part. The main purpose of
@@ -569,7 +569,7 @@ further discussion should happen in GitHub comments.
569569Reddit style (` matrix:r/matrix:matrix.org ` , ` matrix:u/me:example.org ` etc.)
570570is almost as compact as original Matrix identifiers, while still rather
571571clearly conveys the type and nicely avoids the singular vs. plural confusion
572- described in the previos section. However, in the context of high requirements
572+ described in the previous section. However, in the context of high requirements
573573to URL grammar stability, Reddit-style prefixes would eventually produce
574574bigger ambiguity as a primary notation; but they can be handy as shortcuts.
575575As discussed in "Future evolution", the current proposal provides enough space
@@ -598,9 +598,9 @@ the type signifier?).
598598
599599#### "Full REST"
600600
601- Yet another alternative considered was to go "full REST" and build
602- a more traditionally looking URL structure with serverparts coming first
603- followed by type grouping (sic - not specifiers) and then by localparts,
601+ Yet another alternative considered was to go "full REST" and structure
602+ URLs in a more traditional way with serverparts coming first, followed
603+ by type grouping (sic - not specifiers), and then by localparts,
604604i.e. ` matrix://example.org/rooms/roomalias ` . This is even more
605605difficult to comprehend for a Matrix user than the previous alternative
606606and besides it conflates the notion of an authority server with
@@ -618,7 +618,7 @@ correctly. As laid out in the beginning of this proposal, Matrix URIs are
618618not striving to preempt Matrix identifiers; instead of trying to produce
619619an equally readable string, one should just use identifiers where they work.
620620
621- #### Minimal syntax based on path and percent-encoding
621+ #### Minimal syntax based on the path component and percent-encoding
622622
623623A simple modification of the previous option is much more viable:
624624proper percent-encoding of the Matrix identifier allows to use it as
@@ -629,8 +629,8 @@ to be encoded). This is considerably more concise and encoding is only
629629needed for ` # ` .
630630
631631Quite unfortunately, ` # ` is one of the two sigils in Matrix most relevant
632- to integration cases. The other one is ` @ ` ; it doesn't need encoding outside
633- of the authority part - which is why the form above uses a leading ` / ` that
632+ to integration cases. The other one is ` @ ` ; it doesn't need encoding except
633+ in the authority part - which is why the form above uses a leading ` / ` that
634634puts the identifier in the path part instead of what parsers treat as
635635the authority part. ` # ` has to be encoded wherever it appears, making a URI
636636for Matrix HQ, the first chat room many new users join, look like
@@ -644,7 +644,7 @@ instances, from pen-and-paper to other instant messengers.
644644
645645Putting the whole id to the URI fragment (` matrix:#id_with_sigil ` or,
646646following on the ` matrix.to ` tradition, ` matrix:#/id_with_sigil ` for
647- readability) allows to use ` # ` without encoding on many URI parsers. It is
647+ readability) allows using ` # ` without encoding on many URI parsers. It is
648648still not fully RFC-compliant and rules out using URIs by homeservers
649649(see also "Past discussion points").
650650
@@ -656,7 +656,7 @@ warrant a dedicated sigil but that cannot be ruled out. Rather than rely
656656on the institute of sigils, this proposal gives an alternative more
657657extensible syntax that can be used for more advanced cases - as a uniform way
658658to represent arbitrary sub-objects (with or without Matrix identifier) such as
659- user profiles or a notifications feed for the room - and also, if ever needed,
659+ user profiles, or a notifications feed for the room - and also, if ever needed,
660660as an escape hatch to a bigger namespace if we hit shortage of sigils.
661661
662662The current proposal is also flexible enough to incorporate the minimal
@@ -669,7 +669,7 @@ MSC could enable `matrix:id/%23matrix:matrix.org` as a synonym for
669669
670670Despite the limited functionality of URIs as proposed in this MSC,
671671Matrix authors are advised to use tools that would process URIs just
672- like an http(s ) URI instead of making home-baked parsers/emitters.
672+ like an HTTP(S ) URI instead of making home-baked parsers/emitters.
673673Even with that in mind, not all tools normalise and sanitise all cases
674674in a fully RFC-compliant way. This MSC tries to keep the required
675675transformations to the minimum and will likely not bring much grief even
@@ -693,7 +693,7 @@ information in URIs.
693693
694694The MSC strives to not be prescriptive in treating URIs except the ` action `
695695query parameter. Actions without user confirmation may lead to unintended
696- leaks of certain metadata so this MSC recommends to ask for a user consent -
696+ leaks of certain metadata so this MSC recommends asking for a user consent -
697697recognising that not all clients are in position for that.
698698
699699
0 commit comments