What are some estimates of how much data can be stored in a bytes
type in a smart contract?
contract test {
bytes data;
function storeData(bytes _data) {
data = _data;
}
}
Ethereum Stack Exchange is a question and answer site for users of Ethereum, the decentralized application platform and smart contract enabled blockchain. It only takes a minute to sign up.
Sign up to join this communityHere the limit would be the gas cost of the transaction calling storeData
. For the gas cost, the upper limit is around 8M gas units per block in the current Ethereum mainnet.
You can split storeData
to store segments at a time instead of all data at a time. In this way, you can split storing data over infinite number of transactions and then only your ETH supply is limiting how much data you can store in the blockchain.