1

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).

Vivek Sadh
  • 227
  • 4
  • 11

1 Answers1

2

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

Henk
  • 4,261
  • 1
  • 13
  • 27