I want to send ethereum blockchain a file approx 39KB. The file is like array generated by python code. I dont want to use IPFS and oracle. Is this file exceed block gas limit? if yes, then can i divide the file into two chunks and send it in two transcation?

and is there any method to compress and decompress data here? and is it efficient to store approx 4 to 5MB data on blockchain?

  • Why do you need that file on chain? Transaction have a hard limit of 32 kb, also storage is expensive.
    – Ismael
    Jan 3, 2022 at 8:14

1 Answer 1


The better way to do it is not to upload the file. Instead, you read the array from the file and send to the Ethereum Smart Contract you deployed (You will need to write a function in your smart contract to accept array as input).

No, You would never want to store a data that's this big into Ethereum, it will cost too much and not practical in real life ( I remember it cost me 1 ETH for 1 MB. The exact price varies over time, it depends on the smart contract function you wrote too). If you want to compress and decompress data, do it off-chain, because computational power for these operations consume gas too. For compressing and decompressing, it really depends on the data, not everything can be compressed tho.

Your Answer

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

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