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.
Asked
Active
Viewed 6,462 times
1 Answers
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.
Ismael
- 30,570
- 21
- 53
- 96
sendRawTransactitoncommand 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 '21 at 14:28