The Ethereum RPC API documentation accepts a data
field when requesting to sendTransaction
.
I notice that when I retrieve a historical transaction from the blockchain, I get back an input
field and no data
field, such as when using the web3 getTransaction
function.
Are the data
and input
fields equivalent, or are there any differences?
Best Answer
It's the same thing.
When you're going to send a transaction, the data is the combination of:
method, parameters
which are defined in the ABI, and they're encoded.When you decode the input data then you'll see something like:
This is created by the
encodeABI()
function. There's an online lab to check for the input. You can use it to check the input data. Given we can decode it manually, but it faster to use tool.