3

So I just ran a function from a contract on Ropsten from myetherwallet.com. It ran fine via metamask, but I was just wondering what chainID was in the rawTx file?

{
 "nonce":"0x2e",
 "gasPrice":"0x04e3b29200",
 "gasLimit":"0x14b40f",
 "to":"0x8d3cbc2cba343b97f656428eafa857ee01bda53b",
 "value":"0x2386f26fc10000",
 "data":"0x412a5a6d",
 "chainId":3
}
Giuseppe Bertone
  • 5,487
  • 17
  • 25
thefett
  • 3,873
  • 5
  • 26
  • 48

1 Answers1

6

The chainid was added about 1 year ago in order to prevent replay attacks across channels. This was due to the ETH / ETC fork, but also applies to testnet and alternate chains (like Expanse). Here you can find a list of well known chainId values.

You can read about the discussion surrounding replay protection & EIP-155 here: https://github.com/ethereum/eips/issues/155

Giuseppe Bertone
  • 5,487
  • 17
  • 25
tayvano
  • 15,961
  • 4
  • 45
  • 74
  • Awesome stuff to know. The sad part is that it doesn't explain why my transaction won't work, but that's a different question – thefett Sep 05 '17 at 17:38