Replies: 1 comment 1 reply
-
The The The difference you are seeing is when you have leading zeros, such as For your purposes, you should likely only need Does that make sense? |
Beta Was this translation helpful? Give feedback.
-
The The The difference you are seeing is when you have leading zeros, such as For your purposes, you should likely only need Does that make sense? |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
When using
signMessage()
with a messageHash, I’ve noticed that signing withethers.getBytes(messageHash)
produces a valid signature that matches what the smart contract expects (i.e., verifiable using ECDSA.recover(...)).However, when I use
toBeArray(messageHash)
instead, the signature verification only works inconsistently — sometimes it passes, sometimes it fails, even with the exact same signing logic and contract.What’s the precise difference between
getBytes
andtoBeArray
in this context?I’ve also read that related contents from
Beta Was this translation helpful? Give feedback.
All reactions