简体   繁体   中英

Best practice to save files in blockchain

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.

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 to look at another decentralized storage mechanism. The hashing link is something that has been trialed 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.io/

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.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM