/Verifying-Signature

How to verify a signature with hardhat and ethers.js

Primary LanguageJavaScript

Advanced Sample Hardhat Project

This project demonstrates an advanced Hardhat use case, integrating other tools commonly used alongside Hardhat in the ecosystem.

The project comes with a sample contract, a test for that contract, a sample script that deploys that contract, and an example of a task implementation, which simply lists the available accounts. It also comes with a variety of other tools, preconfigured to work with the project code.

Try running some of the following tasks:

npx hardhat accounts
npx hardhat compile
npx hardhat clean
npx hardhat test

/* Signature Verification

How to Sign and Verify

Signing

  1. Create message to sign
  2. Hash the message
  3. Sign the hash (off chain, keep your private key secret)

Verify

  1. Recreate hash from the original message
  2. Recover signer from signature and hash
  3. Compare recovered signer to claimed signer
  4. return true if it correct */