What websites can you really build on the SAFEnetwork v IPFS

This was one of the first things I looked into when getting acquainted with SAFENetwork.
The problem is mostly the lack of multisig and/or network computing.

Multisig is needed to actually persist any results in SAFENetwork (the fact that a buy and sell order has been matched, the transfer of token ownerships, etc).
Computing and consensus could be an alternative, but you still need the persistence of the facts - and preferrably in SAFENetwork, otherwise you’d be implementing SAFENetwork all over again just to store that info in a DHT with your overlay instead. You’d still need to implement a large part of what SAFENetwork already does, as to get any security in the groups that are supposed to reach consensus. So, that’s not so good. I mean, we would need to implement secure groups for every new decentralized application, immense duplication of code and logic and lots of overhead, when MaidSafe may be implementing computing after release, making all that code and logic redundant.

If trading is to happen near real-time, regardless of whether client placing a specific order is online, then we need the computing. And for it to be anonymous, apparently it is something like, for example homomorphic encryption, that is needed. I have not delved into homomorphic encryption, so I don’t know how near any real implementation of that is, if it is already widely used, or if it is like cold fusion.

So, developing any applications that need to perform these sorts of transactions, or execute logic that must be objective (i.e. cannot trust individual clients with it), is IMO quite hard right now. I think the best option now is to try and abstract that part away in black boxes, and start develop applications as if those parts existed, but leave it unimplemented in the black boxes in wait for the actual solutions.

It would be quite helpful though if we could get some discussions going in the community (and with MaidSafe) on how the solutions would most likely look, so that we can do more accurate abstractions, and chisel out what kind of architecture and application design this requires.


EDIT:

There’s C++ source code to download there.
On GitHub there are some forks:
https://github.com/Lab41/PySEAL with python wrapper in addition to the C# wrapper, and plenty of explanatory comments.

And some hard core manual https://www.microsoft.com/en-us/research/uploads/prod/2017/11/sealmanual-2-3-1.pdf

Hm, so. Seems not entirely trivial to use from a first glance. I’ll have to look at that C# example later to see what I can make of it.


EDIT2:

Forgot to mention another key component of decentralised exchange; efficient querying - which there is also currently not any standard for in SAFENetwork. @intrz provided a very interesting list of papers on the subject here. So that too would be something we need to wrap our heads around.

14 Likes

Also latency prevents competing in terms of speed. Even with computing since consensus is needed and that involves latency between the nodes. Still be fast for humans but not for insane day traders and their bots doing multiple transactions per second (x 1000 traders).

3 Likes

Yep, true.
But if only we have something working, there will be a demand for it - especially for the inherent capabilities (decentralized, autonomous, anonymous etc.). And surely, there would also be a new category of people that would be attracted to it, just because the high frequency trading we know of today would not be possible there.

3 Likes

Definitely. And I hope we see it sooner than later. Multisig makes the task much easier.

And yes the reduced frequency will be an attractive feature for many. Also SAFE allows the trades to occur without the person needing to be online.

2 Likes

I thought multisig is part of the existing plan … Pretty sure David has said as much … of course the method for Safecoin isn’t nailed down in code yet and discussion still happening, so …

2 Likes

Yes it is, but not sure if part of next few alphas/betas or if in a later release after going live

2 Likes

Oh yes - good to point it out.
I got some details from David on it a while ago when asking about these things, more can be read here: Multisig transfer of safecoin

4 Likes

That comment you made deserves to have it’s own topic, please make a topic about that important future challenge, if it don’t currently exist one.

2 Likes

IPFS and SAFE seem to be completely different tools for different purposes. IPFS is simply hashed public files that can be cached at nodes closest to you so you can reach them quickly.

There’s no built in features for it to encrypt the file, and there’s no intention to make content you publish private to only you – its not personal storage in that way. It’s built to be a global caching solution for publicly accessible files. Hence dTube is all public and open content, and ok for IPFS.

Bittorrent is yet again totally different from IPFS AND SAFE. Bittorrent had only one goal, break up files so they can be quickly download in pieces simultaneously from many peers at once. It’s also optimized to deliver files fast by caring most about who is downloading it at the same time as you. IPFS and SAFE are more for permanent long-term storage. Bittorrent may like you to seed content for a long time, but inherently the protocol is not built around this.

4 Likes

I didn’t know that IPFS was using whole files, interesting. I thought it was more like bittorrent … however SAFE does break up files like bittorrent and allows simultaneous downloading.

I don’t think IPFS is all that good at indefinite storage however - I’ve used d.tube and one video I posted doesn’t load anymore. Also Bitchute (another streaming video site) uses bittorrent and is quite popular/successful IMO - so permanent storage isn’t critical for many uploaders I guess - and perhaps those who are uploading there are also seeding.

3 Likes

This is why the Filecoin incentivization layer is being built. People will contract providers to host their files using Filecoin.
(Btw, I think IPFS does have file chunking too, with the chunks forming a Merkle tree to represent the file if I remember correctly)

2 Likes

I thoughts IPFS was an address system and locator for fast access and minimal duplication for retrieval.

Maidsafe i think antiquates all of that?

With its own methods?

Can this be detailed if someone knows?

I think this question must be asked in the DEV forum but as this topic says “What websites can you really build…” well…

Going to the point. I want to know how to make a dynamic website like we use to build with PHP and SQL. In other words how to build the back end of a website.

I don’t believe this guarantees availability though, unless filecoin adds self healing to IPFS? Moreover, privacy is not ensured, which could cause nodes to be blocked if unsavoury material is being hosted.

1 Like

The short answer is that you cannot.

The longer answer is that the browser can talk directly to SAFENetwork, providing storage/messaging features accessible via javascript. This provides some of the functionality that a back end server would traditionally provide.

In a future version of SAFENetwork, compute will be offered, perhaps allowing scripts to be run by the network on behalf of the user too. This would allow more powerful apps to be created.

SAFENetwork requires a different approach to writing web apps. It is more powerful in some ways and less so in others. The latter will likely be improved in subsequent SAFENetwork versions.

2 Likes

It’s possible now to create a simple CRUD with user authentication? Like a forum for example?

It’s possible. There’s a peripheral called Decorum that is deferring a forum on SAFE.

As an example of a CRUD interface on SAFE see the talk and links to info on single page blogging app, talking to SAFE as if it offered an LDP storage service:

6 Likes

This tutorial explains the IPFS Merkle DAG.
https://flyingzumwalt.gitbooks.io/decentralized-web-primer/content/ipfs-dag/lessons/files-as-dags.html

It’s not incentivizing long term storage in any way. It’s more built around cache, clearing the cache, and pinning. Pinning being the ONE source that always has the file somewhere (assume it’s you as the creator). When someone asks for that file, the request will make it’s way back to you if there’s no intermediate node with it cached. As it passes back, intermediate nodes may then decide to keep it in cache. That cache will eventually expire unless one of those nodes also decides to pin it and keep it long term. The more a file is asked for, the more it’s cached all over, however if those requests stop, it will eventually be purged unless someone, somewhere has it pinned.

Hence the original materials (predating filecoin I believe) talk about a MARKET to pay someone to pin on your behalf. Filecoin comes along as the layer to automate that marketplace. Meaning in practice you pay a price to have someone ‘store’ (pin) your files. So again, IPFS is really built around a cache layer, and less so long term personal storage.

2 Likes

Proof of spacetime is used to ensure that miners hold the data for some period of time, but you’re right, it isn’t really clear what that period of time would be and if it would be on a contract by contact basis or always the same. You could at least continually renew the contract for long term storage.
Another difference from SAFE is that there is a retrieval market too, so getting data is not free under Filecoin. It is free in IPFS, but then there’s no availability guarantee.

2 Likes