3

Is there a limit to the size of a string that we can store on the Ethereum blockchain?

1

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.

1
  • 1
    You can always append more data to an existing string, but for long strings (> 512 bytes) the memory cost may grow exponentially.
    – Ismael
    Dec 22 '20 at 4:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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