Skip to content
This repository has been archived by the owner on Nov 21, 2019. It is now read-only.

Verify Message fails #517

Open
onedrop opened this issue May 30, 2017 · 6 comments
Open

Verify Message fails #517

onedrop opened this issue May 30, 2017 · 6 comments

Comments

@onedrop
Copy link

onedrop commented May 30, 2017

Verify message fails when attempting to verify a message signed by geth. I believe this has something to do with the 'Ethereum Signed Message' prefix that geth adds.

@tayvano
Copy link
Contributor

tayvano commented May 30, 2017

Can you please send example of what geth outputs / you are trying to verify. Thank you!

@onedrop
Copy link
Author

onedrop commented May 30, 2017

in geth console do this...

  • web3.eth.sign(web3.eth.accounts[0], web3.sha3('fubar'))
  • take the output of that command and build a json like so...
  • {"address":"<my_address>", "msg":"fubar", "sig":"<result_of_above_command>"}
  • paste that into the form here https://www.myetherwallet.com/signmsg.html...

The result is a red "Invalid signed transaction" message.

Verification works properly on https://etherscan.io/verifySig

@crptm
Copy link
Contributor

crptm commented May 30, 2017

@onedrop can you generate one for me? :)

@onedrop
Copy link
Author

onedrop commented May 31, 2017

ok here...

{"address":"0xaaff40fa1bb528905d626b78a67b7a019f63f5bf", "msg":"fubar", "sig":"0x36b7a6de3a0ff8ba7520c31ee022dbdfd369bd7887d610b70353a5e9e9e56d9016b9c3512f443f0d683eca4bc9a173c86d0851cd9ce8aff5543591dc1859bdfa1c"}

If it helps, it appears that geth prepends the string \x19Ethereum Signed Message:\n<length of message> to the data before signing it.

@lacabra
Copy link

lacabra commented Mar 20, 2018

For the record, different supported wallets by MyEtherWallet sign messages differently, so it matters which wallet you use, and as @onedrop reports above some are not compatible with the standard that Ethereum uses (geth, etherscan, etc). My current observations are that Metamask and Ledger are fully compatible, MEW's keystore/private key is mostly compatible (but it breaks on some types of inputs) and Trezor signs it using its own way (see this thread: ethereum/go-ethereum#14794).

So if you are expecting something that works across the board, you will be disappointed :(

@tamaile
Copy link

tamaile commented Sep 9, 2018

im also here icant verify my contrract address

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants