10

I come across a lot of posts on Ethereum Stack Exchange about "raw transactions" (more than 45 posts have this tag at the moment), but I don't really understand what it is. I have searched both Stack Exchange and the web and can't find a 101 explanation, with the exception of this one post where in answer to a question about the difference between raw transactions and other transactions, "eth" defined a raw transaction as "a transaction in raw bytes." Being new to both computing and the blockchain world, that did not clarify all that much for me, and still left me wondering: What is a transaction "in raw bytes"? And what are they useful for? Most posts seem to be focused on how to generate or sign a raw transaction, get a raw transaction from Hash, parse one etc. I'd love to understand what it actually is and what it enables.

1 Answer 1

13

A transaction as defined in the Yellow Paper section 4.3 it consist of several fields (like gasPrice, value, etc). To store them in the blockchain they are encoded using the Recursive Length Prefix algorithm into a sequence of bytes. This sequence is called a raw transaction.

Basically a raw transaction is a machine representation of a transaction, with the signature attached to it.

4
  • what is your reference to this? Like I never saw a raw transaction being defined this way in any textbook. In fact, a raw transaction needs to be signed! Hence, it is not signed by definition. See "Matering Ethereum" textbook p. 119 where it clearly says "create a raw transaction and sign it". So you could infer what I just said.
    – Anonymous
    Sep 15, 2021 at 11:42
  • @rsc05 If you want to ask a question it is better to create a new one by clicking the Ask Question button. You could include a link to this question to set the context.
    – Ismael
    Sep 15, 2021 at 14:15
  • 1
    @rsc05 In 2017 web3 was at version 0.xxx, that version had the sendRawTransactiton command that required a signed transaction as input, so for everyone in the Ethereum community raw transaction meant signed transaction in 2017. Andreas (Mastering Ethereum's author) comes from the Bitcoin community where raw transaction has a different meaning. Having said that I don't think there's an official definition about raw transaction in Ethereum, depending on the context it has different meanings: hex encoded signed transaction, unsigned transactiton.
    – Ismael
    Sep 15, 2021 at 14:28
  • 1
    I have no new question, but an add on to your answer. That is why I made the following comment. To get this right, otherwise, I might repeat the same question Tesa had. But many thanks for clarifying that "there's" no "official definition about a raw transaction in Ethereum". Such things are not so clear in disruptive technology. But I assume that is based on the concept of Bitcoin. You would assume that similar terminologies are interchangeable. That is what puzzled me. Anyways, thanks for your appreciated input!
    – Anonymous
    Sep 15, 2021 at 15:33

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.

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