I have a JSON data. I want to store that data on the ethereum blockchain. I want to share that transaction_id of that data to all my users across the world so that anyone can see the data. How to store the data on the blockchain? Do I have to use gas for storing or Is there any other method that I can store without using ether?


1 Answer 1


You can't store anything on the Ethereum blockchain without paying gas.

To store data, you should create a smart contract. You could hard-code the data in the contract, if you dont ever want it to change:

pragma solidity 0.4.24;

contract DataStore {
    string public jsonData = "{\"aKey\": \"YOUR DATA GOES IN HERE\"}";

This, however, cannot be done efficiently with large amounts of data. In that case, you had better store a hash of the data in a smart contract. Then, you propagate the real data in another way, like IPFS or Swarm. Your users can verify that the data is correct by hashing it and comparing that hash with the one you stored in the smart contract.

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