Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

8
  • I don't believe that's true. While your statement about UX signing is solid, metamask could easily not include typehash in the hash generation and this way, contract side wouldn't even need typehash too which would make things easier. Here, it says that it's about collisions but that's what I don't get. Collisions for what Commented Feb 17, 2024 at 8:34
  • Added more to the answer and does it help? typeHash only useful for types. You're right that sometimes types might not be needed. Commented Feb 21, 2024 at 5:32
  • hi @eth. sorry for the late message. Note that EIP712 doesn't sign exactly what it's showing you on metamask. you sign the following: Mail(Person from,Person to)... concatinated with other things, but metamask doesn't show you this "Mail(Person from,Person to)" string, right ? even if typehash is not included in EIP-712 sign process, metamask could still show you the same on your image 1. what you're having a hard time to explain is if EIP712 creators didn't include typehash in the algorithm at all, what would go wrong :) One nice example would be great starting from client to solidity. Commented Feb 24, 2024 at 16:48
  • Wallets that support EIP-712 should show the whole struct Mail. EIP-712 has the Twitter usernames of the authors, as well as a discussions-to link` that you can try. Someone who understands more deeply may be able to help more. Feel free to post your own answer here with any learnings. Commented Mar 1, 2024 at 8:54
  • take a look at this image - ibb.co/25ZHtTt (the image includes the code as well so easier for you to understand). In order for this to work, inside contract, I have "BID_TYPE_HASH = keccak256("Bid(uint256 amount,Identity bidder)Identity(uint256 userId,uint256 wallet)");" nowhere in metamask, does it show the same thing as BID_TYPE_HASH :) if it did, i would understand your point, but not now :( Commented Mar 1, 2024 at 11:12