As per my understanding transactions are signed before sending to Ethereum. Else, no transfer of Ether will happen. However, messages sent to Smart Contracts (SC) aren't signed (e.g., using methods.myMethod.send). While this is a problem as anyone can call a SC, I understand that we can write SC in such a way that it responds only to a message coming from a given address. This way we can prevent any Ether or Token is not transferred to an attacker.

My question is, can an attacker send messages to a SC while masquerading an address (as there's no signature) that the SC is willing to accept? By doing so, can the attacker burn Ether of that account (as gas is consumed to execute SC)?

If so, any suggestions to prevent this.

  • 3
    No one can call a smart contract without sending a transaction, and every transaction has a signature. So the smart contract always knows the account that called it. The gas is paid for by the account that sent the transaction.
    – user19510
    Commented Sep 13, 2019 at 5:12
  • My initial observations were due to trying smart contract calls on Ganache, which seems to be signing all transactions behind the scene. Now that I tried on Ropsten Testnet, all smart contract calls need to be explicitly signed. Commented Sep 20, 2019 at 3:03
  • Others are correct, all tx's must be signed to be accepted by a non-private Ethereum node (that is, not Ganache). Ganache will accept all tx's as signed if they come from one of the 10 test accounts created when you start up. If you try to send an unsigned tx from any other account, you'll get an error "Sender account not recognized."
    – Paul Pham
    Commented Oct 20, 2019 at 21:25

1 Answer 1


However, messages sent to Smart Contracts (SC) aren't signed

No. All transactions are signed by an externally owned account (EOA).

Transactions sent to contracts are signed by an EOA.

A contract runs code, and that might include sending a message to another contract. In this case, the message is not signed because it doesn't need to be signed. The contract would only do that if it was responding to a transaction or message that can be traced back to a transaction signed by an EOA.

msg.sender is always the inner-most contract or EOA that invoked a function and there is no known may to impersonate another address. This is why it is used for access control.

Hope it helps.

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.