1

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?

user12
  • 111
  • 3
  • 1
    Why do you need that file on chain? Transaction have a hard limit of 32 kb, also storage is expensive. – Ismael Jan 03 '22 at 08:14
  • @Ismael As I understand maximum data file size users can upload is fixed 32 KB right rather than a value close to MB right? Here (https://ethereum.stackexchange.com/a/3546/4575) mentioned that for 4 Million block size data limit is 140kb , hence of today the block size is much larger but as I understood transactions are limited to 32 KB at most. And the answer mentioned 1 ETH cost for 1 MB in real life. – alper Jan 09 '24 at 12:26

1 Answers1

0

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.