5

For Bitcoin, I can use this site to find the hex encodings of raw Bitcoin transactions. Where can I find something similar for Ethereum?

Thorkil Værge
  • 4,220
  • 2
  • 16
  • 38

2 Answers2

0

Infura has a developer API to return the raw data in JSON.

Main Documentation

To get the list of available methods: https://api.infura.io/v1/jsonrpc/mainnet/methods

Example URL to get the JSON for one specific Tx: https://api.infura.io/v1/jsonrpc/mainnet/eth_getTransactionByHash?params=[%220xf97e9dcf0645e4686ec6ae8cecfe79bd945fe65bab12ec78c7d039916f8f3d81%22]

Etherscan also has a dev API, but you need to create an account and API key

Adam Kipnis
  • 670
  • 1
  • 5
  • 12
  • This is helpful but I would prefer to be able to get the raw transaction in the encoding used on the Ethereum blockchain: The RLP encoding. – Thorkil Værge Dec 29 '17 at 17:36
  • 2
    So you need more than just the input (data) portion which has the method signature and parameters? You want the entire sendRawTransaction() encoded message? – Adam Kipnis Dec 29 '17 at 17:59
  • Yes. A hex string similar to this: f889808609184e72a00082271094000000000000000000000000000000000000000080a47f74657374320000000000000000000000000000000000000000000000000000006000571ca08a8bbf888cfa37bbf0bb965423625641fc956967b81d12e23709cead01446075a01ce999b56a8a88504be365442ea61239198e23d1fce7d00fcfc5cd3b44b7215f – Thorkil Værge Dec 29 '17 at 18:01
0

You can use etherscan.io for this!

Look up an Ethereum transaction using the transaction ID. Like this for txid=0xd1844c003fc2531625538800e2f7824b4913be73f34765472ad6fb547d0ce2df.

Then find a button called "Tools & Utilities" in the top right corner of the box containing the transaction information. Use this button to choose "Get Raw TxHash". Then you will end up on a page like this which reveals the hex encoded raw transaction.

In this example, the raw transaction is:

0xf86b808512a05f200082520894cf1838b517247ebdfd0e6db3c00d386e45bb808d8711c37937e080008026a01c0883e251dd34a0b1864618ac73483f8ece1b619d97525fabd821a111c2a7e9a018342cda6471ac519e9a5034fc65b644afa2a78bcff84c88b48185429376c7e4
Thorkil Værge
  • 4,220
  • 2
  • 16
  • 38