The hash of a transaction is computed by serializing it and then hashing that. How are transactions serialized?

Specifically, knowing that this is the data structure of a transaction, what fields are included in the serialized transaction, and in what order?

  • It's the fields in the answer you linked to, in the order they appear in the answer you linked to.
    – user19510
    May 4, 2018 at 3:01
  • Obviously I need to read the links that I link to. Once I am fully convinced, I'll go ahead and answer this question and accept my answer. May 4, 2018 at 5:40
  • The linked answer is correct, you can verify it using the yellow paper ethereum.github.io/yellowpaper/paper.pdf (section 4.2). There is one minor addition not mentioned (because the structure of the message itself does not change). The yellow paper differentiates between two types of transactions: Message calls and contract creations. For message calls, the recipient address must not be empty and the message can contain arbitrary data. For contract creations, the recipient address must be empty and instead of arbitrary data, you include the contract initialization data.
    – sea212
    Oct 27, 2018 at 10:58


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Browse other questions tagged or ask your own question.