{"action":"created","comment":{"url":"https://api.github.com/repos/maidsafe/rfcs/pulls/comments/233464432","pull_request_review_id":174882091,"id":233464432,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIzMzQ2NDQzMg==","diff_hunk":"@@ -0,0 +1,115 @@\n+# XOR-URLs (XOR-name based URLs)\n+\n+- Status: proposed\n+- Type: new feature\n+- Related components: Safe Browser. Safe App Nodejs / SAFE Client libs.\n+- Start Date: (13-11-2018)\n+- Discussion: (fill me in with link to RFC discussion - shepherd will complete this)\n+- Supersedes: (fill me in with a link to RFC this supersedes - if applicable)\n+- Superseded by: (fill me in with a link to RFC this is superseded by - if applicable)\n+\n+## Summary\n+\n+It is herein proposed to have a resolver function in the SAFE app client API that allows us to have standardised `safe://`-URLs which are generated based on the XOR address of the content being referenced.\n+\n+## Conventions\n+- The key words \"MUST\", \"MUST NOT\", \"REQUIRED\", \"SHALL\", \"SHALL NOT\", \"SHOULD\", \"SHOULD NOT\", \"RECOMMENDED\", \"MAY\", and \"OPTIONAL\" in this document are to be interpreted as described in [RFC 2119](http://tools.ietf.org/html/rfc2119).\n+\n+## Motivation\n+\n+Currently the SAFE app client API, and our SAFE browser, support fetching safesites and content stored on the SAFE Network with the DNS/public-names system, i.e. from URLs like `safe://<service name>.<public name>/<path>`, but it’s not possible to fetch data using their address on the network (i.e. the XOR address of any data stored on the network) without publishing it under a public name.\n+\n+This represents not only a restriction in some trivial use cases, like sharing a file by sharing its location and without publishing it under a public-name, but it also prevents users from being able to store linked-data on the network as these type of data cannot be linked unless it's all published at a public-name.\n+\n+## Detailed design\n+\n+### XOR address encoding\n+The XOR address shall be encoded in the XOR-URL, [z-base32 encoding](http://philzimmermann.com/docs/human-oriented-base-32-encoding.txt) seems to be a good choice as it is case insensitive, as opposed to other case-sensitive encodings like base58btc or base64url, and it was designed to be easier for human use permuting the alphabet so that the easier characters are the ones that occur more frequently.\n+\n+### ImmutableData XOR-URL\n+XOR-URLs for ImmutableData’s are the simplest ones since they don’t need any additional information to uniquely identify them on the network, as opposed to MutableData’s that also have a type tag. Therefore an ImmutableData XOR-URL can be simply defined as `safe://<encoded ImmutableData XOR addr>`.\n+\n+### MutableData XOR-URL\n+As already mentioned above, a string based on the XOR address along with a type tag is needed to uniquely identify a MutableData on the network, therefore the XOR-URL for a MD needs to include the type tag in it.\n+\n+When a MutableData is fetched, if it’s not an NFS/Files container with an `index.html` file, the resolver (e.g. the `webFetch` function) can return the MutableData’s raw data so the browser (or any client application) can render it in a specific way (see below for more details of what’s being proposed here in this regard).\n+\n+### MutableData versions\n+MutableData’s are versioned and therefore this shall be also accountable in the XOR-URL format to allow any MD URL to (optionally) reference a specific version. This will be also necessary in the future when append-only type of data is made available on the network.\n+\n+The version value can be used to enforce a specific version to be retrieved, and otherwise fail if that specific version is not found. On the other hand, the latest version will be retrieved if the version value is omitted from the XOR-URL.\n+\n+### Paths\n+Given that a referenced MutableData can effectively be the root NFS/Files container of the files of a safesite, any MD XOR-URL can also specify a path which needs to be resolved, just like when using the DNS/public-names system to resolve the path in a URL.\n+\n+### Browsable content\n+Currently, when a public-name URL is resolved to an NFS/Files container which doesn’t have an `index.html` file, the browser simply shows an error stating that the safesite content was not found.\n+\n+For a MD XOR-URL that doesn’t have a path and there is no `index.html` file, the resolver can return the raw content of the MD (i.e. its key-value entries), and the browser can automatically generate an HTML page which makes the content browsable, generating links to other data when an entry’s key/value is a `safe://` string, in an analogous/similar way to how web servers on the current internet allow browsing on folders/directories.\n+\n+An specific MD entry key could be also supported (e.g. `__non_browsable`), that the owner of the MD can insert in the MD if the “browsable” feature should not be enabled. Although this cannot be really enforced but offered as a feature to be optionally supported by some clients like our SAFE browser.","path":"text/0000-xor-urls/0000-xor-urls.md","position":50,"original_position":50,"commit_id":"384d50c203eb6932820608cd8be2b31119cbe6c4","original_commit_id":"384d50c203eb6932820608cd8be2b31119cbe6c4","user":{"login":"bochaco","id":442821,"node_id":"MDQ6VXNlcjQ0MjgyMQ==","avatar_url":"https://avatars0.githubusercontent.com/u/442821?v=4","gravatar_id":"","url":"https://api.github.com/users/bochaco","html_url":"https://github.com/bochaco","followers_url":"https://api.github.com/users/bochaco/followers","following_url":"https://api.github.com/users/bochaco/following{/other_user}","gists_url":"https://api.github.com/users/bochaco/gists{/gist_id}","starred_url":"https://api.github.com/users/bochaco/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bochaco/subscriptions","organizations_url":"https://api.github.com/users/bochaco/orgs","repos_url":"https://api.github.com/users/bochaco/repos","events_url":"https://api.github.com/users/bochaco/events{/privacy}","received_events_url":"https://api.github.com/users/bochaco/received_events","type":"User","site_admin":false},"body":"agreed, I'll remove that part then","created_at":"2018-11-14T14:18:21Z","updated_at":"2018-11-14T14:18:21Z","html_url":"https://github.com/maidsafe/rfcs/pull/281#discussion_r233464432","pull_request_url":"https://api.github.com/repos/maidsafe/rfcs/pulls/281","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/maidsafe/rfcs/pulls/comments/233464432"},"html":{"href":"https://github.com/maidsafe/rfcs/pull/281#discussion_r233464432"},"pull_request":{"href":"https://api.github.com/repos/maidsafe/rfcs/pulls/281"}},"in_reply_to_id":233379724},"pull_request":{"url":"https://api.github.com/repos/maidsafe/rfcs/pulls/281","id":230601608,"node_id":"MDExOlB1bGxSZXF1ZXN0MjMwNjAxNjA4","html_url":"https://github.com/maidsafe/rfcs/pull/281","diff_url":"https://github.com/maidsafe/rfcs/pull/281.diff","patch_url":"https://github.com/maidsafe/rfcs/pull/281.patch","issue_url":"https://api.github.com/repos/maidsafe/rfcs/issues/281","number":281,"state":"open","locked":false,"title":"XOR-URLs: resolvable XOR-name based URLs","user":{"login":"bochaco","id":442821,"node_id":"MDQ6VXNlcjQ0MjgyMQ==","avatar_url":"https://avatars0.githubusercontent.com/u/442821?v=4","gravatar_id":"","url":"https://api.github.com/users/bochaco","html_url":"https://github.com/bochaco","followers_url":"https://api.github.com/users/bochaco/followers","following_url":"https://api.github.com/users/bochaco/following{/other_user}","gists_url":"https://api.github.com/users/bochaco/gists{/gist_id}","starred_url":"https://api.github.com/users/bochaco/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bochaco/subscriptions","organizations_url":"https://api.github.com/users/bochaco/orgs","repos_url":"https://api.github.com/users/bochaco/repos","events_url":"https://api.github.com/users/bochaco/events{/privacy}","received_events_url":"https://api.github.com/users/bochaco/received_events","type":"User","site_admin":false},"body":"","created_at":"2018-11-13T19:43:48Z","updated_at":"2018-11-14T14:18:21Z","closed_at":null,"merged_at":null,"merge_commit_sha":"bcbdd62bc48effd8fb26c45452a1e19927f02e62","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/maidsafe/rfcs/pulls/281/commits","review_comments_url":"https://api.github.com/repos/maidsafe/rfcs/pulls/281/comments","review_comment_url":"https://api.github.com/repos/maidsafe/rfcs/pulls/comments{/number}","comments_url":"https://api.github.com/repos/maidsafe/rfcs/issues/281/comments","statuses_url":"https://api.github.com/repos/maidsafe/rfcs/statuses/384d50c203eb6932820608cd8be2b31119cbe6c4","head":{"label":"bochaco:rfc-xor-urls","ref":"rfc-xor-urls","sha":"384d50c203eb6932820608cd8be2b31119cbe6c4","user":{"login":"bochaco","id":442821,"node_id":"MDQ6VXNlcjQ0MjgyMQ==","avatar_url":"https://avatars0.githubusercontent.com/u/442821?v=4","gravatar_id":"","url":"https://api.github.com/users/bochaco","html_url":"https://github.com/bochaco","followers_url":"https://api.github.com/users/bochaco/followers","following_url":"https://api.github.com/users/bochaco/following{/other_user}","gists_url":"https://api.github.com/users/bochaco/gists{/gist_id}","starred_url":"https://api.github.com/users/bochaco/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bochaco/subscriptions","organizations_url":"https://api.github.com/users/bochaco/orgs","repos_url":"https://api.github.com/users/bochaco/repos","events_url":"https://api.github.com/users/bochaco/events{/privacy}","received_events_url":"https://api.github.com/users/bochaco/received_events","type":"User","site_admin":false},"repo":{"id":84213530,"node_id":"MDEwOlJlcG9zaXRvcnk4NDIxMzUzMA==","name":"rfcs","full_name":"bochaco/rfcs","private":false,"owner":{"login":"bochaco","id":442821,"node_id":"MDQ6VXNlcjQ0MjgyMQ==","avatar_url":"https://avatars0.githubusercontent.com/u/442821?v=4","gravatar_id":"","url":"https://api.github.com/users/bochaco","html_url":"https://github.com/bochaco","followers_url":"https://api.github.com/users/bochaco/followers","following_url":"https://api.github.com/users/bochaco/following{/other_user}","gists_url":"https://api.github.com/users/bochaco/gists{/gist_id}","starred_url":"https://api.github.com/users/bochaco/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bochaco/subscriptions","organizations_url":"https://api.github.com/users/bochaco/orgs","repos_url":"https://api.github.com/users/bochaco/repos","events_url":"https://api.github.com/users/bochaco/events{/privacy}","received_events_url":"https://api.github.com/users/bochaco/received_events","type":"User","site_admin":false},"html_url":"https://github.com/bochaco/rfcs","description":"Request for Comment (RFC) papers and discussions on Project SAFE core libraries and API's","fork":true,"url":"https://api.github.com/repos/bochaco/rfcs","forks_url":"https://api.github.com/repos/bochaco/rfcs/forks","keys_url":"https://api.github.com/repos/bochaco/rfcs/keys{/key_id}","collaborators_url":"https://api.github.com/repos/bochaco/rfcs/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/bochaco/rfcs/teams","hooks_url":"https://api.github.com/repos/bochaco/rfcs/hooks","issue_events_url":"https://api.github.com/repos/bochaco/rfcs/issues/events{/number}","events_url":"https://api.github.com/repos/bochaco/rfcs/events","assignees_url":"https://api.github.com/repos/bochaco/rfcs/assignees{/user}","branches_url":"https://api.github.com/repos/bochaco/rfcs/branches{/branch}","tags_url":"https://api.github.com/repos/bochaco/rfcs/tags","blobs_url":"https://api.github.com/repos/bochaco/rfcs/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/bochaco/rfcs/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/bochaco/rfcs/git/refs{/sha}","trees_url":"https://api.github.com/repos/bochaco/rfcs/git/trees{/sha}","statuses_url":"https://api.github.com/repos/bochaco/rfcs/statuses/{sha}","languages_url":"https://api.github.com/repos/bochaco/rfcs/languages","stargazers_url":"https://api.github.com/repos/bochaco/rfcs/stargazers","contributors_url":"https://api.github.com/repos/bochaco/rfcs/contributors","subscribers_url":"https://api.github.com/repos/bochaco/rfcs/subscribers","subscription_url":"https://api.github.com/repos/bochaco/rfcs/subscription","commits_url":"https://api.github.com/repos/bochaco/rfcs/commits{/sha}","git_commits_url":"https://api.github.com/repos/bochaco/rfcs/git/commits{/sha}","comments_url":"https://api.github.com/repos/bochaco/rfcs/comments{/number}","issue_comment_url":"https://api.github.com/repos/bochaco/rfcs/issues/comments{/number}","contents_url":"https://api.github.com/repos/bochaco/rfcs/contents/{+path}","compare_url":"https://api.github.com/repos/bochaco/rfcs/compare/{base}...{head}","merges_url":"https://api.github.com/repos/bochaco/rfcs/merges","archive_url":"https://api.github.com/repos/bochaco/rfcs/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/bochaco/rfcs/downloads","issues_url":"https://api.github.com/repos/bochaco/rfcs/issues{/number}","pulls_url":"https://api.github.com/repos/bochaco/rfcs/pulls{/number}","milestones_url":"https://api.github.com/repos/bochaco/rfcs/milestones{/number}","notifications_url":"https://api.github.com/repos/bochaco/rfcs/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/bochaco/rfcs/labels{/name}","releases_url":"https://api.github.com/repos/bochaco/rfcs/releases{/id}","deployments_url":"https://api.github.com/repos/bochaco/rfcs/deployments","created_at":"2017-03-07T15:14:37Z","updated_at":"2018-11-13T19:42:42Z","pushed_at":"2018-11-13T19:42:41Z","git_url":"git://github.com/bochaco/rfcs.git","ssh_url":"git@github.com:bochaco/rfcs.git","clone_url":"https://github.com/bochaco/rfcs.git","svn_url":"https://github.com/bochaco/rfcs","homepage":"","size":3620,"stargazers_count":0,"watchers_count":0,"language":"Rust","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":null,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"maidsafe:master","ref":"master","sha":"c058ca22b33513f2669c3cc225907d66640c4981","user":{"login":"maidsafe","id":536423,"node_id":"MDEyOk9yZ2FuaXphdGlvbjUzNjQyMw==","avatar_url":"https://avatars1.githubusercontent.com/u/536423?v=4","gravatar_id":"","url":"https://api.github.com/users/maidsafe","html_url":"https://github.com/maidsafe","followers_url":"https://api.github.com/users/maidsafe/followers","following_url":"https://api.github.com/users/maidsafe/following{/other_user}","gists_url":"https://api.github.com/users/maidsafe/gists{/gist_id}","starred_url":"https://api.github.com/users/maidsafe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/maidsafe/subscriptions","organizations_url":"https://api.github.com/users/maidsafe/orgs","repos_url":"https://api.github.com/users/maidsafe/repos","events_url":"https://api.github.com/users/maidsafe/events{/privacy}","received_events_url":"https://api.github.com/users/maidsafe/received_events","type":"Organization","site_admin":false},"repo":{"id":37366263,"node_id":"MDEwOlJlcG9zaXRvcnkzNzM2NjI2Mw==","name":"rfcs","full_name":"maidsafe/rfcs","private":false,"owner":{"login":"maidsafe","id":536423,"node_id":"MDEyOk9yZ2FuaXphdGlvbjUzNjQyMw==","avatar_url":"https://avatars1.githubusercontent.com/u/536423?v=4","gravatar_id":"","url":"https://api.github.com/users/maidsafe","html_url":"https://github.com/maidsafe","followers_url":"https://api.github.com/users/maidsafe/followers","following_url":"https://api.github.com/users/maidsafe/following{/other_user}","gists_url":"https://api.github.com/users/maidsafe/gists{/gist_id}","starred_url":"https://api.github.com/users/maidsafe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/maidsafe/subscriptions","organizations_url":"https://api.github.com/users/maidsafe/orgs","repos_url":"https://api.github.com/users/maidsafe/repos","events_url":"https://api.github.com/users/maidsafe/events{/privacy}","received_events_url":"https://api.github.com/users/maidsafe/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/maidsafe/rfcs","description":"Request for Comment (RFC) papers and discussions on Project SAFE core libraries and API's","fork":false,"url":"https://api.github.com/repos/maidsafe/rfcs","forks_url":"https://api.github.com/repos/maidsafe/rfcs/forks","keys_url":"https://api.github.com/repos/maidsafe/rfcs/keys{/key_id}","collaborators_url":"https://api.github.com/repos/maidsafe/rfcs/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/maidsafe/rfcs/teams","hooks_url":"https://api.github.com/repos/maidsafe/rfcs/hooks","issue_events_url":"https://api.github.com/repos/maidsafe/rfcs/issues/events{/number}","events_url":"https://api.github.com/repos/maidsafe/rfcs/events","assignees_url":"https://api.github.com/repos/maidsafe/rfcs/assignees{/user}","branches_url":"https://api.github.com/repos/maidsafe/rfcs/branches{/branch}","tags_url":"https://api.github.com/repos/maidsafe/rfcs/tags","blobs_url":"https://api.github.com/repos/maidsafe/rfcs/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/maidsafe/rfcs/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/maidsafe/rfcs/git/refs{/sha}","trees_url":"https://api.github.com/repos/maidsafe/rfcs/git/trees{/sha}","statuses_url":"https://api.github.com/repos/maidsafe/rfcs/statuses/{sha}","languages_url":"https://api.github.com/repos/maidsafe/rfcs/languages","stargazers_url":"https://api.github.com/repos/maidsafe/rfcs/stargazers","contributors_url":"https://api.github.com/repos/maidsafe/rfcs/contributors","subscribers_url":"https://api.github.com/repos/maidsafe/rfcs/subscribers","subscription_url":"https://api.github.com/repos/maidsafe/rfcs/subscription","commits_url":"https://api.github.com/repos/maidsafe/rfcs/commits{/sha}","git_commits_url":"https://api.github.com/repos/maidsafe/rfcs/git/commits{/sha}","comments_url":"https://api.github.com/repos/maidsafe/rfcs/comments{/number}","issue_comment_url":"https://api.github.com/repos/maidsafe/rfcs/issues/comments{/number}","contents_url":"https://api.github.com/repos/maidsafe/rfcs/contents/{+path}","compare_url":"https://api.github.com/repos/maidsafe/rfcs/compare/{base}...{head}","merges_url":"https://api.github.com/repos/maidsafe/rfcs/merges","archive_url":"https://api.github.com/repos/maidsafe/rfcs/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/maidsafe/rfcs/downloads","issues_url":"https://api.github.com/repos/maidsafe/rfcs/issues{/number}","pulls_url":"https://api.github.com/repos/maidsafe/rfcs/pulls{/number}","milestones_url":"https://api.github.com/repos/maidsafe/rfcs/milestones{/number}","notifications_url":"https://api.github.com/repos/maidsafe/rfcs/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/maidsafe/rfcs/labels{/name}","releases_url":"https://api.github.com/repos/maidsafe/rfcs/releases{/id}","deployments_url":"https://api.github.com/repos/maidsafe/rfcs/deployments","created_at":"2015-06-13T09:50:34Z","updated_at":"2018-11-07T14:30:39Z","pushed_at":"2018-11-13T19:43:49Z","git_url":"git://github.com/maidsafe/rfcs.git","ssh_url":"git@github.com:maidsafe/rfcs.git","clone_url":"https://github.com/maidsafe/rfcs.git","svn_url":"https://github.com/maidsafe/rfcs","homepage":"","size":3644,"stargazers_count":76,"watchers_count":76,"language":"Rust","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":46,"mirror_url":null,"archived":false,"open_issues_count":56,"license":null,"forks":46,"open_issues":56,"watchers":76,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/maidsafe/rfcs/pulls/281"},"html":{"href":"https://github.com/maidsafe/rfcs/pull/281"},"issue":{"href":"https://api.github.com/repos/maidsafe/rfcs/issues/281"},"comments":{"href":"https://api.github.com/repos/maidsafe/rfcs/issues/281/comments"},"review_comments":{"href":"https://api.github.com/repos/maidsafe/rfcs/pulls/281/comments"},"review_comment":{"href":"https://api.github.com/repos/maidsafe/rfcs/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/maidsafe/rfcs/pulls/281/commits"},"statuses":{"href":"https://api.github.com/repos/maidsafe/rfcs/statuses/384d50c203eb6932820608cd8be2b31119cbe6c4"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"bochaco"}}