I'm trying to make a sendTransaction json rpc call and I don't know how to calculate the data paramether.

From the documentation:

data: DATA - The compiled code of a contract OR the hash of the invoked method signature and encoded parameters. For details see Ethereum Contract ABI

There is no specification how this should be made: the hash of the invoked method signature and encoded parameters

1 Answer 1


Yes, there's an Application Binary Interface Specification

The Application Binary Interface is the standard way to interact with contracts in the Ethereum ecosystem, both from outside the blockchain and for contract-to-contract interaction. Data is encoded according to its type, as described in this specification. The encoding is not self describing and thus requires a schema in order to decode.

There are several questions here about it:

  • Yeah but I'm not trying to communicate with a contract just a simple eth transfer.. Mar 28, 2018 at 7:11
  • That is really easy, data should be empty.
    – Ismael
    Mar 28, 2018 at 14:24
  • So its an none optional paramether but it has to be empty? Mar 29, 2018 at 18:23
  • 1
    Sorry, I didn't express myself correctly, I meant it can be empty. Usualy an empty data is enough, but you can embed any string there. Some application use data to embed a transaction id for example.
    – Ismael
    Mar 29, 2018 at 20:31
  • Sorry, coming in late. Could you invoke another method from a smart contract (using the data field) thus deceiving the transfer the user thought it was signing? I am afraid after signing such a message. Or is it purely informative in the case of this kind of transaction? Thanks
    – Nre
    Nov 29, 2021 at 22:18

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.