Wrote this post while trying to get a grasp on how SAFE URLs work. Any corrections would be much appreciated:
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:
- Query DNS server for
- Query that
wikipediaIP address for the location of the
- Query that location of the
- Recieve the file (http webpage) via the
SAFE Network DNS
Since there are no root nameservers that have to index all of the
.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.
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
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?
- They wouldn’t centralize it as access would be slower the further they were from their clients.
- They would want to only return results that were relevant to the people right there.
- They would want to name their servers in an easy-to-understand way.
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 with any file prefaced with a
video. prefix. Github APP could interact with any directory that starts with
There are two issues that come to mind that aren’t trivial to program:
- 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.
- 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 (
.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.
 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.
 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.