cawfree / zk-starter

zero knowledge for those with zero knowledge

Home Page:https://twitter.com/cawfree

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

zk-starter

The easiest way to integrate succinct verifiable on-chain computation using hidden information in custom applications that execute on a credibly-neutral immutable public ledger.

Essentially, it's zero knowledge for those with zero knowledge.

🚀 Getting Started

  1. Clone the repository using git clone https://github.com/cawfree/zk-starter.
  2. Make sure you've installed Rust and Foundry:
curl --proto '=https' --tlsv1.2 https://sh.rustup.rs -sSf | sh # install rust
curl -L https://foundry.paradigm.xyz | bash # install foundry
  1. Run yarn, which will install circom and automate a new Powers of Tau ceremony, then finally compile your arithmetic circuits. When you make changes to your circuits, you can also use yarn to recompile them alongside their dependent smart contracts.

💡 All the build artifacts are cached, so you'll only be required to do this once-per-installation.

⚠️ By default, zk-starter is configured not to track the results of ceremonies. You can delete the ignore flag of the build/ directory within the .gitignore to avoid data loss.

  1. Finally, run yarn dev to execute the entire stack on http://localhost:3000. This will redeploy the auto-generated verifier logic made available to your smart contracts on the anvil local chain and inject the relevant configuration properties into your frontend.

♻️ Adding New Circuits

zk-starter's build life cycle ensures that for each new arithmetic circuit you build, a corresponding Solidity smart contract which inherits a compatible verifier will also be initialized for you to extend.

Likewise, for each circuit you create, a matching utility library is provided to the applicaton frontend at compile time. This yields namespaced high-level functions for generating and verifying proofs, and abstracting away the complexity of smart contract invocation for on-chain verification.

🙏 Attribution

This monorepo was inspired by BattleZips 🏴‍☠️ (Git). Thank you for helping increase accessibility to the state-of-the-art in modern cryptography.

✌️ License

MIT

About

zero knowledge for those with zero knowledge

https://twitter.com/cawfree

License:MIT License


Languages

Language:Solidity 93.7%Language:TypeScript 5.2%Language:Shell 0.6%Language:JavaScript 0.4%Language:Makefile 0.1%Language:Nix 0.0%Language:CSS 0.0%