Skip to content

privacy-scaling-explorations/snark-artifacts

Repository files navigation

🗄️ SNARK Artifacts Registry

A streamlined mechanism for distributing SNARK artifacts.

snark-artifacts.pse.dev

P0tion has made conducting SNARK phase 2 trusted setup ceremonies easier for many zero-knowledge projects. However, there still seems to be no simple mechanism for distributing the artifacts generated in ceremonies. This project aims to build step-by-step a simple and easily accessible mechanism for distributing zero-knowledge artifacts (wasm/zkey files).

For more info here see: OVERVIEW.md.

Interested in contributing to this project? See the board and upcoming issues to work on or propose other ideas.

Note

This system is probably best suited to small and medium-sized circuits.

Artifacts

Package Version Downloads Circuits JS library
@zk-kit/poseidon-artifacts NPM version Downloads poseidon-proof.circom @zk-kit/poseidon-proof
@zk-kit/semaphore-artifacts NPM version Downloads semaphore.circom @semaphore-protocol/proof
@zk-kit/semaphore-identity-artifacts NPM version Downloads identity-proof.circom @semaphore-extensions/identity-proof
@zk-kit/artifacts NPM version Downloads

🚀 Features

  • Reliable endpoints: A curated set of SNARK artifacts ready for use in various zero-knowledge proof applications.
  • Easy Integration: Seamless integration with existing cryptographic frameworks and systems through utility functions.
  • Linear versioning mechanism: A simple and consistent versioning system that reflects changes in relative circuits.
  • File integrity: A system that guarantees the integrity of the artifacts.
  • Automated Distribution: A system that automatically distributes artifacts after the ceremony (possibly through P0tion).

📜 Develop

To add a new set of artifacts for your project, simply add your NPM package to the packages folder.
You can also create issue and let the core contributors add your files.

Partial clone

For a more manageable clone that includes only the packages relevant to you or none of them, we use git's sparse-checkout and --filter features. This will reduce clone time and improve git performance.

git clone --sparse --filter=blob:none <forkedUrl>

And finally, if you need a specific package:

git sparse-checkout add packages/<package>

For convenience we provide an interactive setup script.
It will ask you where to clone the repository, and what packages you want to sparse checkout.

bash <(curl https://raw.githubusercontent.com/privacy-scaling-explorations/snark-artifacts/main/scripts/bin/setup.bash) fetch

After the first time clone, you can use the following npm scripts:

  • npm run sparse-checkout: to add/remove packages from sparse checkout.
  • npm run gprf: pull rebase your active branch with --filter=blob:none to avoid downloading what you may not want (unfortunately sparse checkout alone won't prevent syncing what you haven't sparsed checkout).

Downloading artifacts

You can download all artifacts either:

  • with the snark-artifacts.pse.dev web interface
  • directly from this repository with:
    bash <(curl -sSL https://raw.githubusercontent.com/privacy-scaling-explorations/snark-artifacts/main/scripts/bin/dowload-artifacts.bash) -h
  • with functions exported in @zk-kit/artifacts
  • with the snarkli CLI