3 ms·
You are way off. The entire Ethereum blockchain is approximately 6 TB. Even a pruned version is over 400 GB. There is no specific cost for storage, only gas fo
by Canada 6y ago
You are way off. The entire Ethereum blockchain is approximately 6 TB. Even a pruned version is over 400 GB.
There is no specific cost for storage, only gas for execution. For dynamic storage the SSTORE operation stores a word (256 bit). It costs 20,000 gas when the value is set from zero to non-zero, 5,000 gas when the value is set from non-zero to non-zero, and it provides a refund of 15,000 when the value is set from non-zero to zero. This is the only way to make data readable by contracts and thus light clients.
There is also the option of storing as code, which cannot be updated. There's the 32,000 gas paid for the CREATE and then 200 gas per byte for the code. This is much cheaper at 6,400 gas per 32 bytes.
So deploying a 128 byte string assuming a gas price of 100 GWEI and $1700 ETH:
32,000 + (6,400 * 4) = 57,600 gas
57,600 gas * 0.000000001 ETH (1 gwei) * 100 gwei * $1700 = $9.79
This would just store bits, it wouldn't be a valid contract you could actually call.
Or you could write your data as the parameters to a contract call at a price of 4 gas per zero and 16 gas per non-zero..
You would be able to read data stored this way off etherscan.
I'm not including the base 21,000 gas you have to pay for any transaction.
- saurik 6y ago> You are way off. The entire Ethereum blockchain is approximately 6 TB. Even a pruned version is over 400 GB. Your 6TB figure includes "store every single historical past state of the system", which is going "above and beyond": it is something that you never need to do for either correctness or operation of the system, whether as a user or as a miner... the only people who use archive nodes are people who are trying to more easily step-by-step debug old transactions.
- Canada 6y agoYou need a full fat DB if you want to be able to accurately detect transactions more than 2 days old. You need to do it if you care about more than just the current balance and don't want to rely on a centralized middleman such as etherscan.
- saurik 6y agoI don't understand what you mean by this; you do not need an archival node to either pull transaction receipts or to request transaction logs: you only need an archival node if you want access to all of the starting storage states of all past blocks, which you effectively never need (except for debugging). Notably: a "full node" is not an "archive node", and will not need more than the 400GB of space.