Closed themandalore closed 1 month ago
And to document the issue, we have a problem with manual hardhat testing of the bridge functionality. On the cosmos side, we use keyring.Sign method for signing bridge messages. This method automatically sha256 hashes a message before signing. On the ethereum side, the ethers.js/web3.js signing methods tend to sign with sign(keccak256("\x19Ethereum Signed Message:\n" + len(message) + message))). This has created a mismatch when running manual bridge tests.
Here is another possible method to try:
https://github.com/pubkey/eth-crypto?tab=readme-ov-file#sign
or this, used by ethers.js:
I found a solution in old ethers.js, and this is fixed in the tests. Closing this issue
Maybe this: https://hackmd.io/@0xGhastly/H1GlUwiZh