Greetings everyone,
I’ve been meaning to post this for a while now and I finally took the time to finish it. It’s about a different approach to apps and website that I think fits well with the unique nature of Safe. Hope you like it!
When I think about Safe, the thing that gets me the most excited about is the actual data. While it might not sound very sexy, I think the ability to decide how you interact with the data to fit your personal needs will be an important feature that will help Safe reach mass adoption. But even though the potential of owning your own data and sharing a database with everyone is tremendous, there isn’t a lot of talk going toward the data. So let’s talk about the data, the cool stuff we’ll be able to do with it and more practically: the kind of tool we’ll need to do it.
If you haven’t already, I suggest you check out the thread called The Essence of SAFE apps by @BenMS. It’s short but it explains well the difference between traditional apps and apps powered by Safe. It’s the seed that’s been growing in me and in a way the basis of what I’ll be talking about.
What is Safe Layer?
Safe Layer is the code name of a theoretical tool used to interact with the data on Safe. Its primary goal is to make each piece of data self-contained and reusable, like little Lego blocks, and give the power to the user to rearrange them as they please.
Another goal is to make it easier to create something for Safe. We have a great community of enthusiast who can’t wait to take an active role in helping the project but who don’t necessarily have the knowledge to program or time to learn the API. Safe Layer would lower the barrier to entry and give them the opportunity to contribute to the success of Safe.
I said “theoretical” because it’s not something I’m planning on building. I thought at first I would, but the reality is that I don’t have the time nor the right skillset to properly pull off. But I do believe it could be an important tool for the network and it’s the reason why I took the time to write this up. Worst case scenario at least the idea is now out there and no longer just spinning in my head. Best case scenario MaidSafe decides to build it because they can’t live another day without it.
With that said, let’s start.
The data layer
Compared with how the current internet works, data on Safe is not confined to a web server, stuck within the boundaries of a web page or an app. Instead, Safe is a giant database and the data can be used directly. Therefore at its core, Safe Layer can interact with data directly. So the first step is to create a simple data editor.
Similar to a browser, you enter the address of a piece of data in an address bar and it loads the raw content of the data. From there you could, depending on the permission of the data, add/modify/delete the information contained within it.
And since this is a network of interlinked data, when the value contained within the data is another Safe address, you can click on it and be redirected to that other data. Just like you do in your browser when you click on an URL to load another page.
Interesting information is usually made of multiple piece data so you can also configure the app to automatically fetch a specific type of data when it is found inside a specific context. For example, you go into a data of type user_profile. This data contains a link to a data of type public_broadcast and Safe Layers loads it automatically in a separate window and show them side by side. Up to a certain level of depth to avoid loading the whole network.
Data templates
In order to avoid everyone from creating a bunch of semi-similar data that is hard to mix together, the app would use data templates to create new data. You select the type of data you want to create and the app downloads its template from Safe. It would then show a form where you are asked to fill the key-value pair of the template.
The list of templates is configurable and the user can add a new entry or override an existing one. The list itself would also be downloaded from Safe. At some point, an organization like MaidSafe could take the responsibility of maintaining a list of standard data templates.
Now working with raw data is useful but there’s, of course, something to be said about a presentation layer. So next, we put back the presentation layer around the data but in a way to keep the separation between the two and in a way to allow users to easily change it to their taste.
The presentation layer
The goal of the presentation layer is to provide a customizable way to show a type of data. The type of the data would be written directly in the data itself. For example, a data that contains the profile of a user would have a key named “data_type” with the value set to “user_profile”. Then you can associate this data type with a presentation template that is stored somewhere on Safe. So when you encounter this type of data, you automatically download the template and use it to display the data. Simple.
Since the mapping between the data and the presentation template is done at the user level, you can change it to suit your needs.
Note that the presentation template could be written in any language. For example, if Safe Layer is built with a web engine, the presentation template could be written by using a mix of HTML, CSS, and Javascript. But it doesn’t have to, and at some point, we could even have multiple versions that target different platforms and use different technologies for the templates. The goal here is two folds: to give the user the choice of how a piece of data is presented and to make the data independent of its presentation.
Advanced features
What I described above would be the core features of Safe Layer. The first step. Even though it’s basic, I think it would allow us to start walking on the right path. Then, there’s a lot of other features we can add over this, here are a few examples.
Composition
In short, a composition is the ability to embed a presentation template into another one. The data that would fill the embedded template could come from a direct link from the main data or, as I’ll explain after, a soft link.
For example, a data describing a user profile contains a link to a list of public messages. The list of messages contains a link to each individual message. Then with composition, you can wrap all that into a single view.
Soft links
This idea is inspired by a post by @seneca. He explains how to link to another piece of data without providing an explicit address to it. It goes like this:
Every data has a unique address in XOR space. With this address, you can retrieve that data from the network. If you take this address, add a specific word to it and hash it, what you get is another address that points somewhere else on Safe. If you place your new data there, anyone who knows the specific word can retrieve it by doing the same process. It’s a soft link.
Here’s an example of what you can do with this: community feedbacks. Take the address of a piece of data, add a word like “XYZ_comments” at the end of it and hash it. What you’ll get is another address in XOR space and that’s where you’ll find the comments of your community on that piece of data whether it is a store, a video, a song or anything worth commenting on. What Safe Layer would do is check in the background if these soft links exist and allow you to load it if it’s found.
With soft links, communities aren’t stuck on a website anymore and travel with you as your surf the network.
Unified style
Look at your desktop, now look at the desktop of sci-fi movies. What do you see? Yours is an incoherent mashup of different styles, the other is a unified slick design. Controlling the presentation layer means you can apply the same style to everything. That Star Trek UI design you’ve been craving for all your life, you could finally get it.
This could be your life.
Reference: GitHub - matthias-wolff/LCARSWT: Build you own fully functional LCARS application or enjoy the demos: a 3D Earth view featuring NASA World Wind and the "Captain's Audio Library".
Reaching mass adoption
As an aside, here’s how I think a tool like Safe Layer can help us reach mass adoption. I hope you don’t mind me tagging you @nicklambert.
I understand the current focus of marketing is about explaining how Safe works and why it’s different. This is important to get tech people on board. But when we’ll want to get the general public, the thing that people will notice is not the groundbreaking tech but instead what we can do with it. If I may suggest an angle it would go something like this: the one thing that everyone can relate to is how we interact with data on a daily basis. Whether the data comes from our favorite social network website or our favorite calendar app, what we care about is the actual data, the picture, the message, the note, the meeting coordinates. Dealing with the quirks of the container, the website or the app, is a strain that everyone experience on a daily basis.
Therefore I think a strong message would be to enforce the idea that Safe allows us to take control over the container, to mold it to our desire and to make it work exactly how we need it to. As silly as it sounds, having a calendar app that does precisely what you want is the stuff of dream for the people, myself included. I think that’s a positive message that will reach a broad spectrum of people. It’s also a characteristic that is unique to Safe as there’s no other tech out there that can make such a claim.
Though, before we can do that we need to actually make it true. Having a giant global database that everyone can use is not enough. What we need is to free the data from its container and empower the individual to take back the control over its data and I think that’s where a tool like Safe Layer can come in.
So anyway, I could write about this all day but this post is already long and I’ve been delaying it enough. Hope you had a good read and that it gives a different perspective on the unique kind of experience we could get with Safe.
Cheers!