Blockchain – Cost to Store Data in Ethereum Blockchain

blockchainstorage

Whatever is stored in the blockchain is immutable which means I can fetch this data back in the future. As of today (2016-feb),

  • How does one store a 1kb, 10kb, or 100kb or arbitary data/text in the ethereum blockchain? What is the code needed to do this?

  • Once stored how do you download the data back onto your desktop?

  • How much would this cost exactly in ether/gas/fiat at todays prices?

Best Answer

Here is an article to describe everything about gas and how to calculate it.

Suppose, we are adding two numbers and for that the contract must do the following actions:

Storing 10 in a variable. Let’s say this operation costs 45 gas. Adding two variables, let’s say this costs 10 gas. Storing the result which again costs 45 gas.

Suppose the sender specifies a gas limit of 120 gas.

The total gas used by the miner to run the computation is (45+10+45) = 100 gas.

The fee that is owed to the miner, assuming 1 gas costs 20 Gwei, is (100 * 20 Gwei) = 0.000002 ETH.

And here you can get GAS calculations

Related Topic