-
Notifications
You must be signed in to change notification settings - Fork 83
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
Ethereum message signing hex preview incorrect #2
Comments
This other hash is the sha256 hash of the message you're signing - it has been implemented this way so the user can verify it using a third party hashing solution not aware of specific Ethereum rules if the message is long |
Thanks for the reply @btchip, applying the sha256 to:
returns:
With the 0x prefix and:
Without it. Neither matches:
Can you show an example and which implementation of |
Hi you need to hash the actual data not it's ascii representation.
2017-08-09 10:51 GMT+02:00 Fabio Berger <notifications@github.com>:
… Thanks for the reply @btchip <https://github.com/btchip>, applying the
sha256 to:
0x21c78f55e3f54ab5d872bfea03ad05d7bfb3d35dc1a537fd3ae731cdbb9bea21
returns:
C234EDC89887D503823DA1AFE86C669F4B7FCFC2DC2D44334B4B02E7ECB5F019
With the 0x prefix and:
C8A9EF7D671BBB549D7736780819BF6D383A42EE7B7F2A59DC173F8FE701CFFF
Without it.
Neither matches:
1DAO...8EEE
Can you show an example and which implementation of sha256 is being used?
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#2 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ACcnwAr31tgHR9YU3rEtkQy5vTX6KiJQks5sWXMogaJpZM4OxmDc>
.
--
Pierre Pollastri.
|
@pollastri-pierre could you perhaps post an example? |
here's a Python example >>> x = "3bd03be584f9df8a79ed49d8502c63d5fcff148157544242ffdbcc2b64321b1e".decode('hex')
>>> import hashlib
>>> h = hashlib.sha256()
>>> h.update(x)
>>> h.digest().encode('hex')
'1da0d1ce808a922fd381994f85fb8da16f464e4078cc6a20899bbd9956ff8eee' |
Looking great 👍 so closing that one |
Sample create wallet, account and transaction builder
Fix/db abstraction c++ permissive
When signing this message on a Ledger Nano S:
which is the result of running:
through:
I am shown the following "message hash" on the Ledger Nano S display when prompted to confirm the signing:
When I'd expect to be shown:
If I disregard this discrepancy and sign the message anyway and verify the
v
,r
,s
values with the message I sent to the Ledger, I can verify that it is in-fact the message that was signed. The signature is valid for the expected value.Why is this other "message hash" being presented to the user? Where does it come from? Any clarity on this would be great since we want our users to be able to confirm that they are signing the exact message they think they are signing.
The text was updated successfully, but these errors were encountered: