Skip to content
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

Fix EIP-712/Eip712Method2021 #106

Merged
merged 1 commit into from
Mar 1, 2021
Merged

Fix EIP-712/Eip712Method2021 #106

merged 1 commit into from
Mar 1, 2021

Conversation

clehner
Copy link
Contributor

@clehner clehner commented Mar 1, 2021

Fix #101

  • Complete EIP-712 encoding/hashing
  • Fix Eip712Method2021 signing and verification
  • Added more tests
    • Added VC fixture using Eip712Method2021

Note: there is an inconsistency between the EIP-712 specification and its implementation in eth-sig-util (used from MetaMask when hashing arrays: MetaMask/eth-sig-util#106. Eip712Method2021 currently relies on arrays, and follows eth-sig-util's signTypedData_v4 implementation. If a newer signing method becomes available in eth-sig-util that implements EIP-712 more closely, we should probably follow that. In that case we could distinguish the hashing method either by making a new proof type name/URI or using another property on their proof.

@clehner clehner requested a review from wyc March 1, 2021 16:37
Copy link
Contributor

@wyc wyc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, good job on encode_data--fine use of recursive types

@wyc wyc merged commit c2384c7 into main Mar 1, 2021
@clehner clehner deleted the eip712vm branch March 2, 2021 00:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Complete EIP-712 encodeData and encodeType implementations
2 participants