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?
Ethereum Stack Exchange is a question and answer site for users of Ethereum, the decentralized application platform and smart contract enabled blockchain. It only takes a minute to sign up.
Sign up to join this communityAccording 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?
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
andv = CHAIN_ID * 2 + 35
orv = 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, withv
replaced byCHAIN_ID
,r = 0
ands = 0
. The currently existing signature scheme usingv = 27
andv = 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?