I have read that msg.sender is the address of the person interacting with the blockchain. Does it mean a wallet address ? Do we always specify an address when we interact with contract i.e. deploy as well as web3.js calls ?

Also, the address is publicly known, so is there a role of a private key/json file stored which only a owner of a wallet have ? (Public/Private key communication like ssh).

1 Answer 1


msg.sender is the address of the caller of the current contract. msg.sender could be either a smart contract or a wallet (external account).

There's also tx.origin, which what you described: the signer of the transaction in which the call was made. That's always an external account. Use it with care, though.

More info here

  • What address ? Wallet/account address ?
    – Vivek Sadh
    Commented Aug 2, 2018 at 8:31

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.