trust-wallet-android-source icon indicating copy to clipboard operation
trust-wallet-android-source copied to clipboard

eth_signTypedData_v3 produces invalid signature

Open leroldary opened this issue 5 years ago • 1 comments

Using EIP-712 (eth_signTypedData_v3) with the provided example data an invalid signature is produced. Ios version of trust wallet had the same problem (https://github.com/TrustWallet/trust-wallet-ios/issues/967, now fixed). Example: https://dicether.github.io/js-eth-personal-sign-examples/ ("Sign Typed Data V3")

Example Data:

  const typedData = {
  types:{
    EIP712Domain:[
      {name:"name",type:"string"},
      {name:"version",type:"string"},
      {name:"chainId",type:"uint256"},
      {name:"verifyingContract",type:"address"}
    ],
    Person:[
      {name:"age",type:"uint64"},
      {name:"name",type:"string"},
      {name:"wallet",type:"address"}
    ],
    Mail:[
      {name:"from",type:"Person"},
      {name:"to",type:"Person"},
      {name:"contents",type:"string"},
      {name: "id", type: "uint256"},
    ]
  },
  primaryType:"Mail",
  domain:{name:"Ether Mail",version:"1",chainId:1,verifyingContract:"0xCcCCccccCCCCcCCCCCCcCcCccCcCCCcCcccccccC"},
  message:{
    from:{age: 46,name:"Cow",wallet:"0xCD2a3d9F938E13CD947Ec05AbC7FE734Df8DD826"},
    to:{age: 445711732, name:"Bob",wallet:"0xbBbBBBBbbBBBbbbBbbBbbbbBBbBbbbbBbBbbBBbB"},
    contents:"Hello, Bob!",
    id: "18446744073709551617"}
  };

The expected hash is: 0xd7452bcc4deef52ad1a3f658f4100fa870fcb849b2f8c7738c23bd8e736e6c7b

leroldary avatar Jun 01 '19 11:06 leroldary