Skip to content

Commit 46d492c

Browse files
committed
feat: initial
0 parents  commit 46d492c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+6688
-0
lines changed

.github/ISSUE_TEMPLATE/bug_report.yml

+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: "🐛 Bug Report"
2+
description: Create a new ticket for a bug.
3+
title: "🐛 [BUG] - <title>"
4+
labels: ["bug"]
5+
body:
6+
- type: markdown
7+
attributes:
8+
value: "## Thanks for filing this out ❤️!"
9+
- type: textarea
10+
id: description
11+
attributes:
12+
label: "Description"
13+
placeholder: Short and explicit description of your incident...
14+
validations:
15+
required: true
16+
- type: textarea
17+
id: reproduction
18+
attributes:
19+
label: "Reproduction steps"
20+
placeholder: How can we reproduce the issue?
21+
validations:
22+
required: false
23+
- type: dropdown
24+
id: os
25+
attributes:
26+
label: "OS"
27+
description: What is the impacted environment?
28+
multiple: true
29+
options:
30+
- Windows
31+
- Linux
32+
- Mac
33+
validations:
34+
required: false
35+
- type: textarea
36+
id: additional_context
37+
attributes:
38+
label: "Additional context"
39+
placeholder: Provide any additional information.
40+
validations:
41+
required: false

.github/ISSUE_TEMPLATE/config.yml

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
blank_issues_enabled: true
+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: "💡 Feature Request"
2+
description: Create a new ticket for a new feature request
3+
title: "💡 [REQUEST] - <title>"
4+
labels: ["enhancement"]
5+
body:
6+
- type: markdown
7+
attributes:
8+
value: "## Thanks for filing this out ❤️!"
9+
- type: textarea
10+
id: summary
11+
attributes:
12+
label: "Summary"
13+
placeholder: Provide a brief explanation of the feature...
14+
validations:
15+
required: true
16+
- type: textarea
17+
id: basic_example
18+
attributes:
19+
label: "Basic Example"
20+
placeholder: Provide a basic example of how the feature would work...
21+
validations:
22+
required: false
23+
- type: textarea
24+
id: additional_context
25+
attributes:
26+
label: "Additional context"
27+
placeholder: Provide any additional information.
28+
validations:
29+
required: false

.github/workflows/benchmark.yml

+49
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: Benchmarks
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
9+
jobs:
10+
test:
11+
name: Benchmark library
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Checkout sources
15+
uses: actions/checkout@v4
16+
17+
- name: Install Nargo
18+
uses: noir-lang/[email protected]
19+
with:
20+
toolchain: 1.0.0-beta.3
21+
22+
- name: Install bb
23+
run: |
24+
npm install -g bbup
25+
bbup -nv 1.0.0-beta.3
26+
sudo apt install libc++-dev
27+
28+
- name: Build Noir benchmark programs
29+
run: nargo export
30+
31+
- name: Generate gates report
32+
run: ./scripts/build-gates-report.sh
33+
env:
34+
BACKEND: /home/runner/.bb/bb
35+
36+
- name: Compare gates reports
37+
id: gates_diff
38+
uses: noir-lang/noir-gates-diff@dbe920a8dcc3370af4be4f702ca9cef29317bec1
39+
with:
40+
report: gates_report.json
41+
summaryQuantile: 0.9 # only display the 10% most significant circuit size diffs in the summary (defaults to 20%)
42+
43+
- name: Add gates diff to sticky comment
44+
if: github.event_name == 'pull_request' || github.event_name == 'pull_request_target'
45+
uses: marocchino/sticky-pull-request-comment@v2
46+
with:
47+
# delete the comment in case changes no longer impact circuit sizes
48+
delete: ${{ !steps.gates_diff.outputs.markdown }}
49+
message: ${{ steps.gates_diff.outputs.markdown }}

