0

Many contracts implementing EIP712 include chainID info in the domain separators, while after EIP155, most signatures already contain chainID. Do the such domain separators mainly check that old signatures that do not implement EIP155 are not replayed?

1 Answer 1

0

EIP-155 applies to public transactions, while EIP-712 applies to signed data, which can be the data inside a transaction but not the transaction itself.

EIP-155 ensures that a signed Ethereum transaction cannot be replayed on Ethereum Classic, for example. EIP-712 try to ensure that your signed data cannot be reused on the same application.

While very similar, they do not serve the same purpose.

I hope that answers your question.

11
  • I mean, what you are describing is not different from what I was. The EIP155 signatures already contain chainID info against replays. The data for EIP712 is signed, so including the chainID info in the data itself or not doesn't matter. For example, the signed hash for EIP712 --> address signer = ECDSA.recover(hash, v, r, s);, the v value is there.
    – frt132
    Mar 14, 2022 at 6:54
  • "EIP-712 try to ensure that your signed data cannot be reused on the same application." In such EIP712 compatible contracts, they usually hash 'nonce' of users for this, hashing 'chainID' doesn't really matter for whether it can be used for the same application.
    – frt132
    Mar 14, 2022 at 6:56
  • 'The data for EIP712 is signed, so including the chainID info in the data itself or not doesn't matter.' that's not necessarily true, you could send me a signed message that I will send to a smart contract to do something on your behalf. In that case, I would have signed the transaction that includes a message that you signed, EIP-155 protects against tx replay, and EIP-712 protects against message replay. Those are not the same. nonce is not part of EIP-712 as far as I can tell, but I agree that relying only on chainID for such cases seems unsecure.
    – hroussille
    Mar 14, 2022 at 9:22
  • There are protocols (DApp) that are running on several EVM compatible chains, in that case, adding a chainID domain separator is an additional security that makes sense.
    – hroussille
    Mar 14, 2022 at 9:24
  • 'that's not necessarily true' hello, we are talking about signatures conforming to the EIP155 standard, so that is true, the signed message would include the v (the chainID) info. If you sign a transaction including a message that I signed, and the message I signed would include the chainID info as the v parameter.
    – frt132
    Mar 14, 2022 at 10:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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