Verifies that a signature is a valid ECDSA signature and outputs the hash of that signature.
- Clone the repository with
git clone [email protected]:BigWhaleLabs/seal-hub-ecdsa-verifier-contract.git - Install the dependencies with
yarn - Download the ptau file with
yarn download-ptau - Add environment variables to your
.envfile - Run
yarn generate-inputsto generate random circuit inputs - Run
yarn compileto compile the circom circuit, create proof, verify proof, export verifiers as a solidity files - Run
yarn testto run the test suits - Use the artifacts from the
publicfolder in snarkjs - Run
yarn deployto deploy the verifier smart contract to blockchain - Run
yarn releaseto publish an NPM package with typings that can later be used in any of your JS/TS projects
| Name | Description |
|---|---|
ETHERSCAN_API_KEY |
Etherscan API key |
ETH_RPC |
Ethereum RPC URL |
CONTRACT_OWNER_PRIVATE_KEY |
Private key of the contract owner |
Also check out the .env.example file for more information.
yarn build— compiles the contracts' ts interfaces to thetypechaindirectoryyarn compile- compiles the circom circuit, creates proof, verifies proof, exports verifier as a solidity file, exports artifacts to thepublicdirectoryyarn test— runs the test suiteyarn deploy— deploys the contract to the networkyarn eth-lint— runs the linter for the solidity contractsyarn lint— runs all the lintersyarn prettify— prettifies the code in th projectyarn release— relases thetypechaindirectory to NPMyarn download-ptau-{n}— downloads the relevant ptau fileyarn download-public— downloads the relevant public binary files
- 2023-03-04: @bankisan reported the exploit allowing to bypass the signature verification by setting both
randsto1. Hence thetest/ecdsaExploit.tsfile and theexploit-proofsfolder. The exploit was fixed on 2023-03-06 before the code was deployed to mainnet.