From 38e7ca20d598711eeff6b8b64ad0c59e7f4c4632 Mon Sep 17 00:00:00 2001 From: Rye Date: Thu, 7 May 2026 01:45:45 +0200 Subject: [PATCH 01/12] initial commit of draft followup MSC Signed-off-by: Rye --- proposals/0000-verifiable-links-in-profile.md | 281 ++++++++++++++++++ 1 file changed, 281 insertions(+) create mode 100644 proposals/0000-verifiable-links-in-profile.md diff --git a/proposals/0000-verifiable-links-in-profile.md b/proposals/0000-verifiable-links-in-profile.md new file mode 100644 index 00000000000..75a5c350e0d --- /dev/null +++ b/proposals/0000-verifiable-links-in-profile.md @@ -0,0 +1,281 @@ +# MSC0000: Verifiable Links in Profile + +A lot of other chat platforms (like Discord) and social media platforms (like Mastodon, Sharkey, ...) +allow you to put a list of links in your profile which then get verified. + +In the fediverse (e.g. Mastodon) it is simply done by crawling the linked site and searching for +links with the `rel="me"` attribute. + +Matrix Homeservers could do the same and mark a link upon request by a client as verified. + +## Proposal + +### The role of the homeserver + +A homeserver SHOULD provide an a client-server API endpoint to verify link relationship against +under `/_matrix/client/v1/verify_link_relationship`. The result of the link verification SHOULD +be cached for some amount of time (*implementation detail*). The homeserver SHOULD add a `expires` +field to the response, to indicate after what point in time a verification should be considered outdated, +after that time a client SHOULD reverify. + +A homeserver MAY choose to disable the `/_matrix/client/v1/verify_link_relationship` by it's respective +configuration. Since there can be a lot of verification requests on a big homeserver, a ratelimit may be +applied (in which case a HTTP 429 should be returned). + +To prevent potentially infinite redirect loops, a restriction on the amount of redirects SHOULD be applied. +A homeserver MAY use a blocklist/allowlist if it want's to filter what links they try to verify. However +a homeserver MUST prevent verification requests pointing to restricted addresses +([RFC1918](https://www.rfc-editor.org/info/rfc1918), localhost, ...). + +To verify a relationship it MUST match the full MXID (after normalization). + +As a client may wish to display additional information regarding a link (especially if the link is a +web address) a homeserver MAY include url preview information with the response. + +A homeserver SHOULD allow verification request towards subpages (e.g. `https://example.org/about`), but MUST +NOT mark the whole domain as verified for the mxid, it SHOULD as well allow multiple matrix-account-links +per page. + +#### Verification Methods + +##### Relationship + +A homeserver + +- MAY derive the cache time from the `cache-control` http response header. +- SHOULD upon request, with a payload defined below, fetch that link, parse, and check +if the relationship is given +- MAY restrict from which hosts websites can be fetched from for verification, similar +to link previews +- SHOULD enforce content-type (e.g. HTML only) +- MUST parse static HTML (no JS execution) +- MAY discard the verification and mark it as failed if the http response exceeds 1MB in size +- SHOULD NOT regard links in `