Is there any way to get a raw transaction via JSON RPC? I know how to get tx_hash from txpool, next I can get data like "from", "to", "gas", "input"... But how to get raw hex string?

I mean a raw tx like this:


1 Answer 1


AFAIK there's no geth api to obtain the raw transaction. However you can get all tx fields with eth_getTransactionByHash and construct the raw transaction with them.

  • How can I construct raw_tx with fields from eth_getTransactionByHash? As I understand, I need to have private_key to do it. Is it possible to create raw_tx without private key?
    – Max Block
    Jun 1, 2020 at 6:05
  • @MaxBlock You can use ethereumjs-tx and construct a transaction passing the fields returned by getTransactionByHash (including the signature v, r, s). Then use .serialize() to obtain the raw transaction.
    – Ismael
    Jun 1, 2020 at 7:59

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.