Is it possible to take input of a string from client side and using smart contract write that string data to a new block inside the Ethereum blockchain mainet or any testnet?

Basically take in string, pass it to smart contract and a new block gets created having that string inside of it.

1 Answer 1


So you have a smart contract with a function which accepts a string parameter. When you send a transaction to that contract targeting that function with some string parameter the transaction will eventually get mined and included in a block. You can't control to which block it gets added.

So, if you send a transaction with a string to a smart contract (which has the required functionality to accept the string) the transaction will get added to a block.

  • so the way to store data in blockchain is to update any variable you declare inside the contract and that will update the contract in all nodes, basically to store string inside the blockchain, you need to store it inside the contract and update its state from the contract, this is process will need some gas but the new updated version of the string will be added to the blockchain Commented Dec 6, 2019 at 7:18

Your Answer

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

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