10

Is a transaction a type of a message? Is message call a call? And which of these results in any state change?

13

Good question. Both "message" and "call" are, arguably, overloaded terms. This question connects similar-sounding practical concerns and internal formal concerns making it challenging to address.

See Eth's answer for formal definitions of terms. I suspect the intent of the question is of a more practical nature. That is, how to work with the protocol as a developer more than how the protocol itself is defined.

First thing, understand the two modes of interacting with the chain. This can be read-only or with network verification. Adding to confusion, the Web3 method for forcing read-only mode is .call().

See this: What is the difference between a transaction and a call?

And this: https://blog.b9lab.com/calls-vs-transactions-in-ethereum-smart-contracts-62d6b17d0bc2

A message can be a transaction signed by an Externally Owned Account, or from a contract to another account. The latter are deterministic and can be considered instantanious. The former are subject to mining delays.

Hope it helps.

  • Thanks very much, Much clearer now. Just one clarification, is "call" a "message call". Or is "message" a message call. There's this term "message call" in yellow paper which I'm trying to correlate with you answer above. Thanks – drequinox Feb 10 '17 at 21:04
  • That's the "heavily loaded" part. From the perspective of a contract function, a message is indistinguishable from a transaction, but a transaction can only be initiated by an external actor. Next message for an excerpt from the Yellow Paper. – Rob Hitchens - B9lab Feb 10 '17 at 22:06
  • "and T o is the original transactor, which can differ from the sender in the case of a message call or contract creation not directly triggered by a transaction but coming from the execution of EVM-code." – Rob Hitchens - B9lab Feb 10 '17 at 22:07
  • In this context, he seems to be talking about messages from other contracts. He doesn't appear to be talking about the execution environment differences I'm describing. In either case, the EVM code will run, either locally or on all the miners, "call" being the first type and "transaction" being the second type. I believe I'm leading you toward present-day consensus about the precise meanings of things. It may have evolved from a somewhat confusing initial state. Hopefully it's reducing confusion and not contributing to confusion. ;-) – Rob Hitchens - B9lab Feb 10 '17 at 22:12
  • 1
    Message is contract-to-contract? On the paper it only states its between 2 accounts, not necessarily 2 contracts... This post is very misleading. – Souza Feb 3 '18 at 15:50
5

There's "practical" answers to these questions, and "formal" ones.

First, for practicality (and to avoid duplication) an important thing to understand is What is the difference between a transaction and a call?


To answer the questions formally, see Appendix A from the Yellow Paper (YP)

  1. Is a transaction a type of a message?

No, a transaction that creates a contract is not a message.

Transaction: A piece of data, signed by an External Actor. It represents either a Message or a new Autonomous Object. Transactions are recorded into each block of the blockchain.

To understand a transaction formally, see what a message is:

Message: Data (as a set of bytes) and Value (specified as Ether) that is passed between two Accounts, either through the deterministic operation of an Autonomous Object or the cryptographically secure signature of the Transaction.

In simpler terms, a transaction is either a message or a contract creation. The latter is not a message. (Note also that a message is between two accounts, not necessarily between two contracts.)


  1. Is message call a call?

Yes. Formally, the Yellow Paper only has message call.

Message Call: The act of passing a message from one Account to another. If the destination account is associated with non-empty EVM Code, then the VM will be started with the state of said Object and the Message acted upon. If the message sender is an Autonomous Object, then the Call passes any data returned from the VM operation operation.

Presumably "call" is a shorthand for "message call" (or simply an omission of the word "message").

Practically, by "call" you are probably referring to eth_call / web3.eth.call which simulates a transaction. Interfaces are outside of the protocol that's why you won't find anything in the YP about these "calls". Since "call" is an overloaded term, there is a proposal for eth_simulateTransaction.


  1. Which of these results in any state change?

A transaction. From Section 2 of YP:

Transactions thus represent a valid arc between two states; the ‘valid’ part is important—there exist far more invalid state changes than valid state changes. Invalid state changes might, e.g. be things such as reducing an account balance without an equal and opposite increase elsewhere. A valid state transition is one which comes about through a transaction.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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