2

According to this post, every Ethereum wallet has a number called network id.

Does every transaction have this network id?

If not, then it should be possible to replay transaction on multiple networks, isn't it?

warchantua
  • 189
  • 1
  • 8

1 Answers1

6

If not, then it should be possible to replay transaction on multiple networks, isn't it?

Replay protection was introduced in EIP-155 by incorporating the chainID into the v part of a transaction's signature. So in effect, yes, the transaction does have knowledge of which network it is on.

From the Specification part of the EIP:

If block.number >= FORK_BLKNUM and v = CHAIN_ID * 2 + 35 or v = CHAIN_ID * 2 + 36, then when computing the hash of a transaction for purposes of signing or recovering, instead of hashing only the first six elements (i.e. nonce, gasprice, startgas, to, value, data), hash nine elements, with v replaced by CHAIN_ID, r = 0 and s = 0. The currently existing signature scheme using v = 27 and v = 28 remains valid and continues to operate under the same rules as it does now.

See also: What does v, r, s in eth_getTransactionByHash mean?

And also: What is a chainID in Ethereum, how is it different than NetworkID, and how is it used?

Richard Horrocks
  • 37,835
  • 13
  • 87
  • 144