-
Notifications
You must be signed in to change notification settings - Fork 154
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement structured signing according to EIP712 #35
Comments
Up for discussion on what the name for this new signing method should be and what API it should expose. Given the complexity of structured messages, I don't think it is reasonable to try and define the API up-front, but suggesting a few names for the actual method.
|
cross linking to EIP191: https://github.com/ethereum/EIPs/blob/master/EIPS/eip-191.md which has a different use case (and should be implemented independently if we see forward progress on adoption) |
As long as 712 is in I think we're free to use If the method takes in data (in whatever format) and returns the 32-byte hash, then it will be easy to use with these other eth-account methods: |
@pipermerriam is this still up for me to work on? Further IIUC, then we are just adding another type of |
Yes, you are still 👍 to run with this. I'm going to delegate to @kclowes to lead figuring out details of the implementation. My intuition is that it'll be 1-2 new signature APIs, one for the |
Another API that would be handy to have for EIP 712 support: eth-account/eth_account/account.py Line 225 in 7be70c3
Something similar to that which takes an EIP712-compatible object and a VRs/raw signature as args. |
For now, I think it's fine to ask people to compose the two separately, like: msg_hash = eip712_make_hash(message) # the new API that needs to be added for signing, also
eth_account.Account.recoverHash(msg_hash, vrs) # use the existing API for recovery |
oh yeah, I didn't realize that it took the hash and not the raw message. an API for hashing a struct would then be a requirement I would think. |
@fubuloubu the |
@pipermerriam Random naming question, why is it a defunct hash message? Defunct to me means "no longer functioning", does it have a particular technical definition that means something completely different? |
I have wondered this myself, @fubuloubu. Unless it means something specific, I think it would be a good idea to change it to something else |
See this docstring: eth-account/eth_account/messages.py Lines 26 to 32 in e4e2a89
This message format results in ambiguity making it impossible to differentiate between fundamentally different messages that produce the same final result. |
Haha, yeah, somehow some new functionality started sneaking into that function since I first wrote it ;) It was only originally intended to only be used for version Here are my first thoughts on a new API: #58 |
Closed & released in v0.4 |
What was wrong?
No support for EIP712 style signed messages: https://github.com/ethereum/EIPs/blob/master/EIPS/eip-712.md
How can it be fixed?
Implement a low level signing API for creating and verifying EIP712 style signatures with appropriate primatives for wiring up to a higher level integration into the
Account
class.The text was updated successfully, but these errors were encountered: