Skip to content

Commit

Permalink
chore: remove circuits from repo (#284)
Browse files Browse the repository at this point in the history
* chore: remove circuits from repo

Circuits have been moved to the zk-kit.circom and zk-kit.noir repositories to better organize the
code. Thus, they will be removed from the main zk-kit repo.

re #282

* chore: update lockfile

* docs: update readme file

re #282

* chore: remove eddsa-proof package

The `eddsa-proof` package has been moved to the semaphore-extensions repo with another name:
`identity-proof`.

re #282

* docs(poseidon-proof): update link to circuit

re #282

* Update README.md

Co-authored-by: Giacomo <giacomo.corrias7@gmail.com>

* chore: update turbo conf

re #282

* chore: update lockfile

* style: format code with prettier

re #282

---------

Co-authored-by: Giacomo <giacomo.corrias7@gmail.com>
  • Loading branch information
cedoor and 0xjei committed May 14, 2024
1 parent eb0efde commit 2d5d61d
Show file tree
Hide file tree
Showing 74 changed files with 20 additions and 5,604 deletions.
18 changes: 0 additions & 18 deletions .github/workflows/production.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ jobs:
fail-fast: false
matrix:
type:
- circuits
- contracts
- libraries

Expand All @@ -44,22 +43,6 @@ jobs:
node-version: "20"
cache: yarn

# https://github.com/iden3/circuits/blob/8fffb6609ecad0b7bcda19bb908bdb544bdb3cf7/.github/workflows/main.yml#L18-L22
# https://stackoverflow.com/a/78377916
- name: Setup Circom deps
if: matrix.type != 'libraries'
run: |
sudo rm /etc/apt/sources.list.d/microsoft-prod.list
sudo apt-get update && sudo apt-get install -y nlohmann-json3-dev libgmp-dev nasm build-essential
- name: Setup Circom
run: wget https://github.com/iden3/circom/releases/latest/download/circom-linux-amd64 && sudo mv ./circom-linux-amd64 /usr/bin/circom && sudo chmod +x /usr/bin/circom

- name: Install Nargo
uses: noir-lang/noirup@v0.1.3
with:
toolchain: 0.26.0

- name: Install dependencies
run: yarn

Expand All @@ -70,7 +53,6 @@ jobs:
run: yarn test:${{ matrix.type }}

- name: Coveralls
if: matrix.type != 'circuits'
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
Expand Down
26 changes: 0 additions & 26 deletions .github/workflows/pull-requests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,50 +33,24 @@ jobs:
fail-fast: false
matrix:
type:
- circuits
- contracts
- libraries

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Get changed files
id: changed-files-contracts
uses: tj-actions/changed-files@v44
with:
files: |
packages/**.sol/**
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: "20"
cache: yarn

# https://github.com/iden3/circuits/blob/8fffb6609ecad0b7bcda19bb908bdb544bdb3cf7/.github/workflows/main.yml#L18-L22
# https://stackoverflow.com/a/78377916
- name: Setup Circom deps
if: matrix.type != 'libraries'
run: |
sudo rm /etc/apt/sources.list.d/microsoft-prod.list
sudo apt-get update && sudo apt-get install -y wget nlohmann-json3-dev libgmp-dev nasm g++ build-essential
- name: Setup Circom
run: wget https://github.com/iden3/circom/releases/latest/download/circom-linux-amd64 && sudo mv ./circom-linux-amd64 /usr/bin/circom && sudo chmod +x /usr/bin/circom

- name: Install Nargo
uses: noir-lang/noirup@v0.1.3
with:
toolchain: 0.26.0

- name: Install dependencies
run: yarn

- name: Build libraries and contracts
run: yarn build

- name: Test ${{ matrix.type }}
# this condition is to skip contract tests when PR changes are unrelated
if: matrix.type != 'contracts' || steps.changed-files-contracts.outputs.any_changed == 'true'
run: yarn test:${{ matrix.type }}
60 changes: 9 additions & 51 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,18 +53,24 @@
</h4>
</div>

| ZK-kit is a set of libraries (plugins, algorithms or utility functions) that can be reused in different projects and zero-knowledge protocols, making it easier for developers to access user-friendly, tested, and documented libraries for common tasks. |
| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| ZK-Kit is a set of libraries (algorithms or utility functions) that can be reused in different projects and zero-knowledge protocols, making it easier for developers to access user-friendly, tested, and documented code for common tasks. ZK-Kit provides different repositories for each language - this one contains JavaScript and Solidity code only. |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |

[Yarn workspaces](https://yarnpkg.com/features/workspaces): minimal monorepo package management (`yarn`, `yarn build`, `yarn docs`)\
[Conventional Commits](https://www.conventionalcommits.org): human and machine readable meaning to commit messages (`yarn commit`)\
[Jest](https://jestjs.io/): tests and test coverage for all libraries (`yarn test:libraries`)\
[Mocha](https://mochajs.org/): tests for circuits and contracts (`yarn test:circuits`, `yarn test:contracts`)\
[Mocha](https://mochajs.org/): tests for contracts (`yarn test:contracts`)\
[ESLint](https://eslint.org/), [Prettier](https://prettier.io/): code quality and formatting (`yarn prettier` & `yarn lint`)\
[Typedocs](https://typedoc.org/): documentation generator for TypeScript (`yarn docs`)\
[Benny](https://github.com/caderek/benny): simple benchmarking framework for JavaScript/TypeScript (`yarn benchmarks`)\
[Github actions](https://github.com/features/actions): software workflows for automatic testing, documentation deploy and code quality checks

## 🗂️ Repositories

- Javascript & Solidity: https://github.com/privacy-scaling-explorations/zk-kit
- Circom: https://github.com/privacy-scaling-explorations/zk-kit.circom
- Noir: https://github.com/privacy-scaling-explorations/zk-kit.noir

## 📦 Packages

<table>
Expand All @@ -73,26 +79,6 @@
<th>Downloads</th>
<th>Size</th>
<tbody>
<tr>
<td>
<a href="https://github.com/privacy-scaling-explorations/zk-kit/tree/main/packages/circuits">
@zk-kit/circuits
</a>
</td>
<td>
<!-- NPM version -->
<a href="https://npmjs.org/package/@zk-kit/circuits">
<img src="https://img.shields.io/npm/v/@zk-kit/circuits.svg?style=flat-square" alt="NPM version" />
</a>
</td>
<td>
<!-- Downloads -->
<a href="https://npmjs.org/package/@zk-kit/circuits">
<img src="https://img.shields.io/npm/dm/@zk-kit/circuits.svg?style=flat-square" alt="Downloads" />
</a>
</td>
<td></td>
</tr>
<tr>
<td>
<a href="https://github.com/privacy-scaling-explorations/zk-kit/tree/main/packages/eddsa-poseidon">
Expand Down Expand Up @@ -309,34 +295,6 @@
</a>
</td>
</tr>
<tr>
<td>
<a href="https://github.com/privacy-scaling-explorations/zk-kit/tree/main/packages/eddsa-proof">
@zk-kit/eddsa-proof
</a>
<a href="https://zkkit.pse.dev/modules/_zk_kit_eddsa_proof.html">
(docs)
</a>
</td>
<td>
<!-- NPM version -->
<a href="https://npmjs.org/package/@zk-kit/eddsa-proof">
<img src="https://img.shields.io/npm/v/@zk-kit/eddsa-proof.svg?style=flat-square" alt="NPM version" />
</a>
</td>
<td>
<!-- Downloads -->
<a href="https://npmjs.org/package/@zk-kit/eddsa-proof">
<img src="https://img.shields.io/npm/dm/@zk-kit/eddsa-proof.svg?style=flat-square" alt="Downloads" />
</a>
</td>
<td>
<!-- Size -->
<a href="https://bundlephobia.com/package/@zk-kit/eddsa-proof">
<img src="https://img.shields.io/bundlephobia/minzip/@zk-kit/eddsa-proof" alt="npm bundle size (scoped)" />
</a>
</td>
</tr>
<tbody>
</table>

Expand Down
7 changes: 2 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,10 @@
"build": "turbo build",
"_build:libraries": "yarn workspaces foreach -A -t --no-private run build",
"build:libraries": "turbo _build:libraries",
"test": "turbo _test:libraries _test:circuits test:coverage",
"test": "turbo _test:libraries test:coverage",
"_test:libraries": "jest --coverage",
"test:libraries": "turbo _test:libraries",
"test:library": "jest packages/${0}",
"_test:circuits": "yarn workspace @zk-kit/circuits test",
"test:circuits": "turbo _test:circuits",
"test:contracts": "turbo test:coverage",
"version:bump": "yarn workspace @zk-kit/${0} version ${1} && yarn remove:stable-version-field ${0} && NO_HOOK=1 git commit -am \"chore(${0}): v${1}\" && git tag ${0}-v${1}",
"version:publish": "yarn workspaces foreach -A --no-private npm publish --tolerate-republish --access public",
Expand All @@ -38,8 +36,7 @@
"typescript",
"monorepo",
"zero-knowledge",
"zk-snarks",
"circom"
"zk-snarks"
],
"workspaces": [
"packages/*",
Expand Down
1 change: 0 additions & 1 deletion packages/circuits/.gitattributes

This file was deleted.

3 changes: 0 additions & 3 deletions packages/circuits/.gitignore

This file was deleted.

7 changes: 0 additions & 7 deletions packages/circuits/.mocharc.json

This file was deleted.

21 changes: 0 additions & 21 deletions packages/circuits/LICENSE

This file was deleted.

77 changes: 0 additions & 77 deletions packages/circuits/README.md

This file was deleted.

45 changes: 0 additions & 45 deletions packages/circuits/circom/binary-merkle-root.circom

This file was deleted.

Loading

0 comments on commit 2d5d61d

Please sign in to comment.