Skip to content

Instantly share code, notes, and snippets.

@miguelmota
Last active December 2, 2019 01:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save miguelmota/6daf1bcb09e89ed5f5c8fed0473f4937 to your computer and use it in GitHub Desktop.
Save miguelmota/6daf1bcb09e89ed5f5c8fed0473f4937 to your computer and use it in GitHub Desktop.
Web3 ethers.js ecrecover account
const msgBytes = ethers.utils.arrayify(msgHex)
const sigBytes = ethers.utils.arrayify(sigHex)
const msgSigner = utils.verifyMessage(msgBytes, sigBytes)
// equivalent of:
// const msgSigner = await web3.eth.accounts.recover(msgHex, sigHex)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment