See this transaction:


Is referred to the creation of this contract:


This is the code

pragma solidity >=0.6.0;

contract test001 {

    int private age;

    function setAge(int _age) public {
        age = _age;


I invoice setAge passing 25 as parameter, see the tx


My goal: I'd like to be able, saving the txid, to retrieve the data I sent; in this specific case, can I see that use setted 'age' = 25.

The ultimate goal is to save persistent certification data (a little group of integers and short strings) into the blockchain and be able to consult the data sent invoking a contract's function.

I have NOT the need to store all data into the contract, I think, if I am able to consult data sent using a common blockchain explorer link etherscan.io

If is it possible to consult the data I sent, how can I do this?

Probably I totally misunderstood visibility of data on the blockchain. Be patient, I'm new

2 Answers 2


You can see the "25" in the state change tab (switch to 'number'). But the easiest is probably to make the contract emit an event, as it is easy to read all events of contract from web3.


If your goal is to have persistent certification data storage on the blockchain, and retrieve the same, you can make use of setter and getter methods.

Solidity creates a getter method for public state variables by default. In case of private state variables, you need to define a getter method to read the stored value.

  • Thanks for reply, but (I think) you've not answer to my exact question: if data store on blocks is public and not encrypted, how can I see transaction data using a block explorer?
    – realtebo
    Commented Jan 9, 2020 at 8:51
  • 1
    You can see the input data for a transaction in the block explorer but it will be in hexadecimal/binary. If your contract is verified on Etherscan, you can decode it under the Input Data ⇾ View input As section.
    – Sudeep
    Commented Jan 9, 2020 at 17:49

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.