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 at 13:22
up vote 1 down vote accepted

gas prices are based on Oracle's and miners - they are insulated from the cost of ETH itself, so no - costs will NOT go exponentially up as ETH appreciates.

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.

  • I messed up the calculations. The price is about 1000 times higher than I had previously calculated. – Tjaden Hess Feb 3 '16 at 3:19
  • so how much is 1KB in USD terms? a rough estimate. – Patoshi パトシ Feb 3 '16 at 4:36
  • Shoot, messed up again. I mean $0.076 (7.6 cents). Damned decimals... – Tjaden Hess Feb 3 '16 at 5:37
  • 10
    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) – Ajoy Bhatia Apr 24 '17 at 18:55
  • 2
    Today, with 1ETH = USD 311 (apron.), it would exceed USD 10 mil!! – user22929 Nov 14 '17 at 15:30

Your Answer

 

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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