The SAFE Network URL

Wrote this post while trying to get a grasp on how SAFE URLs work. Any corrections would be much appreciated:

Existing DNS

This is what you’re specifying when you’re typing a URL into your address bar

In short, URLs in today’s internet are resolved from right to left. They are parsed incrementally with the character that separates the fields being the dot “.” A client navigating to a URL will first query the global nameservers to find which IP address maintains the access to the website. Next the client will query the machines belonging to the IP address to find the machine that handles the subdomain of it’s service. Once that machine is found the client can then request from that machine the file specified using the protocol at the beginning of the URL.

That’s waaaaay complicated! (Honestly, you probably skimmed the rest of the paragraph after the second sentence…I did!) Here, consider: https://www.wikipedia.org/wiki/Domain_Name_System

  1. Query DNS server for .org to find wikipedia IP address
  2. Query that wikipedia IP address for the location of the www files
  3. Query that location of the www files for /wiki/Domain_Name_System
  4. Recieve the file (http webpage) via the https protocol

SAFE Network DNS

Root Domain

Since there are no root nameservers that have to index all of the .org’s, .com’s, or the .io’s, it seems like at this point that we can get rid of having that at the end of everything. So what becomes the root? Well, you do! Or, at least your file does. Taking from the example above, the reference to the particular file, can now be specified solely using wikipedia/wiki/Domain_Name_System. That will now be the pointer directly to your data on the safe network. Websites are now solely their filenames on the SAFE Network. No more servers, no more suffixes.

SAFE Protocol

This part is directly analogous to the existing URL setup today. There are many different network protocols in use even today. The SAFE Network is only adding another one to the list. safe: is mutually exclusive with other protocols such as:

  • ftp: - for the File Transfer Protocol
  • http: - for the Hypertext Transfer Protocol
  • magnet: - for the bittorrent magnet link protocol

This tells the browser (or APP) to use the safe: protocol, which implements the Application Programming Interface (API) in order to be able to process the data. AKA it can make use of how the SAFE Network stores and retrieves data. It speaks the safe language.

Domain Names

Where do I post my files? Where can I publish my website? More importantly, how can people find my website?

The first field after the safe: protocol declaration should reflect your username. Anything that comes after that will be the path to an uploaded file. Easy as pie.

Subdomain Specification Part I: Existing DNS

Here’s where it gets tricky. Since in the existing DNS namespace, anything left of the second dot (right to left, remember) is just a subdomain. Think craigslist. (Disclaimer: I’m not sure if this is how craigslist’s architecture is set up, but it’s the most accessible example I could think of)

Craigslist.org has thousands of servers located all over the place. Why would they want their data spread out?

  1. They wouldn’t centralize it as access would be slower the further they were from their clients.
  2. They would want to only return results that were relevant to the people right there.
  3. They would want to name their servers in an easy-to-understand way.

So consider billings.craigslist.org for Billings, MT, and phoenix.craigslist.org for Phoenix, AZ. Both of these use the same reference website: craigslist.org. Here comes the tricky part. There are data centers in both Billings and Phoenix. How would you know which one contained listings that you wanted to peruse?

Well, if the umbrella craigslist.org IP address got a request from a computer in Billings, MT with billings. in front of it, it would pass that request on to the Billings location. The connection would be made faster by only going to their Billings database, and only querying their Billings listings. If it got one with phoenix. in front of it, it would pass it on to the Phoenix location. Starting to get the picture? It’s the same site controlled by the same people, only the subdomains point to “just who exactly” needs to process the request.

Subdomain Specification Part II: SAFE Network

I could see someone scratching their head and saying, “But the SAFE Network is decentralized! There are no servers that are located in specific locations. How does the SAFE Network use these subdomains?” Well, in reality, the SAFE Network throws this thought process right out the window and seems to implement a whole 'nother paradigm:

Wow! Let’s see why that’s so cool. When you post here, look below the editor box where it says:

choose optional tags for this topic

Everyone kinda have an idea what tags are? They’re a lot more abstract than this new “subdomain” definition, but analogous.

Tags (in the blogging/forum sense) specify a certain overarching idea or concept that the post is a part of. They can say this this blog post file is relative to the SAFE Network, and put a “SAFE Network” tag on the post. Or a forum post can put a “Development” tag on it. It summarizes what the content is about.

Similarly, these subdomains are no longer subdomains at all! They exist to be able to tag the data type of a file. They can specify the access type of a file. For instance a SAFEtube APP would be able to interface[1] with any file prefaced with a video. prefix. Github APP could interact with any directory that starts with foss.

Political Issues

There are two issues that come to mind that aren’t trivial to program:

  1. What data type tags are available (should be used)

I initially pondered how a standardization of this should proceed, but then realized that, hey! it’ll just come naturally.

  1. What if the filename you want to upload with has already been used?

As far as I can tell, if your username is available, your filename is available.

Maidsafe is turning the entire internet on its head

This is reflected in the URL structure as well. What used to be root domains at the end of the URL (.org, .com, .io), are now built in to the filename. What used to be subdomains will be gone. Replacing it will be what use to be the filetype, and is now the data type.

The SAFE Network is revolutionary in so many ways, even down to the tiniest of details. I’ve said it before and I’ll say it again; props to the devs.


[1] I’m not sure if APPs will assign these subdomain/datatypes when they GET a file on the SAFE Network, or if the user/APP will specify the type when issuing a PUT request in order to have the APPs access the information. Or a combination of the two. Any explanation on this would be much appreciated.

[2] I’m not quite sure what these are called at the moment. They most certainly aren’t “subdomains”, and “datatypes” may end up being a bit restrictive. Perhaps an alternative would be more appropriate.

11 Likes

I might have gotten it entirely wrong, but it is possible that you host the popular page wikipedia/wiki/YOURFILE and I host wikipedia/wiki/YOURFlLE as a fake page to steal information from the users?

(or differently: If I understood it right, there is nothing such as pagenames that can be blocked, but only filenames, isn´t it?)

safe:www.Artiscience/wikipedia/wiki/YOURFlLE
vs
safe:www.fakeversion/wikipedia/wiki/YOURFlLE

ok, then I maybe didn´t get how I can block the domain (itc www.Articience). Can I register it without paying? If there is a good read regarding this topic any link is appreciated.

You register a username. That username is what comes after the first dot. The registration costs safecoin, but there will be charities set up that provide it for free.

I cannot point you towards any documentation since there really exists none that is up to date. The system is still only being implemented, so things change. I am not even sure if this info is 100%, just my current understanding!

1 Like

This was my understanding as well. AKA every account will be the root pathname of that account’s posts.