Questions tagged [storage]

all questions regarding data and storage on the ethereum blockchain

Filter by
Sorted by
Tagged with
48
votes
5answers
25k views

What is the cost to store 1KB, 10KB, 100KB worth of data into the ethereum blockchain?

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 ...
43
votes
2answers
11k views

Is there a (theoretical) limit for amount of data that a contract can store?

Is there a theoretical limit to the amount of data that one contract can store while running in a private net in which gas is not a concern? Context: In a financial Dapp which is to replace global ...
35
votes
3answers
10k views

Difference between Memory and Storage?

What is the difference between Memory and Storage ? From both the EVM point of view and the contract design one. Thanks!
131
votes
1answer
49k views

What is Swarm and what is it used for?

What is Swarm and what is it used for? And what is Swarm's relationship with Whisper?
15
votes
2answers
3k views

Can a contract access another contract's storage?

I have a contract with numerous complex structs. Is it possible for a second contract to iterate over this data directly? I can't really use public accessor/getter methods as it's not possible to use ...
34
votes
3answers
32k views

How can I store data in ethereum blockchain

I want to store pdf hash in blockchain I already read this post What are some proposed ways of storing data in Ethereum? But I'm beginner in this domain and I don't understand... Is it possible to ...
11
votes
1answer
7k views

What are some proposed ways of storing data in Ethereum?

I keep reading that swarm or ipfs would be used for storage, but how would that work exactly? Would an ethereum contract store its data in these data blockchains? I thought ethereum smart contracts ...
26
votes
3answers
17k views

Where is the state data stored?

This question was asked on Reddit a while ago: Where is the state data actually stored though? On the hard drive of each node? Separate from or within the blockchain? — Reddit: Basic ...
8
votes
1answer
1k views

How is contract storage arranged?

Thinking about smart contract storage, how is the data arranged? I know that every variable within a contract has an unique ID, therefore, it's possible to create a node with a structure like <...
17
votes
1answer
2k views

How do I get the storage indices/keys?

I would like to explore the storage data of a contract. I have geth fully synched and I interact with it over RPC. There is the function "eth.getStorageAt(addr, index, block)" provided, but you need ...
16
votes
1answer
2k views

How to read a private variable from a contract?

Given a contract, how can I find out the current value of one of its variables (as a dev, not from the context of another contract), if it's not public?
98
votes
5answers
47k views

What is the difference between Swarm and IPFS?

IPFS seems a little slow on existing dapps. will Swarm load content more quickly? Also- is there a roadmap for swarm?
42
votes
1answer
18k views

What does the keyword “memory” do exactly?

I've been looking through the code of Etherdice and noticed that some variables are declared like ParserResult memory result; and I haven't found the keyword "memory" in any documentation. What I ...
50
votes
4answers
11k views

Is there anything stopping me from using the ethereum blockchain as data storage?

As I understand it, smart contracts are currently immortal by default. Does this mean that I could create a contract that happened to contain an encoded form of baby photos and have it stored forever? ...
18
votes
2answers
2k views

Can a contract's internal storage keep increasing forever?

In other words, is there a limit on the amount of storage a contract can hold? Suppose a field is an Array for instance, and the contract has a method for adding items. Can I keep calling the ...
14
votes
2answers
4k views

Ethereum event log maximum size

I'm thinking of storing some data in logs by emitting events but I cannot easily find the answers to the following questions: What is the total size limit of one event? Can I store lots of string32 ...
4
votes
1answer
8k views

How do you store image in the Ethereum Blockchain efficiently? [duplicate]

I don't think it makes sense to store the "entire image" on the blockchain. I thought it would be better to store a reference to that image, but that means the actual image file will still be in a "...
14
votes
3answers
2k views

Is there a functional equivalent to Factom in Ethereum?

Factom is a distributed data and records management and audit system. How easily can what Factom does be done in Ethereum? Are there any working DAPPS doing this? Could a simple smart contract take ...
14
votes
3answers
16k views

TypeError: Data location must be “storage” or “memory” for parameter in function, but none was given

/// @dev Adds a new transaction to the transaction mapping, if transaction does not exist yet. /// @param destination Transaction target address. /// @param value Transaction ether value. /// @param ...
8
votes
1answer
893 views

What is the composition of the blockchain database?

From axic's explanation of the structure of the ethereum database, we learned that data is stored in Merkle Patricia tries, usually inside a LevelDB store. It consists of structures such as blocks, ...
10
votes
1answer
5k views

How can I store big files on the blockchain?

I can hardly create transactions larger than 100kiB. I am wondering, is it possible to store huge files (several MiB or GiB) on the blockchain? If so, how?
8
votes
2answers
918 views

Why does delete increase overall gas cost?

My understanding is there is a gas refund for delete and the idea is to encourage developers to remove garbage from contract states. Consider this contract with a delete-enabled index of keys to ...
6
votes
3answers
275 views

Efficient Solidity storage pattern for a directional weighted graph

I would like my graph's nodes to each have a struct of data and 0 or more pointers to other nodes. It needs to be efficient for insertions of new nodes in between two existing nodes. Should I use ...
8
votes
2answers
3k views

DApp storage for data other than tranactions?

For the purpose of illustration, say I would like to create a decentralized version of Yelp. A centralized approach would be to have a restaurants table and a reviews table in an Mysql database. In ...
5
votes
2answers
4k views

How can I estimate price of data storage? [duplicate]

I'd like to make estimations of the cost of an application, and one of the things I need is the price to store n kB of data on a contract. In ether and in USD. Where could I find rates or prices of ...
26
votes
1answer
2k views

Is searching data stored in event logs prohibitively slow?

Augur uses event logs to store data that never needs to be accessed on-contract, since it is about 10x cheaper than on-contract storage. However, I've noticed that retrieving event logs (e.g., using ...
11
votes
1answer
6k views

Nested structs in solidity?

Is it possible to have a struct inside a struct? I am not sure about the data type internals, but I was basically trying to do something like (pseudo-code): library IpfsUtils { struct IpfsHash { ...
9
votes
1answer
722 views

Truffle framework with storage

How can I integrate truffle with swarm or ipfs for permanent document storage? Are there any libraries?
7
votes
1answer
2k views

What's cheaper — contract storage | log data | transaction input?

I want to collect user data and store it on the blockchain. Let's say I need to store usernames. Is the cost of storing 1 byte on the blockchain different for contract storage/log data/transaction ...
3
votes
2answers
6k views

Where does metamask store the wallet seed? (file path)

I have a Windows installation that cannot be booted anymore. I'd like to copy the file containing the Metamask wallet seed to another machine and have that Metamask installation use it. The same ...
2
votes
1answer
383 views

Ethereum storage implementation at the database level - how is it stored

I have read the yellow paper many times as well as various articles, I suppose if I cannot find the answer here - I will look into the code. My understanding is that each contract account contains a ...
1
vote
1answer
7k views

Type error: memory is not implicitly convertible to expected type

I have a function that returns a list of BetProposition smart contracts: function getBetsForMatchup(uint matchupIdentifier) public returns (BetProposition[]) { return bets[matchupIdentifier]; ...
1
vote
1answer
436 views

Unexpected behavior with storage keyword?

Could someone explain to me what exactly happens when I declare a storage pointer? This example highlights the issue that I have encountered: contract minimum { uint256[] a = [1,2,3,4]; function ...
7
votes
1answer
280 views

How do I Zero Storage

I am trying to delete all the players that played a turn in a game. The contract is not meant to permanently store a list of players, it simply keeps track of players that have played in the current ...
2
votes
1answer
47 views

Gas cost of setting a state-variable to the same value

According to this spec, setting a state-variable to the same value consumes 200 gas. However, I conducted a test over ganache-core v2.10.2, and the result was closer to 800 gas: Solidity Contract: ...
1
vote
2answers
474 views

Storing a document with multiple large video files

What's the best way to store a document with multiple large video and CAD files on Ethereum. I am just a beginner to Ethereum. The document is a science experiment with multiple documents linked. I'd ...
1
vote
0answers
2k views

As of Feb 2016, how big is the ethereum blockchain size and its monthly growth rate? [duplicate]

As of Feb 2016, how big is the ethereum blockchain size and its monthly growth rate? Does the blockchain implement anything with pruning to reduce its size in the near future?
11
votes
2answers
18k views

How does data storage on the blockchain work?

If I store file chunks in the blocks, I'm causing duplicated blocks all over the networks (I mean, my file's chunks will be in each computer on the blockchain network, So eventually I have many many ...
8
votes
2answers
8k views

How to initialize an empty array inside a struct?

Is there a mistake in the way I initialize Bar b in the function foobar? contract Foo { struct Bar { address owner; uint[] x; } Bar[] public bars; function foobar(...
4
votes
1answer
4k views

Store addresses in array or mapping?

My contract currently serves an array of addresses to a front-end: address[] public addresses; function getAddresses() public view returns (address[]) { return addresses; } I'm concerned about ...
1
vote
5answers
4k views

How should I store user's password in a smart contract?

First I thought I could easily use private like: mapping (address => bytes32) private userPassword; and so just check if the entered password is right: function enter(bytes32 password) { if (...
12
votes
1answer
358 views

How growing contract storage increases the gas spending?

I have some further questions about this and this threads. For simplicity, let's imagine that I want to create a cryptocurrency on top of ethereum. The contract that "handles" this cryptocurrency ...
2
votes
0answers
77 views

Is it possible for a mapping to run out of space?

Can storage mappings in a contract run out of space? Say that mapping was keyed to an address and the value as the following struct: User bytes32 name uint8 age Theoretically, if there was a ...
1
vote
1answer
416 views

Where do you save the application data of a Dapp?

Let's say that I want to implement a Dapp similar to Facebook. Each user has its own profile, pictures and information. Usually you would use a database to store all this data. This guarantees that ...
5
votes
2answers
174 views

Stack Exchange Structure Using Ethereum

Could one build a "Stack Exchange" like information structure or process over Ethereum? Could the "Stack Exchange" team use Ethereum to build a new and improved information learning structure? As it ...
4
votes
1answer
624 views

A solidity function to accept two mappings and return a single combined map

I've been attempting to implement a function to combine two mappings into a single one: contract Mappulator { mapping(address => int256) public BigMap; struct mapper { mapping (address =&...
3
votes
3answers
3k views

Running out of storage space - want to move Mist chaindata

I have a small laptop that I basically use for nothing but my Ethereum wallet, using Mist. I'm running out of space, so I added a 64gb SD card and I'd like to keep Mist running on the laptop but store ...
3
votes
1answer
452 views

Switching from 'storage' to 'memory' increases the gas-cost

I've read several related answers and blog posts, all of them suggesting that for the sake of reading complex state variables (i.e., arrays and structures), one should always prefer declaring the ...
2
votes
2answers
288 views

Having trouble storing multiple values in a uint256

In one uint256 I want to store the entire sender's address of 20 bytes and then 12 bytes of a second address. In this case the example addresses will be the following: ...
1
vote
1answer
558 views

Using EVM or Swarm for datastore

I want to maintain a datastore of key value pairs. For example, I have users of my dapp input their favorite food. I would like to map their account to the food name. It is my understanding that I can ...