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

EIP-712: Support to sign typed data with prefix \x19\x01 #1012

Open
kripa432 opened this issue Jul 15, 2024 · 1 comment
Open

EIP-712: Support to sign typed data with prefix \x19\x01 #1012

kripa432 opened this issue Jul 15, 2024 · 1 comment
Assignees
Labels
bug Something isn't working P2 High

Comments

@kripa432
Copy link

kripa432 commented Jul 15, 2024

EIP-712: https://eips.ethereum.org/EIPS/eip-712

EIP-712 add support to sign typed data. There are three format to encode the data

encode(transaction : 𝕋) = RLP_encode(transaction)
encode(message : 𝔹⁸ⁿ) = "\x19Ethereum Signed Message:\n" ‖ len(message) ‖ message
encode(domainSeparator : 𝔹²⁵⁶, message : 𝕊) = "\x19\x01" ‖ domainSeparator ‖ hashStruct(message)

#893 add support to sign typed data, but the documentation states it signs with prefix \x19Ethereum Signed Message:\n

Running the curl command given in documentation, gives the following error.

Command

curl -X POST --data '{"jsonrpc":"2.0","method":"eth_signTypedData","params":["0xCD2a3d9F938E13CD947Ec05AbC7FE734Df8DD826", {"types":{"EIP712Domain":[{"name":"name","type":"string"},{"name":"version","type":"string"},{"name":"chainId","type":"uint256"},{"name":"verifyingContract","type":"address"}],"Person":[{"name":"name","type":"string"},{"name":"wallet","type":"address"}],"Mail":[{"name":"from","type":"Person"},{"name":"to","type":"Person"},{"name":"contents","type":"string"}]},"primaryType":"Mail","domain":{"name":"Ether Mail","version":"1","chainId":1,"verifyingContract":"0xCcCCccccCCCCcCCCCCCcCcCccCcCCCcCcccccccC"},"message":{"from":{"name":"Cow","wallet":"0xCD2a3d9F938E13CD947Ec05AbC7FE734Df8DD826"},"to":{"name":"Bob","wallet":"0xbBbBBBBbbBBBbbbBbbBbbbbBBbBbbbbBbBbbBBbB"},"contents":"Hello, Bob!"}}],"id":1}' http://localhost:9000

Result

{"jsonrpc":"2.0","id":1,"error":{"code":-32603,"message":"Internal error"}}

Does the web3signer, supports 3rd format with prefix \x19\x01?

@kripa432 kripa432 changed the title EIP-712: Support to sign typed data EIP-712: Support to sign typed data with prefix \x19\x01 Jul 15, 2024
@usmansaleem usmansaleem added bug Something isn't working P2 High labels Jul 17, 2024
@usmansaleem
Copy link
Contributor

@kripa432 Thank you for reporting this, let me try to reproduce and analyse it and will report back.

@usmansaleem usmansaleem self-assigned this Jul 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working P2 High
Projects
None yet
Development

No branches or pull requests

2 participants