Starter for the ZK projects
- Solidity 48.4%
- TypeScript 37.9%
- Shell 7.4%
- Circom 6.3%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
Non-Pages workflows move to .forgejo/workflows; GitHub (a push mirror) keeps only Pages. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> |
||
| .forgejo/workflows | ||
| .github | ||
| .vscode | ||
| .yarn | ||
| build | ||
| circuits | ||
| contracts | ||
| inputs | ||
| pot | ||
| public | ||
| scripts | ||
| test | ||
| types/snarkjs | ||
| utils | ||
| .env.example | ||
| .eslintignore | ||
| .eslintrc.json | ||
| .gitignore | ||
| .nvmrc | ||
| .prettierignore | ||
| .prettierrc | ||
| .solhint.json | ||
| .solhintignore | ||
| .yarnrc.yml | ||
| hardhat.config.ts | ||
| LICENSE | ||
| package.json | ||
| README.md | ||
| tsconfig.json | ||
| yarn.lock | ||
Zero-Knowledge starter
A zero-config zero-knowledge project starter. Just clone, install dependencies and start developing. Heavily inspired by BigWhaleLabs/seal-cred-verifier-contract. Features included:
- Test suits for both the circuits and the smart contracts
- Set of scripts to compile circuits and deploy smart contracts
- VSCode extensions list to streamline the development
- Linters for all the code you write
- One command to deploy an NPM package with smart contract typings for TypeScript
- Smart contracts are versioned by default
- Automatic Etherscan verification of deployed contracts
Features not included:
- Messing with config files instead of building circuits
Usage
- Clone the repository with
git clone git@github.com:backmeupplz/zk-starter.git - Install the dependencies with
yarn - Add environment variables to your
.envfile - Check out
yarn generate-inputsscript and modify it so that you get the correct inputs are generated for your circuits, then runyarn generate-inputs - Run
yarn compileto compile the circom circuits, create proof, verify proof, export verifier as a solidity Verifier.sol - Run
yarn testto run the test suits and make sure your circuits are robust - Use the artifacts from the
publicfolder in snarkjs - Run
yarn deployto deploy the verifier smart contracts to blockchain - Run
yarn releaseto publish an NPM package with typings that can later be used in any of your JS/TS projects
Bonus
- Check out
scripts/compile-circuit.shfor complete understanding of what's going on when compiling the circuits - Feel free to increase/decrease tau factors in the
potfolder as you number of constraints grows or shrinks
Environment variables
| 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.
Available scripts
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 NPM