tronprotocol / tronwallet-adapter

MIT License
64 stars 29 forks source link

Signature verification fail with WalletConnect #42

Closed marcosteixeira closed 8 months ago

marcosteixeira commented 11 months ago

In the dev-demo, React Hooks tab:

1) Change the adapter network to "Mainnet" (https://github.com/tronprotocol/tronwallet-adapter/blob/main/demos/dev-demo/src/ReactHooksDemo.tsx#L15). Otherwise Trust wallet won't connect.

2) Fix the onVerifyMessage function to use messageToSign as the first parameter. https://github.com/tronprotocol/tronwallet-adapter/blob/main/demos/dev-demo/src/ReactHooksDemo.tsx#L71

3) Connect with WalletConnect

4) Change the "Message to sign" to have more than 9 characters, otherwise it will fail. (not a real problem)

5) Sign and verify the message.

6) The addresses don't match.

way2ex commented 10 months ago

Hi~sorry for the inconvenience. I have tried using Trust wallet on IOS v10.6 and Android v7.1 and it can connect but can not sign a message or a transaction.

Please tell me the Android or ios version and I will check this function.

Also it's unclear that how trust wallet sign the message. Please try the following way:

tronWeb.trx.verifyMessage(tronWeb.toHex(messageToSign), signedMsg, address)
way2ex commented 8 months ago

Thank you for your attention. According to Trust docs Tron is not supported currently.