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

signTypedData ambiguous input encoding #210

Open
Gudahtt opened this issue Sep 16, 2021 · 0 comments
Open

signTypedData ambiguous input encoding #210

Gudahtt opened this issue Sep 16, 2021 · 0 comments

Comments

@Gudahtt
Copy link
Member

Gudahtt commented Sep 16, 2021

EIP-712 does not currently specify how the inputs to the eth_signTypedData JSON-PRC method should be encoded. For example, it doesn't say whether to encode boolean values as true and false, or 0, and 1, or as the strings "true" and "false". Different assumptions have been made about how to interpret inputs between eth_signTypedData implementations, leading to incompatible implementations with no clear "correct" answer for how input data should be interpreted.

It seems clear to me that EIP-712 should be amended to include guidance on the expected input encoding. But in the meantime, we should at least be clear about what our expectations are in this library, so that users don't get a different encoding than they expect. We should clearly document our expectations, eliminate any potential ambiguity about how to interpret inputs, and include validation to help users correctly format their inputs wherever possible.

These changes may not be possible with existing signTypedData versions, so these improvements will be made solely on signTypedData_v5 (at least for now).

@Gudahtt Gudahtt added this to the signTypedData_v5 milestone Sep 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant