2

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;
    }
}

1 Answer 1

1

Here 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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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