Ethereum Asked on December 16, 2021
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?
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!
Answered by Niklas Feurstein on December 16, 2021
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.
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.
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.
Answered by Mowzer on December 16, 2021
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
Answered by Adelin on December 16, 2021
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.
Answered by Tjaden Hess on December 16, 2021
Get help from others!
Recent Answers
Recent Questions
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP