Safe Network, Is it a good choice?

Dear Community,

I am a student and I am about to do my thesis, which is basically aiming to put some health data into a blockchain /blockchain similar technology, which may origin from IoT devices or others. Unfortunately, after reading all the different approaches I reached a information overload. I came to the point to say that Ethereum and Maidsafe are the most suitable compared to Storj, Sia and IPFS since those need no peers for validation, enable offline sharing as well as allow to incorporate smart contracts.

In case you can provide me with general objection regarding usage of Maidsafe feel free to let me know.

7 Likes

SafeNet is definitely going to be a good tool for this, however (as far as I know) this would require each client running in the IOT devices to purchase their own network data which comes with some complexity.

If you’re able to overcome this, having a shared container which each client has “Insert” but not “Read” permission for would allow them to upload their healthdata without exposing the other data within the container to the other clients. I’m not sure if it’s possible to have “Write” permissions without “Read” permissions and perhaps there’s another way to do this. @hunterlester may be able to provide some insight here

2 Likes

Thank you for your fast reply.

1 Like

Yes, Insert only is possible. Look at the email example, where an inbox is designed like this.
Ah, no. Look at @hunterlester’s answer below. Apparently not yet.

Welcome MartinKmer!
I agree that MaidSafe would be a very good choice for this.
As Shane says each device writing to the network will need to have credits for this (in coming releases), which they can get if they are able to do farming (provide storage and bandwith to the network). This shouldn’t be complex per se, but since it is not implemented yet, you would not have definite solutions to look at for your work.

Distributed logic, or network agreed logic, is not enabled yet (waiting for some key features), so smart contracts are not currently available. But you can definitely map out the theory behind running them on SAFENetwork.

Also, you could set up a local network to test your ideas if you want to go hands-on. I have written a protocol for storing streams of events (suitable for IOT), and which can be used with current alpha-2 network.
I have an example application (Notebook) that I’ll upload to repo when I have some time over this week. You could look at it for inspiration. I might even do a health logger example just to demo the usecase :slight_smile:

2 Likes

@MartinKrmer
At present it’s not possible to give a mutable data structure Insert permissions only, as it will also have Read permissions by default. Even if you specify Insert only, it’ll still get Read permissions.

However, the approach for storing health data would be to create a private mutable data structure, where the data may be encrypted.

I’d need to play around to figure out exactly what you need.

So, do you want anyone to be able to insert their personal health data into a central data structure?
If so, why? For themselves to retrieve, or to be retrieved anonymously by researchers?

4 Likes

Thank you.

I will have a look at your protocol. I hope that get soon an access code so I can put into context and hopefully set up a local network for testing the ideas.

2 Likes

You don’t need to wait for an access code to the live network.

Start here: Release SAFE Browser v0.8.1 · maidsafe/sn_browser · GitHub
Download one of the mock options for your platform.

Then use this tool, safe_examples/safe_web_api_playground at master · maidsafe-archive/safe_examples · GitHub, to start playing around with data structures to get yourself acquainted.

3 Likes

In general, I try prototype a “personal health record” (PHR) relying on Safe Network, since it more feasible than the electronic health record.
The PHR may involve data from health tracker, health images, prescriptions, referrals, own documented data. :innocent: . Hence, the consumer should be able to insert his personal health information into kind of a central structure.

5 Likes

This sounds like a great project for SAFEnetwork @MartinKrmer. You may know that maidsafe have done some testing with the NHS, but I don’t know the details of that (some time ago).

Also, once the information overload subsides, take a look at the work being done by @aboynejames. He created some topics with demo videos on the forum (look through his profile for topics he created), and is doing ongoing work around decentralised science, including from personal devices to monitor health. It will make good reference material, not to mention help you understand the alternative ways to approach this.

Good luck. I hope you’ll keep us posted, and please ask for help on the forum any time.

4 Likes

Thank you. I will have a look (hopefully there is some good about it information). Indeed this would be good referencing material.

I let you know when I start.

3 Likes

Ok this may be no real subject-specific question, but how would rate difficulty of creating a Safe Network application, knowing what I am up to.
In other words, how did you experience working with safe network?

Although it is not 100% the same approach, this what has been prototyped with Ethereum.

I found that scaleability, transaction capacity and energy efficiency are factors, which would favour the usage of Safe Network.

MedRec:
https://viral.pubpub.org/pub/medrec/collaborate

4 Likes

Not completely straight forward yet, but its becoming easier with every new app that people do, from which you can get inspiration.
There are some good abstractions in the various projects and sample applications implemented in node.js, (check out Apps category in the forum). I think most of these would still benefit from an additional layer of abstraction which basically would make the difference compared to coding any application small or even negligible.

Just to touch briefly on the general case here:
Eventually, to start coding applications for SAFENetwork will be no different than it is today with any other framework/data storage solution. You add a reference to some wrapper library or SDK in your language of choice, and it should expose an interface that is familiar to any developer. Some caveats regarding architecture (see further down).

Back to right now:
There are a couple of wrappers available, but if you want some other language or structure, you’d have to do some of the work yourself with regards to mapping to FFI libraries, and in that case you need to read up a bit on the API and do some plumbing.

The most high level abstraction I know of today, which can be used for coding an application without knowing anything about the SAFENetwork API, is the CQRS + EventStore library I have written in C#.
But it is still under development and you wouldn’t be able to do all that you want with it yet.
An additional drawback with it is that if you are not familiar with this application design and db type, and usually do CRUD type applications with relational databases, keyvalue stores or document dbs, it will be a bit of a mindset change which is not related at all to SAFENetwork (i.e. eventsourcing + cqrs). If however you do know these patterns and practices since before, I would say that it would be very simple to just start coding, in C# at least :slight_smile:
Still under development though (not yet complete to allow for things like accessing same data from various applications, sharing with other users, and so on), so you would either have to complement it or focus on coding the business domain logic while it develops further.

But, to just get a feeling for the simplicity with which you can soon build apps, have a look at this example:
SAFEExamples.Notebook.

SAFENetwork application architecture

With regards to system architecture though, there are some paradigm changes, that requires new design patterns, new solutions. However, many of these will be available in abstractions too. Like for example, some basic api for managing data access between users and apps, or setting up network agreed logic (decentralized apps).

11 Likes

Hi,

could it be that your GitHub link for safe web api playground not really working?

Somehow I cannot clone it.

@MartinKrmer I think you have to clone the whole of https://github.com/maidsafe/safe_examples, you can’t clone the individual parts.

2 Likes

Thanks;
After running yarn in the directory:
error An unexpected error occurred: “https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz: getaddrinfo EAI_AGAIN registry.yarnpkg.com:443”.

:thinking:

I suggest you make a topic in Support, and give enough information for people to understand what you are doing.

2 Likes

I’m pretty sure it is already posted on alpha 2 network if that’s what you’re looking for. I uploaded it when the network launched… Not sure if that version still works. I remember seeing a new version of it posted to alpha 2 recently (I think on the dev forum)