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?

  • It's better to split this up in multiple questions on stack exchange. Asking many questions in 1 thread is usually not good.
    – mesqueeb
    Sep 27 '18 at 13:22

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

  • This answer is underrated.
    – Mowzer
    Jun 21 '19 at 19:35

tl;dr: $0.076/KB or $76,000/GB

According to the yellow paper, the fee is 20k gas to store a 256 bit word. A kilobyte is thus 640k gas.

Gas right now is around 50 Gwei (0.00000005 ETH). So a KB of storage costs 0.032 ETH. A GB costs 32,000 ETH.

To test this empirically, I created a contract with this code:

contract test {
    bytes data;

    function addData(bytes _data) public {
        data = _data;


at address transaction.

Then I sent a transaction adding 1KB of data ("0x111111...." 2k times).

This transaction took 753,072 gas (0.03765 ETH at current prices).

It costs about 0.003 ETH to call the contract without adding any data, so that equates to about 0.035 ETH per KB ($0.076), or around $76,000 USD per GB of storage.

Retrieving this data is free, though.

  • 1
    I messed up the calculations. The price is about 1000 times higher than I had previously calculated. Feb 3 '16 at 3:19
  • 17
    What a difference 14 months make. Today (4/24/2017), 0.035 ETH costs $1.75 at the price of ~$50 per ETH. That puts the cost of 1GB of storage at $1,750,000, i.e. 1.75 million dollars, instead of the $76,000 that it was 14 months ago (in Feb 2016) Apr 24 '17 at 18:55
  • 6
    Today, with 1ETH = USD 311 (apron.), it would exceed USD 10 mil!!
    – user22929
    Nov 14 '17 at 15:30
  • 1
    What's the current price? Nov 16 '18 at 19:20
  • 3
    Should be 233M$/GB as of right now with 200 Gwei average gas prices and 1823$/ETH Mar 17 at 22:11

I wanted to give a quick update on this topic. (The other answers with prices are kinda outdated).

Same as the other answer a kilobyte of data is 640k gas.

But in contrast to two years ago the gas price in 2019 is ~10 gwei instead of 50 gwei.

However the price of ETH also increased.

Two years ago it would cost you $0.076/KB.

In August 2019 it costed you $1.204/KB.

As of 23.07.2020 the gas price spiked to 80 gwei so the storage now costs $13.82/KB!


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

Every Ethereum transaction is publicly viewable. All you need is a viewer. Like this one for example.

enter image description here

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

It doesn't work like that.

You can fetch in real time, the current transaction pricing data here.

enter image description here

Your question implies a centralized pricing model. For example, in traditional centralized transactions (e.g., credit cards, wire transfers, ECH, etc.), the price is set by the payment processor. But the Ethereum network is decentralized. So it works in reverse fashion compared to the centralized model.

There is no single payment processor. Instead, there is a network of competing processors called "miners." Miners invest computing time and resources necessary to solve the math problem required to confirm and complete any given transaction.

Under this model, the sender sets the price with an offer to the network (miners). The Ethereum network responds to the price offered (which is a defacto incentive for the miners to solve the math problem necessary to hash a block) with a transaction. The time it takes to complete a transaction is correlated to the inverse of the price offered by the sender. i.e., The higher the price offered, the more priority that transaction will receive by the miners and, therefore, the less time the transaction will take to complete.

The above site tracks and reports the current transaction times at common given price points.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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