Skip to content

Signature verification example in solidity with changing hash every 2 minutes for more security.

License

Notifications You must be signed in to change notification settings

codetit4n/solidity-signature-changing-hash

Repository files navigation

solidity-signature-example

Signature verification example in solidity with changing hash every 2 minutes for more security.

About the smart contract

  • The hash is generated by the smart contract using these:
    • Address of the deployed smart contract
    • Chain Id
    • Current nonce: Changes after every successful transaction
    • Hash timestamp: Timestamp which changes every 2 minutes
  • This hash will be signed by the signer and the signature can be used in transactions.
  • After a successful transaction the hash will be marked as executed and the nonce will be updated. This will prevent signature replay attacks.
  • Apart from this the hash to be signed will keep changing every 2 mintues for more security.

Steps to setup

  • Clone the repo
git clone https://github.com/codeTIT4N/solidity-signature-changing-hash
  • Install node_modules
npm install
  • Compile smart contract
npx hardhat compile
  • Run the test cases
npx hardhat test

About

Signature verification example in solidity with changing hash every 2 minutes for more security.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages