Blockchain Vs Safe Network (Data Storage)


#1

Hi

I thought I would continue the series on Blockchain Vs Safe Network. The last thread on smart contracts really taught be a lot and helped me build arguments when discussing safe network with people.

So how is the Safe Network better or worse than blockchains at storing data?


#2

by decentralizing it much further. each vault holds much less than a blockchain-style node, making it wayyy more efficient.


#3

Well, you can’t store data in blockchains, only pointers to them, and that is a major factor in why blockchain based solutions don’t make our data more secure. The data itself is not stored on the blockchain, it is stored somewhere else and that somewhere else is what needs to be secured. That was the case before blockchains and it is still the case today.

If you haven’t read it yet I’d recommend David’s blog post on this issue. It helps put things in context and provides an insight into the design choices that our technical team have made. I hope it all makes sense and helps answer your question.


#4

There are some similarities with most blockchain storage solutions and SAFE, mainly that they’re based on something inspired by Kademlia DHT (distributed hash table). Blockchain based solution uses the blockchain for consensus, the DHT is then used to store the data, and there are economic incentives that’s supposed to keep the nodes from deleting the files. SAFE on the other hand has basically extended Kademlia into a solution that can do consensus on it’s own, without the need for a blockchain, by using sections, node aging, data chains etc.

In theory you can also store data directly in a blockchain, but if you want to store a large file on the Ethereum blockchain, the cost might be millions of dollars, compared to a couple cents on SAFE (or on Ethereum Swarm), since every miner would need to process and store it. That’s why they just store the hash of the files instead of the files themselves.

SAFE, Ethereum/Swarm and FileCoin/IPFS all want to some extent to enable a decentralized web. Here there’s also some similarities in how they work, for example Swarm has a chunker that divides a file into small chunks of max 4 kb, a bit similar to what happens on SAFE, except it’s not encrypted and thus doesn’t do the self-encryption process, and a merke tree of the hashes is used to find and assemble the chunks rather than the datamap on SAFE.

The blockchain based solutions only store immutable data in the DHT. This is because the hash of the file is stored in the blockchain and is needed to verify that the file hasn’t been changed in any way. In Swarm there is an implementation of something a bit like mutable data, but it’s based on the Ethereum Naming System (ENS). Basically you have a name like myfile.eth, this points to the hash of your file, whenever you want to change the file, you upload the changes and point myfile.eth to the new hash. This brings scalability issues as need to store a new hash on the blockchain for every single mutation, at the moment that would mean a global limit of less than 10 mutations per second, though sharding will increase this limit once it’s implemented, Raiden too, but not without issues in terms of centralization etc.

There are several big advantages to SAFE compared to the blockchain based solutions. One is as mentioned in another post about securing the data, perhaps there’s some reasonable ways to eventually get this fixed, but even then it runs into the scalability issues of blockchains.
Much of the power and new possibilities on SAFE, compared to the blockchain based solutions, comes from mutable data. Mutable data on SAFE is stored more or less the same way as immutable data, since you don’t need a hash of the data to store in a blockchain. Without a blockchain bottleneck making updates slow and expensive, there are tons more applications that then become possible and clever ways of using mutable data can be used where smart contracts would instead be used on ethereum.

SIACoin is the main solution which doesn’t use a variety of Kademlia. It’s a bit simpler than the others and doesn’t try to do anything more than being a decentralized cloud storage provider, competing against Amazon S3 etc, mainly on price. When you store a file with SIA, a smart contract will regularly check if the node that’s supposed to store still has the file and if it does, pay a reward, if it doesn’t I suppose it takes some copy from another node to make one more to ensure the file doesn’t disappear.

Now, it might be possible that all the issues with blockchains can be fixed, possibly with some new blockchain mutant that’s not really a blockchain any more, but from what I’ve seen on the roadmaps of the various projects for the next few years at least, MaidSafe have come up with something that seems to me to be much more scalable and secure.


#5

Thanks for the excellent explanation.


#6

Many thanks for this - great summary of differences and why safe net is unique and desirable!


#7

Great explanation, thanks!


#8

Maybe a bit less technical explanation is also in order. The short version of the core difference is that SAFE is a single network which is scalable and can both do storage and consensus.

Blockchains on the other hand are very secure, but not very scalable. So what do you do then? Well, you split the blockchain into smaller pieces, called shards, but there’s still some limits to how many shards you can have and still keep it secure, so you need to do something else. That’s where lightning networks come in, so you add an extra network to support more transactions.

Then if you want storage, you need a storage network, but that storage network also suffers because every time you want to add a new file or update some existing data, you need to tell the blockchain, so the blockchain transaction rate becomes a bottleneck for adding and updating files. Well, then you make a new type of network that supports scalable storage updates. Then there’s also sidechains that helps with some of these issues.

So instead of having a single network, you end up with the core blockchain network, another network for storage, one for most payments, one for storage updates and then maybe a bunch of sidechains. What you end up is a lot of extra complexity and a lot of extra moving parts to get things to work. In the end this complex hodgepodge might not even completely fix the issues, some of these extra components are still on the drawing board and there’s lots of debates about how well they will work and there are unresolved issues when it comes to avoiding centralization, preserving privacy and preventing attacks, in the end it won’t truly be known until all this has been developed and released, which for some of the parts doesn’t look like it’s going to be in the near future. The current designs doesn’t seem to have security (decentralization, censorship-resistance, securing data etc) and privacy nailed down as well as SAFE and the extra complexity with all the different networks having to work together isn’t making it any easier either.


#9

Blockchains seem to solve half of the problem - they can store small amounts of data securely in a distributed way. The other half of the problem is how to do this with lots of data, which blockchains struggle with.