.github/workflows/nightly-canary.yml

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Noir Nightly Canary
2+
3+
on:
4+
schedule:
5+
# Run a check at 9 AM UTC
6+
- cron: "0 9 * * *"
7+
8+
env:
9+
CARGO_TERM_COLOR: always
10+
11+
permissions:
12+
issues: write
13+
14+
jobs:
15+
test:
16+
name: Test on Nargo ${{matrix.toolchain}}
17+
runs-on: ubuntu-latest
18+
steps:
19+
- name: Checkout sources
20+
uses: actions/checkout@v4
21+
22+
- name: Install Nargo
23+
uses: noir-lang/[email protected]
24+
with:
25+
toolchain: nightly
26+
27+
- name: Run Noir tests
28+
run: nargo test
29+
30+
- name: Alert on dead links
31+
uses: JasonEtco/create-an-issue@v2
32+
if: ${{ failure() }}
33+
env:
34+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
35+
WORKFLOW_NAME: ${{ github.workflow }}
36+
WORKFLOW_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
37+
with:
38+
update_existing: true
39+
filename: .github/NIGHTLY_CANARY_DIED.md
40+
+53
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: Check PR Title
2+
3+
on:
4+
merge_group:
5+
pull_request:
6+
types:
7+
- opened
8+
- reopened
9+
- edited
10+
- synchronize
11+
12+
jobs:
13+
lint:
14+
runs-on: ubuntu-latest
15+
permissions:
16+
statuses: write
17+
pull-requests: write
18+
steps:
19+
- name: Check that PR title follows semantic commit specification
20+
uses: amannn/action-semantic-pull-request@v5
21+
id: lint_pr_title
22+
env:
23+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
24+
25+
- name: Inform about diverging PR title naming
26+
uses: marocchino/sticky-pull-request-comment@v2
27+
# When the previous steps fail, the workflow would stop. By adding this
28+
# condition you can continue the execution with the populated error message.
29+
if: always() && (steps.lint_pr_title.outputs.error_message != null)
30+
with:
31+
header: pr-title-lint-error
32+
message: |
33+
Hey there! 👋
34+
35+
We require pull request titles to follow the [Conventional Commits specification](https://www.conventionalcommits.org/en/v1.0.0/) and it looks like your proposed title needs to be adjusted.
36+
Examples of valid PR titles:
37+
38+
- feat: support new error codes
39+
- fix(config): correct env resolution
40+
- ci: add new workflow for linting
41+
42+
Details:
43+
44+
```
45+
${{ steps.lint_pr_title.outputs.error_message }}
46+
```
47+
48+
- name: Delete a comment if the issue resolved
49+
uses: marocchino/sticky-pull-request-comment@v2
50+
if: ${{ steps.lint_pr_title.outputs.error_message == null }}
51+
with:
52+
header: pr-title-lint-error
53+
delete: true

.github/workflows/release.yml

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
release-please:
10+
name: Create Release
11+
outputs:
12+
release-pr: ${{ steps.release.outputs.pr }}
13+
tag-name: ${{ steps.release.outputs.tag_name }}
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Run release-please
17+
id: release
18+
uses: google-github-actions/release-please-action@v3
19+
with:
20+
token: ${{ secrets.GITHUB_TOKEN }}
21+
command: manifest
22+

.github/workflows/test.yml

+88
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
name: Noir tests
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
9+
env:
10+
CARGO_TERM_COLOR: always
11+
MINIMUM_NOIR_VERSION: v1.0.0-beta.3
12+
13+
jobs:
14+
noir-version-list:
15+
name: Query supported Noir versions
16+
runs-on: ubuntu-latest
17+
outputs:
18+
noir_versions: ${{ steps.get_versions.outputs.versions }}
19+
20+
steps:
21+
- name: Checkout sources
22+
id: get_versions
23+
run: |
24+
# gh returns the Noir releases in reverse chronological order so we keep all releases published after the minimum supported version.
25+
VERSIONS=$(gh release list -R noir-lang/noir --exclude-pre-releases --json tagName -q 'map(.tagName) | index(env.MINIMUM_NOIR_VERSION) as $index | if $index then .[0:$index+1] else [env.MINIMUM_NOIR_VERSION] end')
26+
echo "versions=$VERSIONS"
27+
echo "versions=$VERSIONS" >> $GITHUB_OUTPUT
28+
env:
29+
GH_TOKEN: ${{ github.token }}
30+
31+
test:
32+
needs: [noir-version-list]
33+
name: Test on Nargo ${{matrix.toolchain}}
34+
runs-on: ubuntu-latest
35+
strategy:
36+
fail-fast: false
37+
matrix:
38+
toolchain: ${{ fromJson( needs.noir-version-list.outputs.noir_versions )}}
39+
include:
40+
- toolchain: nightly
41+
steps:
42+
- name: Checkout sources
43+
uses: actions/checkout@v4
44+
45+
- name: Install Nargo
46+
uses: noir-lang/[email protected]
47+
with:
48+
toolchain: ${{ matrix.toolchain }}
49+
50+
- name: Run Noir tests
51+
run: nargo test
52+
53+
format:
54+
runs-on: ubuntu-latest
55+
steps:
56+
- name: Checkout sources
57+
uses: actions/checkout@v4
58+
59+
- name: Install Nargo
60+
uses: noir-lang/[email protected]
61+
with:
62+
toolchain: ${{env.MINIMUM_NOIR_VERSION}}
63+
64+
- name: Run formatter
65+
run: nargo fmt --check
66+
67+
# This is a job which depends on all test jobs and reports the overall status.
68+
# This allows us to add/remove test jobs without having to update the required workflows.
69+
tests-end:
70+
name: Noir End
71+
runs-on: ubuntu-latest
72+
# We want this job to always run (even if the dependant jobs fail) as we want this job to fail rather than skipping.
73+
if: ${{ always() }}
74+
needs:
75+
- test
76+
- format
77+
78+
steps:
79+
- name: Report overall success
80+
run: |
81+
if [[ $FAIL == true ]]; then
82+
exit 1
83+
else
84+
exit 0
85+
fi
86+
env:
87+
# We treat any cancelled, skipped or failing jobs as a failure for the workflow as a whole.
88+
FAIL: ${{ contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') || contains(needs.*.result, 'skipped') }}

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
.idea/
2+
packages/circuits/target

LICENSE

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2025 Distributed Lab
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Semaphore in Noir
2+
3+
[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)
4+
5+
This repository contains functionality needed to use [semaphore-protocol](https://semaphore.pse.dev/)
6+
with [Noir](https://noir-lang.org/).
7+
8+
## Circuit
9+
10+
As original one is written in [Circom](https://docs.circom.io/), package in this repository contains
11+
Noir implementation, see [circuits](./packages/circuits/).
12+
13+
## Contracts
14+
15+
As original contracts are designed to verify [SnarkJS](https://github.com/iden3/snarkjs) proofs,
16+
we source minimally updated contracts to work with Barrenberg UltraPlonk, see [contracts](./packages/contracts/).
17+
18+
## Typescript
19+
20+
Original [@semaphore-protocol/proof](https://www.npmjs.com/package/@semaphore-protocol/proof)
21+
package works using SnarkJS as a zero-knowledge backeng, while updated in this repository package supports Barrenberg UltraPlonk, see [proof](/packages/proof).

0 commit comments

Comments
 (0)