2

What's the best way to store a document with multiple large video and CAD files on Ethereum. I am just a beginner to Ethereum. The document is a science experiment with multiple documents linked.

I'd like to keep it online forever. How much would that cost? Is it possible? Could/should I create a Dapp to do that? Maybe it's worth using BitTorrent as well.

Any examples of other people doing that? Is Ethereum suitable for this task?

1
  • 1
    It would be very costly to store large files on ethereum, you can use decentralised storage systems, like Swarm or IPFS
    – kherwa
    May 22, 2018 at 17:52

2 Answers 2

1

Storing even bytes on the Ethereum blockchain can be quite expensive -- not to mention how costly it is to store multimedia files. The reason behind is that when something gets stored onto the blockchain, it stays there forever -- even if you inactivate it at a later time (remember, all Ethereum full nodes in the world will need to keep a copy of the full blockchain on their hard drives, which is very costly).

Therefore, in a nutshell, the blockchain is mainly used to store transactions (deploying a contract itself is a transaction, you may want to check the definition here https://github.com/ethereum/wiki/wiki/Glossary) than e.g. your files. If you are to implement for example a versioned file storage system through a blockchain component, you should probably want to store the files off-chain (e.g. in a distributed way as you may desire, see below) and the transactions (who published a file, who modified a file, etc.) on-chain.

How to store a file off-chain in a distributed way? There is not fixed or standard way of doing it but IPFS (InterPlanetary File System) seems to be the most discussed recently. IPFS is a content-addressable, P2P distributed file system based on distributed hash table and BitTorrent protocol (probably what you are looking for). Please check on https://ipfs.io/ for more details. You may also want to check on another frequently discussed distributed file system, Swarm, which is in may aspects similar to IPFS. The differences between them remains beyond the topic of this question but you may check on What is the difference between Swarm and IPFS? for more information.

2
  • 1
    Thanks, I'd want to use Swarm or IPFS so they can't be censored, and using those systems instead of say a straight BitTorrent method would mean the value of Ethereum would rise, especially if the files become wildly popular or important, right?
    – Adrian33
    May 23, 2018 at 12:57
  • 1
    The points you mentioned might be quite similar to some ideas of Filecoin who made historical 257 Million in their ICO, you may want to check on filecoin.io.
    – Zhen Hong
    May 23, 2018 at 17:16
2

I would not store a large document such as this on the ethereum blockchain. Remember that storage on the blockchain is extremely expensive, every memory write costs you gas. It can cost 20000 gas to simply set a storage location from zero to a value, and 5000 gas to change its value. Any attempt to store large files will most likely exceed gas limits. A possible solution is to store a reference link to the file in a smart contract on the blockchain - the file itself can then be stored offchain (s3, cloud etc..). OR on one of the many filesystem that people are attempting to build on top of the blockchain such as Swarm or IPFS.

Good luck!

3
  • 1
    Every memory read and memory write?? I thought that once you store the data on the blockchain, looking at it becomes free? Am I wrong? May 22, 2018 at 22:18
  • 2
    Edited response to make it more precise. May 22, 2018 at 22:23
  • 1
    Great response thank you, I posted a question below too. It seems that Swarm operates as a layer over IPFS. "[Swarm] is not intrinsically tied to a specific storage system." ethereum.stackexchange.com/questions/375/…
    – Adrian33
    May 23, 2018 at 13:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.