Is there a limit to the size of a string that we can store on the Ethereum blockchain?
1 Answer
The maximum size string you can store would be long enough to fit within the block gas limit (minus the transaction overhead and other costs associated with the transaction).
The current block gas limit is ~12.5 million. A very rough estimate says that the string length can be approximately 12k characters before it fills the block.
-
1You can always append more data to an existing string, but for long strings (> 512 bytes) the memory cost may grow exponentially.– Ismael ♦Dec 22, 2020 at 4:06