I can hardly create transactions larger than 100kiB. I am wondering, is it possible to store huge files (several MiB or GiB) on the blockchain?

If so, how?

up vote 12 down vote accepted

No, you will have to store your data somewhere else and store the hash of this data and its location in the blockchain. You should have enough space to store it but remember the shorter your data is the less gas you need. So use URL shorteners.

Storing data into a transaction costs gas an blocks have a dynamic gas limit. You would have to make the gas limit raise by sending bigger and bigger data to force the network to adapt. But on each transaction you would be limited to a fixed amount of gas and thus a fixed amount of data. On feb 2016 the gas limit was about 3 millions, meaning a block was limited to about 89Kb of data. (see Is there a limit for transaction size? ) :

the transaction size limit currently is at around 89kB (3 million gas). But read on.

There is no direct or fixed limit neither for transaction sizes nor for block sizes. This is a strength of the Etherem network, it does scale.

That does not mean that there are no limits. There is the block gas limit of currently 3,141,592 gas which can be spent maximum per block.

As of writing, gas limit is about 4712388 gas which should limit data to about 140Kb. See https://ethstats.net/

Soon we expect some decentralized secure storage like swarm or IPFS to be easily usable. Look at https://github.com/ethereum/go-ethereum/wiki/Swarm---distributed-preimage-archive where you will also find a list of alternatives at the end of the page.

  • 1
    OP is asking for is it possible to store huge files and you're saying save it somewhere else? Your answer to the question will be No, if so please support it with facts, sources etc. – niksmac May 3 '16 at 10:52
  • 1
    I edited my answer. Thanks for the watch ;) – Nicolas Massart May 3 '16 at 11:10
  • What if I need to let only one or a free – dc7a9163d9 Jun 26 '17 at 7:14
  • What if I want only let one or a few people to access the file? – dc7a9163d9 Jun 26 '17 at 7:15
  • Encrypt the file in a manner that only authorized people can decrypt it. – Nicolas Massart Jun 26 '17 at 8:17

protected by eth Oct 2 at 4:35

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).

Would you like to answer one of these unanswered questions instead?

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