Best practice to save files in blockchain

2019-02-07 10:39发布

What is the best practice to save files as part of a blockchain's data? I have tremendously large files to be saved.

Can't we save these file on cloud storage (centralized solution like dropbox), and link them with blockchain data using a file hash? Or is it better to use a distributed file storage like IPFS? Or is there any better solution in term of security, volume, performance, and fault tolerance.

2条回答
祖国的老花朵
2楼-- · 2019-02-07 11:02

You do not want to directly use a traditional blockchain. Blockchains are good for transactional information/state changes, large data storage is generally a bad idea. This is due to the high cost of storing data and security. I would advise looking at another decentralized storage mechanism. The hashing link is something that has been trialled out by a group called MedRec you can look at.

https://viral.media.mit.edu/pub/medrec

Otherwise, IPFS is an option, along with Sia and StorJ. Distributed Hashtables is an area to look into.

https://www.ipfs.com/

https://storj.io/storj.pdf

https://sia.tech/

This field is still new and rapidly developing so standards and the tech are still being set. I would advice reading each option individually and coming to figure out what solution fits your problem the best.

查看更多
forever°为你锁心
3楼-- · 2019-02-07 11:09

It depends (of course!) on what your objectives are. If all the participants in the blockchain have access to something like Dropbox, or the access is provided by the blockchain, then storing the data is fine there. You would simply store a hash of the file in the blockchain such that anyone retrieving the file will be able to verify that the file is valid. You could use IPFS or Google Drive or any other mechanism to share the data as long as the access control mechanisms are adequate for your use case. If additional privacy is needed you could store the file in encrypted form and use the blockchain to provide decryption keys to authorized users on demand. This is often referred to as off chain storage and is a common design pattern.

查看更多
登录 后发表回答