I'm running truffle's default example Metacoin:

import "ConvertLib.sol";

contract MetaCoin {
  mapping (address => uint) balances;

  function MetaCoin() {
    balances[tx.origin] = 10000;

  function sendCoin(address receiver, uint amount) returns(bool sufficient) {
    if (balances[msg.sender] < amount) return false;
    balances[msg.sender] -= amount;
    balances[receiver] += amount;
    return true;

  function getBalanceInEth(address addr) returns(uint){
    return ConvertLib.convert(getBalance(addr),2);

  function getBalance(address addr) returns(uint) {
    return balances[addr];

When I run the application and send some coins, it generates the following payload:

    "jsonrpc": "2.0",
    "method": "eth_sendTransaction",
    "params": [{

I've sent 255 Meta to address 0x914e95d7b57c1899f0a77fb1f08a9ae02b012582 calling sendCoin(). Then I was trying to understand the data payload, breaking it down:

?? 0x90b98a11000000000000000000000000

address to (20 Bytes) -> 914e95d7b57c1899f0a77fb1f08a9ae02b012582

uint value (32 Bytes) -> 00000000000000000000000000000000000000000000000000000000000000ff

The first part (16 Bytes) of the data payload I assume will identify the sendCoin method inside the deployed contract.

  1. If so, how?
  2. Do these 32 Bytes just identify the method name or can it be broken down even more?

1 Answer 1


You may want to check out the ABI specification, which specifies how call and return arguments are encoded.

  • "0xcdcd77c0: the Method ID. This is derived as the first 4 bytes of the Keccak hash of the ASCII form of the signature baz(uint32,bool)." Nice! But what about the remaining 12 Bytes containing all zeroes? Apr 13, 2016 at 14:47
  • 1
    @HenriqueBarcelos The 0s are the leading 0s of the second argument, the address to which to send the coins. Apr 13, 2016 at 15:13
  • That's what I thought, but why this happens? It seems like wasting data... Apr 13, 2016 at 15:21
  • 1
    @HenriqueBarcelos The EVM word size is 32 bytes (256 bits) ethereum.stackexchange.com/q/2327/42 and is the natural unit of data: en.wikipedia.org/wiki/Word_(computer_architecture)
    – eth
    Apr 14, 2016 at 4:35
  • Seems like lack of a better serialization protocol in this case.
    – Scott
    Jun 30, 2018 at 22:47

Not the answer you're looking for? Browse other questions tagged or ask your own question.