mirror of
https://github.com/semaphore-protocol/semaphore.git
synced 2026-01-13 16:48:00 -05:00
Compare commits
28 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e48099b0f1 | ||
|
|
64e313a541 | ||
|
|
662c3b5af4 | ||
|
|
f0ffd47fae | ||
|
|
c636317c2e | ||
|
|
41a2f2f7cb | ||
|
|
c591cc48e9 | ||
|
|
b2a33eaf58 | ||
|
|
8b419a024b | ||
|
|
1e53e6fc49 | ||
|
|
f9dd755b63 | ||
|
|
78edf03771 | ||
|
|
70b9bb0ddc | ||
|
|
a6bb9bba73 | ||
|
|
8cc9d7feae | ||
|
|
f72d228e51 | ||
|
|
e6d30cdb7a | ||
|
|
841ed4bbd9 | ||
|
|
437ade277a | ||
|
|
fb66869a3c | ||
|
|
8afa2252e2 | ||
|
|
7af714bb98 | ||
|
|
c434f8af5b | ||
|
|
9fec16129b | ||
|
|
482b64d031 | ||
|
|
7163e6f460 | ||
|
|
5d2e1ca5a3 | ||
|
|
031229939a |
2
.github/workflows/docs.yml
vendored
2
.github/workflows/docs.yml
vendored
@@ -40,7 +40,5 @@ jobs:
|
||||
uses: crazy-max/ghaction-github-pages@v2.5.0
|
||||
with:
|
||||
build_dir: docs
|
||||
jekyll: false
|
||||
fqdn: js.semaphore.appliedzkp.org
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
4
.gitignore
vendored
4
.gitignore
vendored
@@ -63,9 +63,7 @@ node_modules/
|
||||
# Production
|
||||
build
|
||||
dist
|
||||
docs/*
|
||||
!docs/CNAME
|
||||
!docs/index.html
|
||||
docs
|
||||
|
||||
# Hardhat
|
||||
artifacts
|
||||
|
||||
40
README.md
40
README.md
@@ -3,7 +3,7 @@
|
||||
<picture>
|
||||
<source media="(prefers-color-scheme: dark)" srcset="https://github.com/semaphore-protocol/website/blob/main/static/img/semaphore-icon-dark.svg">
|
||||
<source media="(prefers-color-scheme: light)" srcset="https://github.com/semaphore-protocol/website/blob/main/static/img/semaphore-icon.svg">
|
||||
<img width="40" alt="Semaphore icon." src="https://github.com/semaphore-protocol/website/blob/main/static/img/semaphore-icon.svg">
|
||||
<img width="40" alt="Semaphore icon" src="https://github.com/semaphore-protocol/website/blob/main/static/img/semaphore-icon.svg">
|
||||
</picture>
|
||||
Semaphore
|
||||
</h1>
|
||||
@@ -52,7 +52,7 @@
|
||||
🔎 Issues
|
||||
</a>
|
||||
<span> | </span>
|
||||
<a href="https://semaphore.appliedzkp.org/discord">
|
||||
<a href="https://semaphore.pse.dev/discord">
|
||||
🗣️ Chat & Support
|
||||
</a>
|
||||
</h4>
|
||||
@@ -61,7 +61,7 @@
|
||||
| Semaphore is a protocol, designed to be a simple and generic privacy layer for Ethereum DApps. Using zero knowledge, Ethereum users can prove their membership of a group and send signals such as votes or endorsements without revealing their original identity. |
|
||||
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
|
||||
The core of the Semaphore protocol is in the [circuit logic](/packages/circuits/scheme.png). However Semaphore also provides [Solidity contracts](/packages/contracts) and JavaScript libraries to make the steps for offchain proof creation and onchain verification easier. To learn more about Semaphore visit [semaphore.appliedzkp.org](https://semaphore.appliedzkp.org).
|
||||
The core of the Semaphore protocol is in the [circuit logic](/packages/circuits/scheme.png). However Semaphore also provides [Solidity contracts](/packages/contracts) and JavaScript libraries to make the steps for offchain proof creation and onchain verification easier. To learn more about Semaphore visit [semaphore.pse.dev](https://semaphore.pse.dev).
|
||||
|
||||
## 📦 Packages
|
||||
|
||||
@@ -94,7 +94,7 @@ The core of the Semaphore protocol is in the [circuit logic](/packages/circuits/
|
||||
<a href="/packages/identity">
|
||||
@semaphore-protocol/identity
|
||||
</a>
|
||||
<a href="https://js.semaphore.appliedzkp.org/identity">
|
||||
<a href="https://js.semaphore.pse.dev/modules/_semaphore_protocol_identity">
|
||||
(docs)
|
||||
</a>
|
||||
</td>
|
||||
@@ -116,7 +116,7 @@ The core of the Semaphore protocol is in the [circuit logic](/packages/circuits/
|
||||
<a href="/packages/group">
|
||||
@semaphore-protocol/group
|
||||
</a>
|
||||
<a href="https://js.semaphore.appliedzkp.org/group">
|
||||
<a href="https://js.semaphore.pse.dev/modules/_semaphore_protocol_group">
|
||||
(docs)
|
||||
</a>
|
||||
</td>
|
||||
@@ -138,7 +138,7 @@ The core of the Semaphore protocol is in the [circuit logic](/packages/circuits/
|
||||
<a href="/packages/proof">
|
||||
@semaphore-protocol/proof
|
||||
</a>
|
||||
<a href="https://js.semaphore.appliedzkp.org/proof">
|
||||
<a href="https://js.semaphore.pse.dev/modules/_semaphore_protocol_proof">
|
||||
(docs)
|
||||
</a>
|
||||
</td>
|
||||
@@ -160,7 +160,7 @@ The core of the Semaphore protocol is in the [circuit logic](/packages/circuits/
|
||||
<a href="/packages/data">
|
||||
@semaphore-protocol/data
|
||||
</a>
|
||||
<a href="https://js.semaphore.appliedzkp.org/data">
|
||||
<a href="https://js.semaphore.pse.dev/modules/_semaphore_protocol_data">
|
||||
(docs)
|
||||
</a>
|
||||
</td>
|
||||
@@ -220,7 +220,7 @@ The core of the Semaphore protocol is in the [circuit logic](/packages/circuits/
|
||||
<a href="/packages/heyauthn">
|
||||
@semaphore-protocol/heyauthn
|
||||
</a>
|
||||
<a href="https://js.semaphore.appliedzkp.org/heyauthn">
|
||||
<a href="https://js.semaphore.pse.dev/modules/_semaphore_protocol_heyauthn">
|
||||
(docs)
|
||||
</a>
|
||||
</td>
|
||||
@@ -251,7 +251,25 @@ The following are some of the internal and external projects that use Semaphore.
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>
|
||||
<a href="https://explorer.semaphore.appliedzkp.org">
|
||||
<a href="https://bandada.pse.dev">
|
||||
Bandada
|
||||
</a>
|
||||
</td>
|
||||
<td>
|
||||
An open-source system for managing privacy-preserving groups of anonymous individuals. Create and manage onchain and offchain Semaphore groups using UI or API.
|
||||
</td>
|
||||
<td>
|
||||
<a href="https://github.com/privacy-scaling-explorations/bandada">
|
||||
Github
|
||||
</a>|
|
||||
<a href="https://discord.com/invite/sF5CT5rzrR">
|
||||
Discord
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<a href="https://explorer.semaphore.pse.dev">
|
||||
Semaphore Explorer
|
||||
</a>
|
||||
</td>
|
||||
@@ -262,7 +280,7 @@ The following are some of the internal and external projects that use Semaphore.
|
||||
<a href="https://github.com/semaphore-protocol/explorer">
|
||||
Github
|
||||
</a>|
|
||||
<a href="https://semaphore.appliedzkp.org/discord">
|
||||
<a href="https://semaphore.pse.dev/discord">
|
||||
Discord
|
||||
</a>
|
||||
</td>
|
||||
@@ -280,7 +298,7 @@ The following are some of the internal and external projects that use Semaphore.
|
||||
<a href="https://github.com/semaphore-protocol/discord-bot">
|
||||
Github
|
||||
</a>|
|
||||
<a href="https://semaphore.appliedzkp.org/discord">
|
||||
<a href="https://semaphore.pse.dev/discord">
|
||||
Discord
|
||||
</a>
|
||||
</td>
|
||||
|
||||
123
docs/index.html
123
docs/index.html
@@ -1,123 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
|
||||
<html style="height: 100%">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta http-equiv="x-ua-compatible" content="IE=edge" />
|
||||
<title>Semaphore packages</title>
|
||||
<meta
|
||||
name="description"
|
||||
content="A monorepo of Semaphore packages."
|
||||
/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<link
|
||||
rel="stylesheet"
|
||||
href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css"
|
||||
/>
|
||||
</head>
|
||||
<body
|
||||
style="
|
||||
margin: 0;
|
||||
background-color: #EAF0F4;
|
||||
color: #000;
|
||||
height: 100%;
|
||||
font-family: 'Courier New', monospace;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: space-between;
|
||||
"
|
||||
>
|
||||
<div
|
||||
style="
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
flex: 1;
|
||||
padding: 0 20px;
|
||||
text-align: center;
|
||||
"
|
||||
>
|
||||
<div style="display: flex">
|
||||
<span style="margin-right: 5px">
|
||||
<img width="40" src="https://raw.githubusercontent.com/semaphore-protocol/website/main/static/img/semaphore-icon.svg">
|
||||
</span>
|
||||
<h1 style="margin: 0; font-size: 40px">Semaphore packages</h1>
|
||||
</div>
|
||||
<p style="max-width: 500px">
|
||||
A monorepo of Semaphore packages.
|
||||
</p>
|
||||
<ul style="list-style-type: none; padding: 0; margin: 0; margin-top: 10px"></ul>
|
||||
</div>
|
||||
<footer
|
||||
style="
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
padding: 15px 20px;
|
||||
background-color: #EAF0F4;
|
||||
"
|
||||
>
|
||||
<div
|
||||
style="
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
width: 900px;
|
||||
"
|
||||
>
|
||||
<p style="margin: 0; font-size: 16px">
|
||||
Copyright © 2022 Ethereum Foundation
|
||||
</p>
|
||||
<div>
|
||||
<a
|
||||
style="margin-right: 15px; text-decoration: none"
|
||||
target="_blank"
|
||||
href="https://github.com/semaphore-protocol/semaphore"
|
||||
>
|
||||
<i
|
||||
class="fa fa-github"
|
||||
style="font-size: 24px; color: #000"
|
||||
></i>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</footer>
|
||||
</body>
|
||||
<script>
|
||||
const url =
|
||||
"https://api.github.com/repos/semaphore-protocol/semaphore/contents?ref=gh-pages"
|
||||
|
||||
function insertLinks(packages) {
|
||||
const [element] = window.document.getElementsByTagName("ul")
|
||||
let html = ""
|
||||
|
||||
for (const package of packages) {
|
||||
html += `<li style="display: flex; align-items: center; margin-bottom: 8px">
|
||||
<a style="margin-right: 15px" target="_blank" href="https://github.com/semaphore-protocol/semaphore/tree/main/packages/${package}">
|
||||
<i class="fa fa-github" style="font-size: 24px; color: #000"></i>
|
||||
</a>
|
||||
<a style="color: #000; text-decoration: none; font-size: 16px"
|
||||
onmouseover="this.style.color='#404A4E';"
|
||||
onmouseout="this.style.color='#000';"
|
||||
target="_blank" href="https://semaphore-protocol.github.io/semaphore/${package}">
|
||||
@semaphore-protocol/${package} >
|
||||
</a></li>`
|
||||
}
|
||||
|
||||
element.innerHTML = html
|
||||
}
|
||||
|
||||
fetch(url)
|
||||
.then((response) => response.json())
|
||||
.then((data) => {
|
||||
const ignore = [".nojekyll", "index.html", "CNAME"]
|
||||
const packages = data
|
||||
.map((c) => c.name)
|
||||
.filter((name) => !ignore.includes(name))
|
||||
|
||||
localStorage.setItem("packages", JSON.stringify(packages))
|
||||
|
||||
insertLinks(packages)
|
||||
})
|
||||
</script>
|
||||
</html>
|
||||
@@ -17,7 +17,7 @@
|
||||
"lint": "eslint . --ext .js,.ts && yarn workspace contracts lint",
|
||||
"prettier": "prettier -c .",
|
||||
"prettier:write": "prettier -w .",
|
||||
"docs": "yarn workspaces foreach --no-private run docs",
|
||||
"docs": "typedoc --cname js.semaphore.pse.dev --githubPages true",
|
||||
"version:bump": "yarn workspaces foreach --no-private version -d ${0} && yarn version apply --all && git commit -am \"chore: v${0}\" && git tag v${0}",
|
||||
"version:publish": "yarn build:libraries && yarn remove:template-files && yarn workspaces foreach --no-private npm publish --tolerate-republish --access public",
|
||||
"version:release": "changelogithub",
|
||||
@@ -50,11 +50,13 @@
|
||||
"@commitlint/cli": "^16.0.2",
|
||||
"@commitlint/config-conventional": "^16.0.0",
|
||||
"@rollup/plugin-typescript": "^8.3.0",
|
||||
"@types/circomlibjs": "^0.1.4",
|
||||
"@types/download": "^8.0.1",
|
||||
"@types/glob": "^7.2.0",
|
||||
"@types/jest": "^27.4.0",
|
||||
"@types/node": "^17.0.9",
|
||||
"@types/rimraf": "^3.0.2",
|
||||
"@types/snarkjs": "^0.7.5",
|
||||
"@typescript-eslint/eslint-plugin": "^5.9.1",
|
||||
"@typescript-eslint/parser": "^5.9.1",
|
||||
"babel-jest": "^27.4.6",
|
||||
@@ -77,6 +79,7 @@
|
||||
"rollup": "^2.64.0",
|
||||
"ts-node": "^10.4.0",
|
||||
"tslib": "^2.3.1",
|
||||
"typedoc": "^0.25.1",
|
||||
"typescript": "^4.7.0"
|
||||
},
|
||||
"config": {
|
||||
|
||||
@@ -28,10 +28,10 @@
|
||||
🔎 Issues
|
||||
</a>
|
||||
<span> | </span>
|
||||
<a href="https://semaphore.appliedzkp.org/discord">
|
||||
<a href="https://semaphore.pse.dev/discord">
|
||||
🗣️ Chat & Support
|
||||
</a>
|
||||
</h4>
|
||||
</div>
|
||||
|
||||
To learn more about circuits visit [semaphore.appliedzkp.org](https://semaphore.appliedzkp.org/docs/technical-reference/circuits).
|
||||
To learn more about circuits visit [semaphore.pse.dev](https://semaphore.pse.dev/docs/technical-reference/circuits).
|
||||
|
||||
@@ -48,7 +48,7 @@ yarn deploy --semaphore <semaphore-address> --group <group-id> --network goerli
|
||||
```
|
||||
|
||||
> **Note**
|
||||
> Check the Semaphore contract addresses [here](https://semaphore.appliedzkp.org/docs/deployed-contracts#semaphore).
|
||||
> Check the Semaphore contract addresses [here](https://semaphore.pse.dev/docs/deployed-contracts#semaphore).
|
||||
|
||||
> **Warning**
|
||||
> The group id is a number!
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@semaphore-protocol/cli-template-contracts-hardhat",
|
||||
"version": "3.11.0",
|
||||
"version": "3.13.0",
|
||||
"description": "Semaphore Hardhat template.",
|
||||
"license": "Unlicense",
|
||||
"files": [
|
||||
@@ -36,10 +36,10 @@
|
||||
"@nomicfoundation/hardhat-toolbox": "^2.0.0",
|
||||
"@nomiclabs/hardhat-ethers": "^2.0.0",
|
||||
"@nomiclabs/hardhat-etherscan": "^3.0.0",
|
||||
"@semaphore-protocol/group": "3.11.0",
|
||||
"@semaphore-protocol/hardhat": "3.11.0",
|
||||
"@semaphore-protocol/identity": "3.11.0",
|
||||
"@semaphore-protocol/proof": "3.11.0",
|
||||
"@semaphore-protocol/group": "3.13.0",
|
||||
"@semaphore-protocol/hardhat": "3.13.0",
|
||||
"@semaphore-protocol/identity": "3.13.0",
|
||||
"@semaphore-protocol/proof": "3.13.0",
|
||||
"@typechain/ethers-v5": "^10.1.0",
|
||||
"@typechain/hardhat": "^6.1.2",
|
||||
"@types/chai": "^4.2.0",
|
||||
@@ -58,7 +58,7 @@
|
||||
"typescript": ">=4.5.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"@semaphore-protocol/contracts": "3.11.0"
|
||||
"@semaphore-protocol/contracts": "3.13.0"
|
||||
},
|
||||
"config": {
|
||||
"solidity": {
|
||||
|
||||
@@ -33,7 +33,7 @@ yarn deploy --semaphore <semaphore-address> --group <group-id> --network arbitru
|
||||
3. Copy your contract artifacts from `apps/contracts/build/contracts/contracts` folder to `apps/web-app/contract-artifacts` folders manually. Or run `yarn copy:contract-artifacts` in the project root to do it automatically.
|
||||
|
||||
> **Note**
|
||||
> Check the Semaphore contract addresses [here](https://semaphore.appliedzkp.org/docs/deployed-contracts).
|
||||
> Check the Semaphore contract addresses [here](https://semaphore.pse.dev/docs/deployed-contracts).
|
||||
|
||||
> **Warning**
|
||||
> The group id is a number!
|
||||
|
||||
@@ -18,10 +18,10 @@
|
||||
"@nomicfoundation/hardhat-chai-matchers": "^1.0.5",
|
||||
"@nomiclabs/hardhat-ethers": "^2.0.0",
|
||||
"@nomiclabs/hardhat-etherscan": "^3.1.7",
|
||||
"@semaphore-protocol/group": "3.11.0",
|
||||
"@semaphore-protocol/hardhat": "3.11.0",
|
||||
"@semaphore-protocol/identity": "3.11.0",
|
||||
"@semaphore-protocol/proof": "3.11.0",
|
||||
"@semaphore-protocol/group": "3.13.0",
|
||||
"@semaphore-protocol/hardhat": "3.13.0",
|
||||
"@semaphore-protocol/identity": "3.13.0",
|
||||
"@semaphore-protocol/proof": "3.13.0",
|
||||
"@typechain/ethers-v5": "^10.0.0",
|
||||
"@typechain/hardhat": "^6.0.0",
|
||||
"@types/chai": "^4.3.1",
|
||||
@@ -40,7 +40,7 @@
|
||||
"typechain": "^8.0.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"@semaphore-protocol/contracts": "3.11.0"
|
||||
"@semaphore-protocol/contracts": "3.13.0"
|
||||
},
|
||||
"config": {
|
||||
"solidity": {
|
||||
|
||||
@@ -10,10 +10,10 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@next/font": "13.0.3",
|
||||
"@semaphore-protocol/data": "3.11.0",
|
||||
"@semaphore-protocol/group": "3.11.0",
|
||||
"@semaphore-protocol/identity": "3.11.0",
|
||||
"@semaphore-protocol/proof": "3.11.0",
|
||||
"@semaphore-protocol/data": "3.13.0",
|
||||
"@semaphore-protocol/group": "3.13.0",
|
||||
"@semaphore-protocol/identity": "3.13.0",
|
||||
"@semaphore-protocol/proof": "3.13.0",
|
||||
"@types/react": "18.0.25",
|
||||
"@types/react-dom": "18.0.8",
|
||||
"dotenv": "^16.0.3",
|
||||
|
||||
@@ -84,7 +84,7 @@ export default function GroupsPage() {
|
||||
<p>
|
||||
Semaphore{" "}
|
||||
<a
|
||||
href="https://semaphore.appliedzkp.org/docs/guides/groups"
|
||||
href="https://semaphore.pse.dev/docs/guides/groups"
|
||||
target="_blank"
|
||||
rel="noreferrer noopener nofollow"
|
||||
>
|
||||
|
||||
@@ -40,7 +40,7 @@ export default function IdentitiesPage() {
|
||||
<p>
|
||||
Users interact with the protocol using a Semaphore{" "}
|
||||
<a
|
||||
href="https://semaphore.appliedzkp.org/docs/guides/identities"
|
||||
href="https://semaphore.pse.dev/docs/guides/identities"
|
||||
target="_blank"
|
||||
rel="noreferrer noopener nofollow"
|
||||
>
|
||||
|
||||
@@ -112,7 +112,7 @@ export default function ProofsPage() {
|
||||
<p>
|
||||
Semaphore members can anonymously{" "}
|
||||
<a
|
||||
href="https://semaphore.appliedzkp.org/docs/guides/proofs"
|
||||
href="https://semaphore.pse.dev/docs/guides/proofs"
|
||||
target="_blank"
|
||||
rel="noreferrer noopener nofollow"
|
||||
>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@semaphore-protocol/cli-template-monorepo-ethers",
|
||||
"version": "3.11.0",
|
||||
"version": "3.13.0",
|
||||
"description": "Semaphore Hardhat + Next.js + SemaphoreEthers template.",
|
||||
"license": "Unlicense",
|
||||
"files": [
|
||||
|
||||
@@ -33,7 +33,7 @@ yarn deploy --semaphore <semaphore-address> --group <group-id> --network arbitru
|
||||
3. Copy your contract artifacts from `apps/contracts/build/contracts/contracts` folder to `apps/web-app/contract-artifacts` folders manually. Or run `yarn copy:contract-artifacts` in the project root to do it automatically.
|
||||
|
||||
> **Note**
|
||||
> Check the Semaphore contract addresses [here](https://semaphore.appliedzkp.org/docs/deployed-contracts).
|
||||
> Check the Semaphore contract addresses [here](https://semaphore.pse.dev/docs/deployed-contracts).
|
||||
|
||||
> **Warning**
|
||||
> The group id is a number!
|
||||
|
||||
@@ -18,10 +18,10 @@
|
||||
"@nomicfoundation/hardhat-chai-matchers": "^1.0.5",
|
||||
"@nomiclabs/hardhat-ethers": "^2.0.0",
|
||||
"@nomiclabs/hardhat-etherscan": "^3.1.7",
|
||||
"@semaphore-protocol/group": "3.11.0",
|
||||
"@semaphore-protocol/hardhat": "3.11.0",
|
||||
"@semaphore-protocol/identity": "3.11.0",
|
||||
"@semaphore-protocol/proof": "3.11.0",
|
||||
"@semaphore-protocol/group": "3.13.0",
|
||||
"@semaphore-protocol/hardhat": "3.13.0",
|
||||
"@semaphore-protocol/identity": "3.13.0",
|
||||
"@semaphore-protocol/proof": "3.13.0",
|
||||
"@typechain/ethers-v5": "^10.0.0",
|
||||
"@typechain/hardhat": "^6.0.0",
|
||||
"@types/chai": "^4.3.1",
|
||||
@@ -40,7 +40,7 @@
|
||||
"typechain": "^8.0.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"@semaphore-protocol/contracts": "3.11.0"
|
||||
"@semaphore-protocol/contracts": "3.13.0"
|
||||
},
|
||||
"config": {
|
||||
"solidity": {
|
||||
|
||||
@@ -10,10 +10,10 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@next/font": "13.0.3",
|
||||
"@semaphore-protocol/data": "3.11.0",
|
||||
"@semaphore-protocol/group": "3.11.0",
|
||||
"@semaphore-protocol/identity": "3.11.0",
|
||||
"@semaphore-protocol/proof": "3.11.0",
|
||||
"@semaphore-protocol/data": "3.13.0",
|
||||
"@semaphore-protocol/group": "3.13.0",
|
||||
"@semaphore-protocol/identity": "3.13.0",
|
||||
"@semaphore-protocol/proof": "3.13.0",
|
||||
"@types/react": "18.0.25",
|
||||
"@types/react-dom": "18.0.8",
|
||||
"dotenv": "^16.0.3",
|
||||
|
||||
@@ -84,7 +84,7 @@ export default function GroupsPage() {
|
||||
<p>
|
||||
Semaphore{" "}
|
||||
<a
|
||||
href="https://semaphore.appliedzkp.org/docs/guides/groups"
|
||||
href="https://semaphore.pse.dev/docs/guides/groups"
|
||||
target="_blank"
|
||||
rel="noreferrer noopener nofollow"
|
||||
>
|
||||
|
||||
@@ -40,7 +40,7 @@ export default function IdentitiesPage() {
|
||||
<p>
|
||||
Users interact with the protocol using a Semaphore{" "}
|
||||
<a
|
||||
href="https://semaphore.appliedzkp.org/docs/guides/identities"
|
||||
href="https://semaphore.pse.dev/docs/guides/identities"
|
||||
target="_blank"
|
||||
rel="noreferrer noopener nofollow"
|
||||
>
|
||||
|
||||
@@ -112,7 +112,7 @@ export default function ProofsPage() {
|
||||
<p>
|
||||
Semaphore members can anonymously{" "}
|
||||
<a
|
||||
href="https://semaphore.appliedzkp.org/docs/guides/proofs"
|
||||
href="https://semaphore.pse.dev/docs/guides/proofs"
|
||||
target="_blank"
|
||||
rel="noreferrer noopener nofollow"
|
||||
>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@semaphore-protocol/cli-template-monorepo-subgraph",
|
||||
"version": "3.11.0",
|
||||
"version": "3.13.0",
|
||||
"description": "Semaphore Hardhat + Next.js + SemaphoreSubgraph template.",
|
||||
"license": "Unlicense",
|
||||
"files": [
|
||||
|
||||
@@ -40,7 +40,7 @@
|
||||
🔎 Issues
|
||||
</a>
|
||||
<span> | </span>
|
||||
<a href="https://semaphore.appliedzkp.org/discord">
|
||||
<a href="https://semaphore.pse.dev/discord">
|
||||
🗣️ Chat & Support
|
||||
</a>
|
||||
</h4>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@semaphore-protocol/cli",
|
||||
"type": "module",
|
||||
"version": "3.11.0",
|
||||
"version": "3.13.0",
|
||||
"description": "A command line tool to set up your Semaphore project and get group data.",
|
||||
"license": "MIT",
|
||||
"bin": {
|
||||
@@ -39,11 +39,10 @@
|
||||
"@types/semver": "^7.3.13",
|
||||
"rollup-plugin-cleanup": "^3.2.1",
|
||||
"rollup-plugin-typescript2": "^0.31.2",
|
||||
"ts-node": "^10.9.1",
|
||||
"typedoc": "^0.22.11"
|
||||
"ts-node": "^10.9.1"
|
||||
},
|
||||
"dependencies": {
|
||||
"@semaphore-protocol/data": "3.11.0",
|
||||
"@semaphore-protocol/data": "3.13.0",
|
||||
"axios": "^1.3.2",
|
||||
"boxen": "^7.0.1",
|
||||
"chalk": "^5.1.2",
|
||||
|
||||
@@ -132,7 +132,10 @@ program
|
||||
|
||||
const groupIds = await getGroupIds(network)
|
||||
|
||||
if (groupIds === null) return
|
||||
if (groupIds === null) {
|
||||
console.info(`\n ${logSymbols.info}`, `info: there are no groups on the '${network}' network\n`)
|
||||
return
|
||||
}
|
||||
|
||||
const content = `${chalk.bold("Groups")} (${groupIds.length}): \n${groupIds
|
||||
.map((id: any) => ` - ${id}`)
|
||||
@@ -160,7 +163,10 @@ program
|
||||
if (!groupId) {
|
||||
const groupIds = await getGroupIds(network)
|
||||
|
||||
if (groupIds === null) return
|
||||
if (groupIds === null) {
|
||||
console.info(`\n ${logSymbols.info}`, `info: there are no groups on the '${network}' network\n`)
|
||||
return
|
||||
}
|
||||
|
||||
groupId = await getGroupId(groupIds)
|
||||
}
|
||||
@@ -193,6 +199,11 @@ program
|
||||
}
|
||||
}
|
||||
|
||||
if (!group) {
|
||||
console.info(`\n ${logSymbols.error}`, "error: the group does not exist\n")
|
||||
return
|
||||
}
|
||||
|
||||
let content = ` ${chalk.bold("Id")}: ${group.id}\n`
|
||||
content += ` ${chalk.bold("Admin")}: ${group.admin}\n`
|
||||
content += ` ${chalk.bold("Merkle tree")}:\n`
|
||||
@@ -223,7 +234,10 @@ program
|
||||
if (!groupId) {
|
||||
const groupIds = await getGroupIds(network)
|
||||
|
||||
if (groupIds === null) return
|
||||
if (groupIds === null) {
|
||||
console.info(`\n ${logSymbols.info}`, `info: there are no groups on the '${network}' network\n`)
|
||||
return
|
||||
}
|
||||
|
||||
groupId = await getGroupId(groupIds)
|
||||
}
|
||||
@@ -286,7 +300,10 @@ program
|
||||
if (!groupId) {
|
||||
const groupIds = await getGroupIds(network)
|
||||
|
||||
if (groupIds === null) return
|
||||
if (groupIds === null) {
|
||||
console.info(`\n ${logSymbols.info}`, `info: there are no groups on the '${network}' network\n`)
|
||||
return
|
||||
}
|
||||
|
||||
groupId = await getGroupId(groupIds)
|
||||
}
|
||||
|
||||
@@ -34,13 +34,13 @@
|
||||
🔎 Issues
|
||||
</a>
|
||||
<span> | </span>
|
||||
<a href="https://semaphore.appliedzkp.org/discord">
|
||||
<a href="https://semaphore.pse.dev/discord">
|
||||
🗣️ Chat & Support
|
||||
</a>
|
||||
</h4>
|
||||
</div>
|
||||
|
||||
To learn more about contracts visit [semaphore.appliedzkp.org](https://semaphore.appliedzkp.org/docs/technical-reference/contracts).
|
||||
To learn more about contracts visit [semaphore.pse.dev](https://semaphore.pse.dev/docs/technical-reference/contracts).
|
||||
|
||||
---
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@semaphore-protocol/contracts",
|
||||
"version": "3.11.0",
|
||||
"version": "3.13.0",
|
||||
"description": "Semaphore contracts to manage groups and broadcast anonymous signals.",
|
||||
"license": "MIT",
|
||||
"files": [
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
"@types/rimraf": "^3.0.2",
|
||||
"chai": "^4.3.5",
|
||||
"circomlib": "^2.0.2",
|
||||
"circomlibjs": "^0.0.8",
|
||||
"circomlibjs": "^0.1.7",
|
||||
"download": "^8.0.0",
|
||||
"ethers": "^5.6.8",
|
||||
"hardhat": "^2.9.7",
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { poseidon_gencontract as poseidonContract } from "circomlibjs"
|
||||
import { poseidonContract } from "circomlibjs"
|
||||
import { task, types } from "hardhat/config"
|
||||
|
||||
task("deploy:semaphore-voting", "Deploy a SemaphoreVoting contract")
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { poseidon_gencontract as poseidonContract } from "circomlibjs"
|
||||
import { poseidonContract } from "circomlibjs"
|
||||
import { task, types } from "hardhat/config"
|
||||
|
||||
task("deploy:semaphore-whistleblowing", "Deploy a SemaphoreWhistleblowing contract")
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { poseidon_gencontract as poseidonContract } from "circomlibjs"
|
||||
import { poseidonContract } from "circomlibjs"
|
||||
import { task, types } from "hardhat/config"
|
||||
import { saveDeployedContracts } from "../scripts/utils"
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
<a href="https://npmjs.org/package/@semaphore-protocol/data">
|
||||
<img alt="Downloads" src="https://img.shields.io/npm/dm/@semaphore-protocol/data.svg?style=flat-square" />
|
||||
</a>
|
||||
<a href="https://js.semaphore.appliedzkp.org/data">
|
||||
<a href="https://js.semaphore.pse.dev/data">
|
||||
<img alt="Documentation typedoc" src="https://img.shields.io/badge/docs-typedoc-744C7C?style=flat-square">
|
||||
</a>
|
||||
<a href="https://eslint.org/">
|
||||
@@ -43,7 +43,7 @@
|
||||
🔎 Issues
|
||||
</a>
|
||||
<span> | </span>
|
||||
<a href="https://semaphore.appliedzkp.org/discord">
|
||||
<a href="https://semaphore.pse.dev/discord">
|
||||
🗣️ Chat & Support
|
||||
</a>
|
||||
</h4>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@semaphore-protocol/data",
|
||||
"version": "3.11.0",
|
||||
"version": "3.13.0",
|
||||
"description": "A library to query Semaphore contracts.",
|
||||
"license": "MIT",
|
||||
"main": "dist/index.node.js",
|
||||
@@ -23,8 +23,7 @@
|
||||
"scripts": {
|
||||
"build:watch": "rollup -c rollup.config.ts -w --configPlugin typescript",
|
||||
"build": "rimraf dist && rollup -c rollup.config.ts --configPlugin typescript",
|
||||
"prepublishOnly": "yarn build",
|
||||
"docs": "typedoc src/index.ts --out ../../docs/data"
|
||||
"prepublishOnly": "yarn build"
|
||||
},
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
@@ -32,8 +31,7 @@
|
||||
"devDependencies": {
|
||||
"@rollup/plugin-json": "^6.0.0",
|
||||
"rollup-plugin-cleanup": "^3.2.1",
|
||||
"rollup-plugin-typescript2": "^0.31.2",
|
||||
"typedoc": "^0.22.11"
|
||||
"rollup-plugin-typescript2": "^0.31.2"
|
||||
},
|
||||
"dependencies": {
|
||||
"@ethersproject/contracts": "^5.7.0",
|
||||
|
||||
@@ -31,7 +31,11 @@ describe("SemaphoreEthers", () => {
|
||||
const semaphore2 = new SemaphoreEthers("matic")
|
||||
const semaphore3 = new SemaphoreEthers("optimism-goerli")
|
||||
const semaphore4 = new SemaphoreEthers("arbitrum-goerli")
|
||||
const semaphore5 = new SemaphoreEthers("homestead", {
|
||||
const semaphore5 = new SemaphoreEthers("arbitrum-goerli", {
|
||||
address: "0x0000000000000000000000000000000000000000",
|
||||
startBlock: 0
|
||||
})
|
||||
const semaphore6 = new SemaphoreEthers("homestead", {
|
||||
address: "0x0000000000000000000000000000000000000000",
|
||||
startBlock: 0
|
||||
})
|
||||
@@ -42,9 +46,10 @@ describe("SemaphoreEthers", () => {
|
||||
expect(semaphore2.network).toBe("maticmum")
|
||||
expect(semaphore3.network).toBe("optimism-goerli")
|
||||
expect(semaphore4.network).toBe("arbitrum-goerli")
|
||||
expect(semaphore5.network).toBe("homestead")
|
||||
expect(semaphore5.options.startBlock).toBe(0)
|
||||
expect(semaphore5.options.address).toContain("0x000000")
|
||||
expect(semaphore6.network).toBe("homestead")
|
||||
expect(semaphore6.options.startBlock).toBe(0)
|
||||
expect(semaphore6.options.address).toContain("0x000000")
|
||||
})
|
||||
|
||||
it("Should instantiate a SemaphoreEthers object with different providers", () => {
|
||||
|
||||
@@ -43,37 +43,35 @@ export default class SemaphoreEthers {
|
||||
|
||||
switch (networkOrEthereumURL) {
|
||||
case "arbitrum":
|
||||
options.address = "0xc60E0Ee1a2770d5F619858C641f14FC4a6401520"
|
||||
options.startBlock = 77278430
|
||||
options.address ??= "0xc60E0Ee1a2770d5F619858C641f14FC4a6401520"
|
||||
options.startBlock ??= 77278430
|
||||
break
|
||||
case "arbitrum-goerli":
|
||||
options.address = "0x3889927F0B5Eb1a02C6E2C20b39a1Bd4EAd76131"
|
||||
options.startBlock = 15174410
|
||||
options.address ??= "0x3889927F0B5Eb1a02C6E2C20b39a1Bd4EAd76131"
|
||||
options.startBlock ??= 15174410
|
||||
break
|
||||
case "maticmum":
|
||||
options.address = "0x3889927F0B5Eb1a02C6E2C20b39a1Bd4EAd76131"
|
||||
options.startBlock = 33995010
|
||||
options.address ??= "0x3889927F0B5Eb1a02C6E2C20b39a1Bd4EAd76131"
|
||||
options.startBlock ??= 33995010
|
||||
break
|
||||
case "goerli":
|
||||
options.address = "0x3889927F0B5Eb1a02C6E2C20b39a1Bd4EAd76131"
|
||||
options.startBlock = 8777695
|
||||
options.address ??= "0x3889927F0B5Eb1a02C6E2C20b39a1Bd4EAd76131"
|
||||
options.startBlock ??= 8777695
|
||||
break
|
||||
case "sepolia":
|
||||
options.address = "0x3889927F0B5Eb1a02C6E2C20b39a1Bd4EAd76131"
|
||||
options.startBlock = 3231111
|
||||
options.address ??= "0x3889927F0B5Eb1a02C6E2C20b39a1Bd4EAd76131"
|
||||
options.startBlock ??= 3231111
|
||||
break
|
||||
case "optimism-goerli":
|
||||
options.address = "0x3889927F0B5Eb1a02C6E2C20b39a1Bd4EAd76131"
|
||||
options.startBlock = 7632846
|
||||
options.address ??= "0x3889927F0B5Eb1a02C6E2C20b39a1Bd4EAd76131"
|
||||
options.startBlock ??= 7632846
|
||||
break
|
||||
default:
|
||||
if (options.address === undefined) {
|
||||
throw new Error(`You should provide a Semaphore contract address for this network`)
|
||||
}
|
||||
|
||||
if (options.startBlock === undefined) {
|
||||
options.startBlock = 0
|
||||
}
|
||||
options.startBlock ??= 0
|
||||
}
|
||||
|
||||
let provider: Provider
|
||||
|
||||
3
packages/data/typedoc.json
Normal file
3
packages/data/typedoc.json
Normal file
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"entryPoints": ["src/index.ts"]
|
||||
}
|
||||
@@ -18,7 +18,7 @@
|
||||
<a href="https://npmjs.org/package/@semaphore-protocol/group">
|
||||
<img alt="Downloads" src="https://img.shields.io/npm/dm/@semaphore-protocol/group.svg?style=flat-square" />
|
||||
</a>
|
||||
<a href="https://js.semaphore.appliedzkp.org/group">
|
||||
<a href="https://js.semaphore.pse.dev/group">
|
||||
<img alt="Documentation typedoc" src="https://img.shields.io/badge/docs-typedoc-744C7C?style=flat-square">
|
||||
</a>
|
||||
<a href="https://eslint.org/">
|
||||
@@ -43,7 +43,7 @@
|
||||
🔎 Issues
|
||||
</a>
|
||||
<span> | </span>
|
||||
<a href="https://semaphore.appliedzkp.org/discord">
|
||||
<a href="https://semaphore.pse.dev/discord">
|
||||
🗣️ Chat & Support
|
||||
</a>
|
||||
</h4>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@semaphore-protocol/group",
|
||||
"version": "3.11.0",
|
||||
"version": "3.13.0",
|
||||
"description": "A library to create and manage Semaphore groups.",
|
||||
"license": "MIT",
|
||||
"main": "dist/index.node.js",
|
||||
@@ -23,8 +23,7 @@
|
||||
"scripts": {
|
||||
"build:watch": "rollup -c rollup.config.ts -w --configPlugin typescript",
|
||||
"build": "rimraf dist && rollup -c rollup.config.ts --configPlugin typescript",
|
||||
"prepublishOnly": "yarn build",
|
||||
"docs": "typedoc src/index.ts --out ../../docs/group"
|
||||
"prepublishOnly": "yarn build"
|
||||
},
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
@@ -34,8 +33,7 @@
|
||||
"@rollup/plugin-node-resolve": "^15.0.1",
|
||||
"poseidon-lite": "^0.2.0",
|
||||
"rollup-plugin-cleanup": "^3.2.1",
|
||||
"rollup-plugin-typescript2": "^0.31.2",
|
||||
"typedoc": "^0.22.11"
|
||||
"rollup-plugin-typescript2": "^0.31.2"
|
||||
},
|
||||
"dependencies": {
|
||||
"@ethersproject/bignumber": "^5.7.0",
|
||||
|
||||
3
packages/group/typedoc.json
Normal file
3
packages/group/typedoc.json
Normal file
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"entryPoints": ["src/index.ts"]
|
||||
}
|
||||
@@ -40,7 +40,7 @@
|
||||
🔎 Issues
|
||||
</a>
|
||||
<span> | </span>
|
||||
<a href="https://semaphore.appliedzkp.org/discord">
|
||||
<a href="https://semaphore.pse.dev/discord">
|
||||
🗣️ Chat & Support
|
||||
</a>
|
||||
</h4>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@semaphore-protocol/hardhat",
|
||||
"version": "3.11.0",
|
||||
"version": "3.13.0",
|
||||
"description": "A Semaphore Hardhat plugin to deploy verifiers and Semaphore contract.",
|
||||
"license": "MIT",
|
||||
"main": "dist/index.node.js",
|
||||
@@ -38,8 +38,8 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@nomiclabs/hardhat-ethers": "^2.1.1",
|
||||
"@semaphore-protocol/contracts": "3.11.0",
|
||||
"circomlibjs": "^0.0.8",
|
||||
"@semaphore-protocol/contracts": "3.13.0",
|
||||
"circomlibjs": "^0.1.7",
|
||||
"ethers": "^5.7.1",
|
||||
"hardhat-dependency-compiler": "^1.1.3"
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { poseidon_gencontract as poseidonContract } from "circomlibjs"
|
||||
import { poseidonContract } from "circomlibjs"
|
||||
import { task, types } from "hardhat/config"
|
||||
|
||||
task("deploy:semaphore", "Deploy a Semaphore contract")
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
<a href="https://npmjs.org/package/@semaphore-protocol/heyauthn">
|
||||
<img alt="Downloads" src="https://img.shields.io/npm/dm/@semaphore-protocol/heyauthn.svg?style=flat-square" />
|
||||
</a>
|
||||
<a href="https://js.semaphore.appliedzkp.org/heyauthn">
|
||||
<a href="https://js.semaphore.pse.dev/heyauthn">
|
||||
<img alt="Documentation typedoc" src="https://img.shields.io/badge/docs-typedoc-744C7C?style=flat-square">
|
||||
</a>
|
||||
<a href="https://eslint.org/">
|
||||
@@ -43,7 +43,7 @@
|
||||
🔎 Issues
|
||||
</a>
|
||||
<span> | </span>
|
||||
<a href="https://semaphore.appliedzkp.org/discord">
|
||||
<a href="https://semaphore.pse.dev/discord">
|
||||
🗣️ Chat & Support
|
||||
</a>
|
||||
</h4>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@semaphore-protocol/heyauthn",
|
||||
"version": "3.11.0",
|
||||
"version": "3.13.0",
|
||||
"description": "A library to allow developers to create and manage Semaphore identities using WebAuthn",
|
||||
"license": "MIT",
|
||||
"main": "dist/index.node.js",
|
||||
@@ -23,19 +23,17 @@
|
||||
"scripts": {
|
||||
"build:watch": "rollup -c rollup.config.ts -w --configPlugin typescript",
|
||||
"build": "rimraf dist && rollup -c rollup.config.ts --configPlugin typescript",
|
||||
"prepublishOnly": "yarn build",
|
||||
"docs": "typedoc src/index.ts --out ../../docs/heyauthn"
|
||||
"prepublishOnly": "yarn build"
|
||||
},
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
"devDependencies": {
|
||||
"rollup-plugin-cleanup": "^3.2.1",
|
||||
"rollup-plugin-typescript2": "^0.31.2",
|
||||
"typedoc": "^0.22.11"
|
||||
"rollup-plugin-typescript2": "^0.31.2"
|
||||
},
|
||||
"dependencies": {
|
||||
"@semaphore-protocol/identity": "3.11.0",
|
||||
"@semaphore-protocol/identity": "3.13.0",
|
||||
"@simplewebauthn/browser": "7.2.0",
|
||||
"@simplewebauthn/server": "7.2.0"
|
||||
}
|
||||
|
||||
3
packages/heyauthn/typedoc.json
Normal file
3
packages/heyauthn/typedoc.json
Normal file
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"entryPoints": ["src/index.ts"]
|
||||
}
|
||||
@@ -18,7 +18,7 @@
|
||||
<a href="https://npmjs.org/package/@semaphore-protocol/identity">
|
||||
<img alt="Downloads" src="https://img.shields.io/npm/dm/@semaphore-protocol/identity.svg?style=flat-square" />
|
||||
</a>
|
||||
<a href="https://js.semaphore.appliedzkp.org/identity">
|
||||
<a href="https://js.semaphore.pse.dev/identity">
|
||||
<img alt="Documentation typedoc" src="https://img.shields.io/badge/docs-typedoc-744C7C?style=flat-square">
|
||||
</a>
|
||||
<a href="https://eslint.org/">
|
||||
@@ -43,7 +43,7 @@
|
||||
🔎 Issues
|
||||
</a>
|
||||
<span> | </span>
|
||||
<a href="https://semaphore.appliedzkp.org/discord">
|
||||
<a href="https://semaphore.pse.dev/discord">
|
||||
🗣️ Chat & Support
|
||||
</a>
|
||||
</h4>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@semaphore-protocol/identity",
|
||||
"version": "3.11.0",
|
||||
"version": "3.13.0",
|
||||
"description": "A library to create Semaphore identities.",
|
||||
"license": "MIT",
|
||||
"main": "dist/index.node.js",
|
||||
@@ -23,8 +23,7 @@
|
||||
"scripts": {
|
||||
"build:watch": "rollup -c rollup.config.ts -w --configPlugin typescript",
|
||||
"build": "rimraf dist && rollup -c rollup.config.ts --configPlugin typescript",
|
||||
"prepublishOnly": "yarn build",
|
||||
"docs": "typedoc src/index.ts --out ../../docs/identity"
|
||||
"prepublishOnly": "yarn build"
|
||||
},
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
@@ -34,8 +33,7 @@
|
||||
"@rollup/plugin-node-resolve": "^15.0.1",
|
||||
"poseidon-lite": "^0.2.0",
|
||||
"rollup-plugin-cleanup": "^3.2.1",
|
||||
"rollup-plugin-typescript2": "^0.31.2",
|
||||
"typedoc": "^0.22.11"
|
||||
"rollup-plugin-typescript2": "^0.31.2"
|
||||
},
|
||||
"dependencies": {
|
||||
"@ethersproject/bignumber": "^5.5.0",
|
||||
|
||||
3
packages/identity/typedoc.json
Normal file
3
packages/identity/typedoc.json
Normal file
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"entryPoints": ["src/index.ts"]
|
||||
}
|
||||
@@ -18,7 +18,7 @@
|
||||
<a href="https://npmjs.org/package/@semaphore-protocol/proof">
|
||||
<img alt="Downloads" src="https://img.shields.io/npm/dm/@semaphore-protocol/proof.svg?style=flat-square" />
|
||||
</a>
|
||||
<a href="https://js.semaphore.appliedzkp.org/proof">
|
||||
<a href="https://js.semaphore.pse.dev/proof">
|
||||
<img alt="Documentation typedoc" src="https://img.shields.io/badge/docs-typedoc-744C7C?style=flat-square">
|
||||
</a>
|
||||
<a href="https://eslint.org/">
|
||||
@@ -43,7 +43,7 @@
|
||||
🔎 Issues
|
||||
</a>
|
||||
<span> | </span>
|
||||
<a href="https://semaphore.appliedzkp.org/discord">
|
||||
<a href="https://semaphore.pse.dev/discord">
|
||||
🗣️ Chat & Support
|
||||
</a>
|
||||
</h4>
|
||||
@@ -76,7 +76,7 @@ group: _Group_ | _MerkleProof_,
|
||||
externalNullifier: _BytesLike | Hexable | number | bigint_,
|
||||
signal: _BytesLike | Hexable | number | bigint_,
|
||||
snarkArtifacts?: _SnarkArtifacts_
|
||||
): Promise\<_SemaphoreFullProof_>
|
||||
): Promise\<_SemaphoreProof_>
|
||||
|
||||
```typescript
|
||||
import { Identity } from "@semaphore-protocol/identity"
|
||||
@@ -100,7 +100,7 @@ const fullProof = await generateProof(identity, group, externalNullifier, signal
|
||||
// const fullProof = await generateProof(identity, group, externalNullifier, signal)
|
||||
```
|
||||
|
||||
\# **verifyProof**(fullProof: _FullProof_, treeDepth: _number_): Promise\<_boolean_>
|
||||
\# **verifyProof**(semaphoreProof: _SemaphoreProof_, treeDepth: _number_): Promise\<_boolean_>
|
||||
|
||||
```typescript
|
||||
import { verifyProof } from "@semaphore-protocol/proof"
|
||||
|
||||
@@ -1,12 +1,16 @@
|
||||
{
|
||||
"name": "@semaphore-protocol/proof",
|
||||
"version": "3.11.0",
|
||||
"version": "3.13.0",
|
||||
"description": "A library to generate and verify Semaphore proofs.",
|
||||
"license": "MIT",
|
||||
"main": "dist/index.node.js",
|
||||
"exports": {
|
||||
"import": "./dist/index.mjs",
|
||||
"require": "./dist/index.node.js"
|
||||
"node": {
|
||||
"import": "./dist/index.node.mjs",
|
||||
"require": "./dist/index.node.js"
|
||||
},
|
||||
"browser": "./dist/index.browser.mjs",
|
||||
"default": "./dist/index.browser.mjs"
|
||||
},
|
||||
"types": "dist/types/index.d.ts",
|
||||
"files": [
|
||||
@@ -22,26 +26,30 @@
|
||||
},
|
||||
"scripts": {
|
||||
"build:watch": "rollup -c rollup.config.ts -w --configPlugin typescript",
|
||||
"build": "rimraf dist && rollup -c rollup.config.ts --configPlugin typescript",
|
||||
"prepublishOnly": "yarn build",
|
||||
"docs": "typedoc src/index.ts --out ../../docs/proof"
|
||||
"build": "rimraf dist && yarn build:browser && yarn build:node",
|
||||
"build:browser": "rollup -c rollup.browser.config.ts --configPlugin typescript",
|
||||
"build:node": "rollup -c rollup.node.config.ts --configPlugin typescript",
|
||||
"prepublishOnly": "yarn build"
|
||||
},
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@iden3/binfileutils": "0.0.11",
|
||||
"@rollup/plugin-commonjs": "^24.1.0",
|
||||
"@rollup/plugin-json": "^5.0.1",
|
||||
"@rollup/plugin-node-resolve": "^15.0.2",
|
||||
"ffjavascript": "^0.2.54",
|
||||
"@rollup/plugin-virtual": "^3.0.2",
|
||||
"fastfile": "0.0.20",
|
||||
"poseidon-lite": "^0.2.0",
|
||||
"rimraf": "^5.0.5",
|
||||
"rollup": "^4.0.2",
|
||||
"rollup-plugin-cleanup": "^3.2.1",
|
||||
"rollup-plugin-typescript2": "^0.31.2",
|
||||
"typedoc": "^0.22.11"
|
||||
"rollup-plugin-typescript2": "^0.31.2"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@semaphore-protocol/group": "3.11.0",
|
||||
"@semaphore-protocol/identity": "3.11.0"
|
||||
"@semaphore-protocol/group": "3.13.0",
|
||||
"@semaphore-protocol/identity": "3.13.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"@ethersproject/bignumber": "^5.5.0",
|
||||
@@ -49,6 +57,7 @@
|
||||
"@ethersproject/keccak256": "^5.7.0",
|
||||
"@ethersproject/strings": "^5.5.0",
|
||||
"@zk-kit/incremental-merkle-tree": "0.4.3",
|
||||
"snarkjs": "0.4.16"
|
||||
"circom_runtime": "0.1.24",
|
||||
"ffjavascript": "0.2.60"
|
||||
}
|
||||
}
|
||||
|
||||
58
packages/proof/rollup.browser.config.ts
Normal file
58
packages/proof/rollup.browser.config.ts
Normal file
@@ -0,0 +1,58 @@
|
||||
import commonjs from "@rollup/plugin-commonjs"
|
||||
import json from "@rollup/plugin-json"
|
||||
import { nodeResolve } from "@rollup/plugin-node-resolve"
|
||||
import virtual from "@rollup/plugin-virtual"
|
||||
import * as fs from "fs"
|
||||
import cleanup from "rollup-plugin-cleanup"
|
||||
import typescript from "rollup-plugin-typescript2"
|
||||
|
||||
// Needed by fastfile.
|
||||
import { O_CREAT, O_EXCL, O_RDONLY, O_RDWR, O_TRUNC } from "constants"
|
||||
|
||||
const constants = `
|
||||
export const O_TRUNC = ${O_TRUNC};
|
||||
export const O_CREAT = ${O_CREAT};
|
||||
export const O_RDWR = ${O_RDWR};
|
||||
export const O_EXCL = ${O_EXCL};
|
||||
export const O_RDONLY = ${O_RDONLY}
|
||||
`
|
||||
|
||||
const empty = "export default {}"
|
||||
|
||||
const pkg = JSON.parse(fs.readFileSync("./package.json", "utf-8"))
|
||||
const banner = `/**
|
||||
* @module ${pkg.name}
|
||||
* @version ${pkg.version}
|
||||
* @file ${pkg.description}
|
||||
* @copyright Ethereum Foundation 2022
|
||||
* @license ${pkg.license}
|
||||
* @see [Github]{@link ${pkg.homepage}}
|
||||
*/`
|
||||
|
||||
export default {
|
||||
input: "src/index.ts",
|
||||
output: [
|
||||
{
|
||||
file: pkg.exports.browser,
|
||||
format: "es",
|
||||
banner
|
||||
}
|
||||
],
|
||||
external: Object.keys(pkg.dependencies),
|
||||
plugins: [
|
||||
typescript({
|
||||
tsconfig: "./build.tsconfig.json",
|
||||
useTsconfigDeclarationDir: true
|
||||
}),
|
||||
virtual({
|
||||
fs: empty,
|
||||
constants
|
||||
}),
|
||||
nodeResolve(),
|
||||
commonjs({
|
||||
esmExternals: true
|
||||
}),
|
||||
cleanup({ comments: "jsdoc" }),
|
||||
json()
|
||||
]
|
||||
}
|
||||
@@ -1,9 +1,9 @@
|
||||
import typescript from "rollup-plugin-typescript2"
|
||||
import commonjs from "@rollup/plugin-commonjs"
|
||||
import * as fs from "fs"
|
||||
import cleanup from "rollup-plugin-cleanup"
|
||||
import json from "@rollup/plugin-json"
|
||||
import { nodeResolve } from "@rollup/plugin-node-resolve"
|
||||
import * as fs from "fs"
|
||||
import cleanup from "rollup-plugin-cleanup"
|
||||
import typescript from "rollup-plugin-typescript2"
|
||||
|
||||
const pkg = JSON.parse(fs.readFileSync("./package.json", "utf-8"))
|
||||
const banner = `/**
|
||||
@@ -18,8 +18,17 @@ const banner = `/**
|
||||
export default {
|
||||
input: "src/index.ts",
|
||||
output: [
|
||||
{ file: pkg.exports.require, format: "cjs", banner, exports: "auto" },
|
||||
{ file: pkg.exports.import, format: "es", banner }
|
||||
{
|
||||
file: pkg.exports.node.require,
|
||||
format: "cjs",
|
||||
banner,
|
||||
exports: "auto"
|
||||
},
|
||||
{
|
||||
file: pkg.exports.node.import,
|
||||
format: "es",
|
||||
banner
|
||||
}
|
||||
],
|
||||
external: Object.keys(pkg.dependencies),
|
||||
plugins: [
|
||||
@@ -27,8 +36,10 @@ export default {
|
||||
tsconfig: "./build.tsconfig.json",
|
||||
useTsconfigDeclarationDir: true
|
||||
}),
|
||||
commonjs(),
|
||||
nodeResolve(),
|
||||
commonjs({
|
||||
esmExternals: true
|
||||
}),
|
||||
cleanup({ comments: "jsdoc" }),
|
||||
json()
|
||||
]
|
||||
@@ -1,5 +1,5 @@
|
||||
import { BytesLike, Hexable } from "@ethersproject/bytes"
|
||||
import { poseidon2 } from "poseidon-lite/poseidon2"
|
||||
import { poseidon2 } from "poseidon-lite"
|
||||
import hash from "./hash"
|
||||
|
||||
/**
|
||||
|
||||
@@ -3,10 +3,11 @@ import { BytesLike, Hexable } from "@ethersproject/bytes"
|
||||
import { Group } from "@semaphore-protocol/group"
|
||||
import type { Identity } from "@semaphore-protocol/identity"
|
||||
import { MerkleProof } from "@zk-kit/incremental-merkle-tree"
|
||||
import { groth16 } from "snarkjs"
|
||||
import type { NumericString } from "snarkjs"
|
||||
import hash from "./hash"
|
||||
import packProof from "./packProof"
|
||||
import { FullProof, SnarkArtifacts } from "./types"
|
||||
import { SemaphoreProof, SnarkArtifacts } from "./types"
|
||||
import groth16Prove from "./groth16/prove"
|
||||
|
||||
/**
|
||||
* Generates a Semaphore proof.
|
||||
@@ -23,7 +24,7 @@ export default async function generateProof(
|
||||
externalNullifier: BytesLike | Hexable | number | bigint,
|
||||
signal: BytesLike | Hexable | number | bigint,
|
||||
snarkArtifacts?: SnarkArtifacts
|
||||
): Promise<FullProof> {
|
||||
): Promise<SemaphoreProof> {
|
||||
let merkleProof: MerkleProof
|
||||
|
||||
if ("depth" in groupOrMerkleProof) {
|
||||
@@ -45,7 +46,7 @@ export default async function generateProof(
|
||||
}
|
||||
}
|
||||
|
||||
const { proof, publicSignals } = await groth16.fullProve(
|
||||
const { proof, publicSignals } = await groth16Prove(
|
||||
{
|
||||
identityTrapdoor: trapdoor,
|
||||
identityNullifier: nullifier,
|
||||
@@ -61,8 +62,8 @@ export default async function generateProof(
|
||||
return {
|
||||
merkleTreeRoot: publicSignals[0],
|
||||
nullifierHash: publicSignals[1],
|
||||
signal: BigNumber.from(signal).toString(),
|
||||
externalNullifier: BigNumber.from(externalNullifier).toString(),
|
||||
signal: BigNumber.from(signal).toString() as NumericString,
|
||||
externalNullifier: BigNumber.from(externalNullifier).toString() as NumericString,
|
||||
proof: packProof(proof)
|
||||
}
|
||||
}
|
||||
|
||||
226
packages/proof/src/groth16/prove.ts
Normal file
226
packages/proof/src/groth16/prove.ts
Normal file
@@ -0,0 +1,226 @@
|
||||
/* eslint-disable no-plusplus */
|
||||
/* eslint-disable eqeqeq */
|
||||
/* eslint-disable @typescript-eslint/naming-convention */
|
||||
/* istanbul ignore file */
|
||||
|
||||
// @ts-ignore
|
||||
import * as binFileUtils from "@iden3/binfileutils"
|
||||
import { BigBuffer, Scalar, utils } from "ffjavascript"
|
||||
import { log2 } from "./utils"
|
||||
import * as zkeyUtils from "./zkey-utils"
|
||||
import * as wtnsUtils from "./wtns-utils"
|
||||
import wtnsCalculate from "./wtns-calculate"
|
||||
|
||||
const { stringifyBigInts, unstringifyBigInts } = utils
|
||||
|
||||
async function buildABC1(curve: any, zkey: any, witness: any, coeffs: any) {
|
||||
const { n8 } = curve.Fr
|
||||
const sCoef = 4 * 3 + zkey.n8r
|
||||
const nCoef = (coeffs.byteLength - 4) / sCoef
|
||||
|
||||
const outBuffA = new BigBuffer(zkey.domainSize * n8)
|
||||
const outBuffB = new BigBuffer(zkey.domainSize * n8)
|
||||
const outBuffC = new BigBuffer(zkey.domainSize * n8)
|
||||
|
||||
const outBuf = [outBuffA, outBuffB]
|
||||
for (let i = 0; i < nCoef; i++) {
|
||||
const buffCoef = coeffs.slice(4 + i * sCoef, 4 + i * sCoef + sCoef)
|
||||
const buffCoefV = new DataView(buffCoef.buffer)
|
||||
const m = buffCoefV.getUint32(0, true)
|
||||
const c = buffCoefV.getUint32(4, true)
|
||||
const s = buffCoefV.getUint32(8, true)
|
||||
const coef = buffCoef.slice(12, 12 + n8)
|
||||
outBuf[m].set(
|
||||
curve.Fr.add(outBuf[m].slice(c * n8, c * n8 + n8), curve.Fr.mul(coef, witness.slice(s * n8, s * n8 + n8))),
|
||||
c * n8
|
||||
)
|
||||
}
|
||||
|
||||
for (let i = 0; i < zkey.domainSize; i++) {
|
||||
outBuffC.set(curve.Fr.mul(outBuffA.slice(i * n8, i * n8 + n8), outBuffB.slice(i * n8, i * n8 + n8)), i * n8)
|
||||
}
|
||||
|
||||
return [outBuffA, outBuffB, outBuffC]
|
||||
}
|
||||
|
||||
async function joinABC(curve: any, _zkey: any, a: any, b: any, c: any) {
|
||||
const MAX_CHUNK_SIZE = 1 << 22
|
||||
|
||||
const { n8 } = curve.Fr
|
||||
const nElements = Math.floor(a.byteLength / curve.Fr.n8)
|
||||
|
||||
const promises = []
|
||||
|
||||
for (let i = 0; i < nElements; i += MAX_CHUNK_SIZE) {
|
||||
const n = Math.min(nElements - i, MAX_CHUNK_SIZE)
|
||||
|
||||
const task = []
|
||||
|
||||
const aChunk = a.slice(i * n8, (i + n) * n8)
|
||||
const bChunk = b.slice(i * n8, (i + n) * n8)
|
||||
const cChunk = c.slice(i * n8, (i + n) * n8)
|
||||
|
||||
task.push({ cmd: "ALLOCSET", var: 0, buff: aChunk })
|
||||
task.push({ cmd: "ALLOCSET", var: 1, buff: bChunk })
|
||||
task.push({ cmd: "ALLOCSET", var: 2, buff: cChunk })
|
||||
task.push({ cmd: "ALLOC", var: 3, len: n * n8 })
|
||||
task.push({
|
||||
cmd: "CALL",
|
||||
fnName: "qap_joinABC",
|
||||
params: [{ var: 0 }, { var: 1 }, { var: 2 }, { val: n }, { var: 3 }]
|
||||
})
|
||||
task.push({ cmd: "CALL", fnName: "frm_batchFromMontgomery", params: [{ var: 3 }, { val: n }, { var: 3 }] })
|
||||
task.push({ cmd: "GET", out: 0, var: 3, len: n * n8 })
|
||||
promises.push(curve.tm.queueAction(task))
|
||||
}
|
||||
|
||||
const result = await Promise.all(promises)
|
||||
|
||||
let outBuff
|
||||
if (a instanceof BigBuffer) {
|
||||
// @ts-ignore
|
||||
outBuff = new BigBuffer(a.byteLength)
|
||||
} else {
|
||||
outBuff = new Uint8Array(a.byteLength)
|
||||
}
|
||||
|
||||
let p = 0
|
||||
for (let i = 0; i < result.length; i++) {
|
||||
outBuff.set(result[i][0], p)
|
||||
p += result[i][0].byteLength
|
||||
}
|
||||
|
||||
return outBuff
|
||||
}
|
||||
|
||||
export default async function groth16Prove(_input: any, wasmFile: any, zkeyFileName: any) {
|
||||
const input = unstringifyBigInts(_input)
|
||||
|
||||
const witnessFileName = {
|
||||
type: "mem"
|
||||
}
|
||||
|
||||
await wtnsCalculate(input, wasmFile, witnessFileName)
|
||||
|
||||
const { fd: fdWtns, sections: sectionsWtns } = await binFileUtils.readBinFile(
|
||||
witnessFileName,
|
||||
"wtns",
|
||||
2,
|
||||
1 << 25,
|
||||
1 << 23
|
||||
)
|
||||
|
||||
const wtns = await wtnsUtils.readHeader(fdWtns, sectionsWtns)
|
||||
|
||||
const { fd: fdZKey, sections: sectionsZKey } = await binFileUtils.readBinFile(
|
||||
zkeyFileName,
|
||||
"zkey",
|
||||
2,
|
||||
1 << 25,
|
||||
1 << 23
|
||||
)
|
||||
|
||||
const zkey = await zkeyUtils.readHeader(fdZKey, sectionsZKey, undefined)
|
||||
|
||||
if (zkey.protocol !== "groth16") {
|
||||
throw new Error("zkey file is not groth16")
|
||||
}
|
||||
|
||||
if (!Scalar.eq(zkey.r, wtns.q)) {
|
||||
throw new Error("Curve of the witness does not match the curve of the proving key")
|
||||
}
|
||||
|
||||
if (wtns.nWitness !== zkey.nVars) {
|
||||
throw new Error(`Invalid witness length. Circuit: ${zkey.nVars}, witness: ${wtns.nWitness}`)
|
||||
}
|
||||
|
||||
const { curve } = zkey
|
||||
const { Fr } = curve
|
||||
const { G1 } = curve
|
||||
const { G2 } = curve
|
||||
|
||||
const power = log2(zkey.domainSize)
|
||||
|
||||
const buffWitness = await binFileUtils.readSection(fdWtns, sectionsWtns, 2)
|
||||
const buffCoeffs = await binFileUtils.readSection(fdZKey, sectionsZKey, 4)
|
||||
|
||||
const [buffA_T, buffB_T, buffC_T] = await buildABC1(curve, zkey, buffWitness, buffCoeffs)
|
||||
|
||||
const inc = power == Fr.s ? curve.Fr.shift : curve.Fr.w[power + 1]
|
||||
|
||||
const buffA = await Fr.ifft(buffA_T, "", "", undefined, "IFFT_A")
|
||||
const buffAodd = await Fr.batchApplyKey(buffA, Fr.e(1), inc)
|
||||
const buffAodd_T = await Fr.fft(buffAodd, "", "", undefined, "FFT_A")
|
||||
|
||||
const buffB = await Fr.ifft(buffB_T, "", "", undefined, "IFFT_B")
|
||||
const buffBodd = await Fr.batchApplyKey(buffB, Fr.e(1), inc)
|
||||
const buffBodd_T = await Fr.fft(buffBodd, "", "", undefined, "FFT_B")
|
||||
|
||||
const buffC = await Fr.ifft(buffC_T, "", "", undefined, "IFFT_C")
|
||||
const buffCodd = await Fr.batchApplyKey(buffC, Fr.e(1), inc)
|
||||
const buffCodd_T = await Fr.fft(buffCodd, "", "", undefined, "FFT_C")
|
||||
|
||||
const buffPodd_T = await joinABC(curve, zkey, buffAodd_T, buffBodd_T, buffCodd_T)
|
||||
|
||||
let proof: any = {}
|
||||
|
||||
const buffBasesA = await binFileUtils.readSection(fdZKey, sectionsZKey, 5)
|
||||
proof.pi_a = await curve.G1.multiExpAffine(buffBasesA, buffWitness, undefined, "multiexp A")
|
||||
|
||||
const buffBasesB1 = await binFileUtils.readSection(fdZKey, sectionsZKey, 6)
|
||||
let pib1 = await curve.G1.multiExpAffine(buffBasesB1, buffWitness, undefined, "multiexp B1")
|
||||
|
||||
const buffBasesB2 = await binFileUtils.readSection(fdZKey, sectionsZKey, 7)
|
||||
proof.pi_b = await curve.G2.multiExpAffine(buffBasesB2, buffWitness, undefined, "multiexp B2")
|
||||
|
||||
const buffBasesC = await binFileUtils.readSection(fdZKey, sectionsZKey, 8)
|
||||
proof.pi_c = await curve.G1.multiExpAffine(
|
||||
buffBasesC,
|
||||
buffWitness.slice((zkey.nPublic + 1) * curve.Fr.n8),
|
||||
undefined,
|
||||
"multiexp C"
|
||||
)
|
||||
|
||||
const buffBasesH = await binFileUtils.readSection(fdZKey, sectionsZKey, 9)
|
||||
const resH = await curve.G1.multiExpAffine(buffBasesH, buffPodd_T, undefined, "multiexp H")
|
||||
|
||||
const r = curve.Fr.random()
|
||||
const s = curve.Fr.random()
|
||||
|
||||
proof.pi_a = G1.add(proof.pi_a, zkey.vk_alpha_1)
|
||||
proof.pi_a = G1.add(proof.pi_a, G1.timesFr(zkey.vk_delta_1, r))
|
||||
|
||||
proof.pi_b = G2.add(proof.pi_b, zkey.vk_beta_2)
|
||||
proof.pi_b = G2.add(proof.pi_b, G2.timesFr(zkey.vk_delta_2, s))
|
||||
|
||||
pib1 = G1.add(pib1, zkey.vk_beta_1)
|
||||
pib1 = G1.add(pib1, G1.timesFr(zkey.vk_delta_1, s))
|
||||
|
||||
proof.pi_c = G1.add(proof.pi_c, resH)
|
||||
|
||||
proof.pi_c = G1.add(proof.pi_c, G1.timesFr(proof.pi_a, s))
|
||||
proof.pi_c = G1.add(proof.pi_c, G1.timesFr(pib1, r))
|
||||
proof.pi_c = G1.add(proof.pi_c, G1.timesFr(zkey.vk_delta_1, Fr.neg(Fr.mul(r, s))))
|
||||
|
||||
let publicSignals = []
|
||||
|
||||
for (let i = 1; i <= zkey.nPublic; i++) {
|
||||
const b = buffWitness.slice(i * Fr.n8, i * Fr.n8 + Fr.n8)
|
||||
publicSignals.push(Scalar.fromRprLE(b, undefined, undefined))
|
||||
}
|
||||
|
||||
proof.pi_a = G1.toObject(G1.toAffine(proof.pi_a))
|
||||
proof.pi_b = G2.toObject(G2.toAffine(proof.pi_b))
|
||||
proof.pi_c = G1.toObject(G1.toAffine(proof.pi_c))
|
||||
|
||||
proof.protocol = "groth16"
|
||||
proof.curve = curve.name
|
||||
|
||||
await fdZKey.close()
|
||||
await fdWtns.close()
|
||||
|
||||
proof = stringifyBigInts(proof)
|
||||
publicSignals = stringifyBigInts(publicSignals)
|
||||
|
||||
return { proof, publicSignals }
|
||||
}
|
||||
14
packages/proof/src/groth16/utils.ts
Normal file
14
packages/proof/src/groth16/utils.ts
Normal file
@@ -0,0 +1,14 @@
|
||||
/* eslint-disable import/prefer-default-export */
|
||||
/* eslint-disable no-return-assign */
|
||||
/* istanbul ignore file */
|
||||
|
||||
export function log2(V: any) {
|
||||
return (
|
||||
((V & 0xffff0000) !== 0 ? ((V &= 0xffff0000), 16) : 0) |
|
||||
((V & 0xff00ff00) !== 0 ? ((V &= 0xff00ff00), 8) : 0) |
|
||||
((V & 0xf0f0f0f0) !== 0 ? ((V &= 0xf0f0f0f0), 4) : 0) |
|
||||
((V & 0xcccccccc) !== 0 ? ((V &= 0xcccccccc), 2) : 0) |
|
||||
// @ts-ignore
|
||||
((V & 0xaaaaaaaa) !== 0)
|
||||
)
|
||||
}
|
||||
73
packages/proof/src/groth16/verify.ts
Normal file
73
packages/proof/src/groth16/verify.ts
Normal file
@@ -0,0 +1,73 @@
|
||||
/* eslint-disable no-plusplus */
|
||||
/* eslint-disable @typescript-eslint/naming-convention */
|
||||
/* istanbul ignore file */
|
||||
|
||||
import { Scalar, utils, buildBn128 } from "ffjavascript"
|
||||
|
||||
const { unstringifyBigInts } = utils
|
||||
|
||||
function isWellConstructed(curve: any, proof: any) {
|
||||
const { G1 } = curve
|
||||
const { G2 } = curve
|
||||
|
||||
return G1.isValid(proof.pi_a) && G2.isValid(proof.pi_b) && G1.isValid(proof.pi_c)
|
||||
}
|
||||
|
||||
function publicInputsAreValid(curve: any, publicInputs: any) {
|
||||
for (let i = 0; i < publicInputs.length; i++) {
|
||||
if (!Scalar.lt(publicInputs[i], curve.r)) {
|
||||
return false
|
||||
}
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
export default async function groth16Verify(_vk_verifier: any, _publicSignals: any, _proof: any) {
|
||||
const vk_verifier = unstringifyBigInts(_vk_verifier)
|
||||
const proof = unstringifyBigInts(_proof)
|
||||
const publicSignals = unstringifyBigInts(_publicSignals)
|
||||
|
||||
const curve = await buildBn128(undefined, undefined)
|
||||
|
||||
const IC0 = curve.G1.fromObject(vk_verifier.IC[0])
|
||||
const IC = new Uint8Array(curve.G1.F.n8 * 2 * publicSignals.length)
|
||||
const w = new Uint8Array(curve.Fr.n8 * publicSignals.length)
|
||||
|
||||
if (!publicInputsAreValid(curve, publicSignals)) {
|
||||
return false
|
||||
}
|
||||
|
||||
for (let i = 0; i < publicSignals.length; i++) {
|
||||
const buffP = curve.G1.fromObject(vk_verifier.IC[i + 1])
|
||||
IC.set(buffP, i * curve.G1.F.n8 * 2)
|
||||
Scalar.toRprLE(w, curve.Fr.n8 * i, publicSignals[i], curve.Fr.n8)
|
||||
}
|
||||
|
||||
let cpub = await curve.G1.multiExpAffine(IC, w)
|
||||
cpub = curve.G1.add(cpub, IC0)
|
||||
|
||||
const pi_a = curve.G1.fromObject(proof.pi_a)
|
||||
const pi_b = curve.G2.fromObject(proof.pi_b)
|
||||
const pi_c = curve.G1.fromObject(proof.pi_c)
|
||||
|
||||
if (!isWellConstructed(curve, { pi_a, pi_b, pi_c })) {
|
||||
return false
|
||||
}
|
||||
|
||||
const vk_gamma_2 = curve.G2.fromObject(vk_verifier.vk_gamma_2)
|
||||
const vk_delta_2 = curve.G2.fromObject(vk_verifier.vk_delta_2)
|
||||
const vk_alpha_1 = curve.G1.fromObject(vk_verifier.vk_alpha_1)
|
||||
const vk_beta_2 = curve.G2.fromObject(vk_verifier.vk_beta_2)
|
||||
|
||||
return curve.pairingEq(
|
||||
curve.G1.neg(pi_a),
|
||||
pi_b,
|
||||
cpub,
|
||||
vk_gamma_2,
|
||||
pi_c,
|
||||
vk_delta_2,
|
||||
|
||||
vk_alpha_1,
|
||||
vk_beta_2
|
||||
)
|
||||
}
|
||||
39
packages/proof/src/groth16/wtns-calculate.ts
Normal file
39
packages/proof/src/groth16/wtns-calculate.ts
Normal file
@@ -0,0 +1,39 @@
|
||||
/* eslint-disable eqeqeq */
|
||||
/* istanbul ignore file */
|
||||
|
||||
// @ts-ignore
|
||||
import * as binFileUtils from "@iden3/binfileutils"
|
||||
// @ts-ignore
|
||||
import { WitnessCalculatorBuilder } from "circom_runtime"
|
||||
// @ts-ignore
|
||||
import * as fastFile from "fastfile"
|
||||
import { utils } from "ffjavascript"
|
||||
import * as wtnsUtils from "./wtns-utils"
|
||||
|
||||
const { unstringifyBigInts } = utils
|
||||
|
||||
export default async function wtnsCalculate(_input: any, wasmFileName: any, wtnsFileName: any) {
|
||||
const input = unstringifyBigInts(_input)
|
||||
|
||||
const fdWasm = await fastFile.readExisting(wasmFileName)
|
||||
const wasm = await fdWasm.read(fdWasm.totalSize)
|
||||
await fdWasm.close()
|
||||
|
||||
const wc = await WitnessCalculatorBuilder(wasm)
|
||||
|
||||
if (wc.circom_version() == 1) {
|
||||
const w = await wc.calculateBinWitness(input)
|
||||
|
||||
const fdWtns = await binFileUtils.createBinFile(wtnsFileName, "wtns", 2, 2)
|
||||
|
||||
await wtnsUtils.writeBin(fdWtns, w, wc.prime)
|
||||
await fdWtns.close()
|
||||
} else {
|
||||
const fdWtns = await fastFile.createOverride(wtnsFileName)
|
||||
|
||||
const w = await wc.calculateWTNSBin(input)
|
||||
|
||||
await fdWtns.write(w)
|
||||
await fdWtns.close()
|
||||
}
|
||||
}
|
||||
32
packages/proof/src/groth16/wtns-utils.ts
Normal file
32
packages/proof/src/groth16/wtns-utils.ts
Normal file
@@ -0,0 +1,32 @@
|
||||
/* eslint-disable eqeqeq */
|
||||
/* istanbul ignore file */
|
||||
|
||||
// @ts-ignore
|
||||
import * as binFileUtils from "@iden3/binfileutils"
|
||||
import { Scalar } from "ffjavascript"
|
||||
|
||||
export async function writeBin(fd: any, witnessBin: any, prime: any) {
|
||||
await binFileUtils.startWriteSection(fd, 1)
|
||||
const n8 = (Math.floor((Scalar.bitLength(prime) - 1) / 64) + 1) * 8
|
||||
await fd.writeULE32(n8)
|
||||
await binFileUtils.writeBigInt(fd, prime, n8)
|
||||
if (witnessBin.byteLength % n8 != 0) {
|
||||
throw new Error("Invalid witness length")
|
||||
}
|
||||
await fd.writeULE32(witnessBin.byteLength / n8)
|
||||
await binFileUtils.endWriteSection(fd)
|
||||
|
||||
await binFileUtils.startWriteSection(fd, 2)
|
||||
await fd.write(witnessBin)
|
||||
await binFileUtils.endWriteSection(fd)
|
||||
}
|
||||
|
||||
export async function readHeader(fd: any, sections: any) {
|
||||
await binFileUtils.startReadUniqueSection(fd, sections, 1)
|
||||
const n8 = await fd.readULE32()
|
||||
const q = await binFileUtils.readBigInt(fd, n8)
|
||||
const nWitness = await fd.readULE32()
|
||||
await binFileUtils.endReadSection(fd)
|
||||
|
||||
return { n8, q, nWitness }
|
||||
}
|
||||
60
packages/proof/src/groth16/zkey-utils.ts
Normal file
60
packages/proof/src/groth16/zkey-utils.ts
Normal file
@@ -0,0 +1,60 @@
|
||||
/* eslint-disable import/prefer-default-export */
|
||||
/* istanbul ignore file */
|
||||
|
||||
// @ts-ignore
|
||||
import * as binFileUtils from "@iden3/binfileutils"
|
||||
import { buildBn128 } from "ffjavascript"
|
||||
import { log2 } from "./utils"
|
||||
|
||||
async function readG1(fd: any, curve: any, toObject: any) {
|
||||
const buff = await fd.read(curve.G1.F.n8 * 2)
|
||||
const res = curve.G1.fromRprLEM(buff, 0)
|
||||
return toObject ? curve.G1.toObject(res) : res
|
||||
}
|
||||
|
||||
async function readG2(fd: any, curve: any, toObject: any) {
|
||||
const buff = await fd.read(curve.G2.F.n8 * 2)
|
||||
const res = curve.G2.fromRprLEM(buff, 0)
|
||||
return toObject ? curve.G2.toObject(res) : res
|
||||
}
|
||||
|
||||
async function readHeaderGroth16(fd: any, sections: any, toObject: any) {
|
||||
const zkey: any = {}
|
||||
|
||||
zkey.protocol = "groth16"
|
||||
|
||||
await binFileUtils.startReadUniqueSection(fd, sections, 2)
|
||||
const n8q = await fd.readULE32()
|
||||
zkey.n8q = n8q
|
||||
zkey.q = await binFileUtils.readBigInt(fd, n8q)
|
||||
|
||||
const n8r = await fd.readULE32()
|
||||
zkey.n8r = n8r
|
||||
zkey.r = await binFileUtils.readBigInt(fd, n8r)
|
||||
zkey.curve = await buildBn128(undefined, undefined)
|
||||
zkey.nVars = await fd.readULE32()
|
||||
zkey.nPublic = await fd.readULE32()
|
||||
zkey.domainSize = await fd.readULE32()
|
||||
zkey.power = log2(zkey.domainSize)
|
||||
zkey.vk_alpha_1 = await readG1(fd, zkey.curve, toObject)
|
||||
zkey.vk_beta_1 = await readG1(fd, zkey.curve, toObject)
|
||||
zkey.vk_beta_2 = await readG2(fd, zkey.curve, toObject)
|
||||
zkey.vk_gamma_2 = await readG2(fd, zkey.curve, toObject)
|
||||
zkey.vk_delta_1 = await readG1(fd, zkey.curve, toObject)
|
||||
zkey.vk_delta_2 = await readG2(fd, zkey.curve, toObject)
|
||||
await binFileUtils.endReadSection(fd)
|
||||
|
||||
return zkey
|
||||
}
|
||||
|
||||
export async function readHeader(fd: any, sections: any, toObject: any) {
|
||||
await binFileUtils.startReadUniqueSection(fd, sections, 1)
|
||||
const protocolId = await fd.readULE32()
|
||||
await binFileUtils.endReadSection(fd)
|
||||
|
||||
if (protocolId === 1) {
|
||||
return readHeaderGroth16(fd, sections, toObject)
|
||||
}
|
||||
|
||||
throw new Error("Protocol not supported: ")
|
||||
}
|
||||
@@ -1,15 +1,16 @@
|
||||
import { BigNumber } from "@ethersproject/bignumber"
|
||||
import { BytesLike, Hexable, zeroPad } from "@ethersproject/bytes"
|
||||
import { keccak256 } from "@ethersproject/keccak256"
|
||||
import { NumericString } from "snarkjs"
|
||||
|
||||
/**
|
||||
* Creates a keccak256 hash of a message compatible with the SNARK scalar modulus.
|
||||
* @param message The message to be hashed.
|
||||
* @returns The message digest.
|
||||
*/
|
||||
export default function hash(message: BytesLike | Hexable | number | bigint): bigint {
|
||||
export default function hash(message: BytesLike | Hexable | number | bigint): NumericString {
|
||||
message = BigNumber.from(message).toTwos(256).toHexString()
|
||||
message = zeroPad(message, 32)
|
||||
|
||||
return BigInt(keccak256(message)) >> BigInt(8)
|
||||
return (BigInt(keccak256(message)) >> BigInt(8)).toString() as NumericString
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@ import calculateNullifierHash from "./calculateNullifierHash"
|
||||
import generateProof from "./generateProof"
|
||||
import hash from "./hash"
|
||||
import packProof from "./packProof"
|
||||
import { FullProof } from "./types"
|
||||
import { SemaphoreProof } from "./types"
|
||||
import unpackProof from "./unpackProof"
|
||||
import verifyProof from "./verifyProof"
|
||||
|
||||
@@ -21,7 +21,7 @@ describe("Proof", () => {
|
||||
|
||||
const identity = new Identity()
|
||||
|
||||
let fullProof: FullProof
|
||||
let fullProof: SemaphoreProof
|
||||
let curve: any
|
||||
|
||||
beforeAll(async () => {
|
||||
@@ -34,9 +34,7 @@ describe("Proof", () => {
|
||||
|
||||
describe("# generateProof", () => {
|
||||
it("Should not generate Semaphore proofs if the identity is not part of the group", async () => {
|
||||
const group = new Group(treeDepth)
|
||||
|
||||
group.addMembers([BigInt(1), BigInt(2)])
|
||||
const group = new Group(treeDepth, 20, [BigInt(1), BigInt(2)])
|
||||
|
||||
const fun = () =>
|
||||
generateProof(identity, group, externalNullifier, signal, {
|
||||
@@ -48,9 +46,7 @@ describe("Proof", () => {
|
||||
})
|
||||
|
||||
it("Should not generate a Semaphore proof with default snark artifacts with Node.js", async () => {
|
||||
const group = new Group(treeDepth)
|
||||
|
||||
group.addMembers([BigInt(1), BigInt(2), identity.commitment])
|
||||
const group = new Group(treeDepth, 20, [BigInt(1), BigInt(2), identity.commitment])
|
||||
|
||||
const fun = () => generateProof(identity, group, externalNullifier, signal)
|
||||
|
||||
@@ -58,9 +54,7 @@ describe("Proof", () => {
|
||||
})
|
||||
|
||||
it("Should generate a Semaphore proof passing a group as parameter", async () => {
|
||||
const group = new Group(treeDepth)
|
||||
|
||||
group.addMembers([BigInt(1), BigInt(2), identity.commitment])
|
||||
const group = new Group(treeDepth, 20, [BigInt(1), BigInt(2), identity.commitment])
|
||||
|
||||
fullProof = await generateProof(identity, group, externalNullifier, signal, {
|
||||
wasmFilePath,
|
||||
@@ -72,9 +66,7 @@ describe("Proof", () => {
|
||||
}, 20000)
|
||||
|
||||
it("Should generate a Semaphore proof passing a Merkle proof as parameter", async () => {
|
||||
const group = new Group(treeDepth)
|
||||
|
||||
group.addMembers([BigInt(1), BigInt(2), identity.commitment])
|
||||
const group = new Group(treeDepth, 20, [BigInt(1), BigInt(2), identity.commitment])
|
||||
|
||||
fullProof = await generateProof(identity, group.generateMerkleProof(2), externalNullifier, signal, {
|
||||
wasmFilePath,
|
||||
@@ -104,47 +96,35 @@ describe("Proof", () => {
|
||||
it("Should hash the signal value correctly", async () => {
|
||||
const signalHash = hash(signal)
|
||||
|
||||
expect(signalHash.toString()).toBe(
|
||||
"8665846418922331996225934941481656421248110469944536651334918563951783029"
|
||||
)
|
||||
expect(signalHash).toBe("8665846418922331996225934941481656421248110469944536651334918563951783029")
|
||||
})
|
||||
|
||||
it("Should hash the external nullifier value correctly", async () => {
|
||||
const externalNullifierHash = hash(externalNullifier)
|
||||
|
||||
expect(externalNullifierHash.toString()).toBe(
|
||||
expect(externalNullifierHash).toBe(
|
||||
"244178201824278269437519042830883072613014992408751798420801126401127326826"
|
||||
)
|
||||
})
|
||||
|
||||
it("Should hash a number", async () => {
|
||||
expect(hash(2).toString()).toBe(
|
||||
"113682330006535319932160121224458771213356533826860247409332700812532759386"
|
||||
)
|
||||
expect(hash(2)).toBe("113682330006535319932160121224458771213356533826860247409332700812532759386")
|
||||
})
|
||||
|
||||
it("Should hash a big number", async () => {
|
||||
expect(hash(BigInt(2)).toString()).toBe(
|
||||
"113682330006535319932160121224458771213356533826860247409332700812532759386"
|
||||
)
|
||||
expect(hash(BigInt(2))).toBe("113682330006535319932160121224458771213356533826860247409332700812532759386")
|
||||
})
|
||||
|
||||
it("Should hash an hex number", async () => {
|
||||
expect(hash("0x2").toString()).toBe(
|
||||
"113682330006535319932160121224458771213356533826860247409332700812532759386"
|
||||
)
|
||||
expect(hash("0x2")).toBe("113682330006535319932160121224458771213356533826860247409332700812532759386")
|
||||
})
|
||||
|
||||
it("Should hash an string number", async () => {
|
||||
expect(hash("2").toString()).toBe(
|
||||
"113682330006535319932160121224458771213356533826860247409332700812532759386"
|
||||
)
|
||||
expect(hash("2")).toBe("113682330006535319932160121224458771213356533826860247409332700812532759386")
|
||||
})
|
||||
|
||||
it("Should hash an array", async () => {
|
||||
expect(hash([2]).toString()).toBe(
|
||||
"113682330006535319932160121224458771213356533826860247409332700812532759386"
|
||||
)
|
||||
expect(hash([2])).toBe("113682330006535319932160121224458771213356533826860247409332700812532759386")
|
||||
})
|
||||
})
|
||||
|
||||
|
||||
@@ -1,19 +1,20 @@
|
||||
import { SnarkJSProof, Proof } from "./types"
|
||||
import { Groth16Proof } from "snarkjs"
|
||||
import { PackedProof } from "./types"
|
||||
|
||||
/**
|
||||
* Packs a proof into a format compatible with Semaphore.
|
||||
* @param originalProof The proof generated with SnarkJS.
|
||||
* @param proof The Groth16 proof generated with SnarkJS.
|
||||
* @returns The proof compatible with Semaphore.
|
||||
*/
|
||||
export default function packProof(originalProof: SnarkJSProof): Proof {
|
||||
export default function packProof(proof: Groth16Proof): PackedProof {
|
||||
return [
|
||||
originalProof.pi_a[0],
|
||||
originalProof.pi_a[1],
|
||||
originalProof.pi_b[0][1],
|
||||
originalProof.pi_b[0][0],
|
||||
originalProof.pi_b[1][1],
|
||||
originalProof.pi_b[1][0],
|
||||
originalProof.pi_c[0],
|
||||
originalProof.pi_c[1]
|
||||
proof.pi_a[0],
|
||||
proof.pi_a[1],
|
||||
proof.pi_b[0][1],
|
||||
proof.pi_b[0][0],
|
||||
proof.pi_b[1][1],
|
||||
proof.pi_b[1][0],
|
||||
proof.pi_c[0],
|
||||
proof.pi_c[1]
|
||||
]
|
||||
}
|
||||
|
||||
@@ -1,33 +1,25 @@
|
||||
export type BigNumberish = string | bigint
|
||||
import type { NumericString } from "snarkjs"
|
||||
|
||||
export type SnarkArtifacts = {
|
||||
wasmFilePath: string
|
||||
zkeyFilePath: string
|
||||
}
|
||||
|
||||
export type SnarkJSProof = {
|
||||
pi_a: BigNumberish[]
|
||||
pi_b: BigNumberish[][]
|
||||
pi_c: BigNumberish[]
|
||||
protocol: string
|
||||
curve: string
|
||||
export type SemaphoreProof = {
|
||||
merkleTreeRoot: NumericString
|
||||
signal: NumericString
|
||||
nullifierHash: NumericString
|
||||
externalNullifier: NumericString
|
||||
proof: PackedProof
|
||||
}
|
||||
|
||||
export type FullProof = {
|
||||
merkleTreeRoot: BigNumberish
|
||||
signal: BigNumberish
|
||||
nullifierHash: BigNumberish
|
||||
externalNullifier: BigNumberish
|
||||
proof: Proof
|
||||
}
|
||||
|
||||
export type Proof = [
|
||||
BigNumberish,
|
||||
BigNumberish,
|
||||
BigNumberish,
|
||||
BigNumberish,
|
||||
BigNumberish,
|
||||
BigNumberish,
|
||||
BigNumberish,
|
||||
BigNumberish
|
||||
export type PackedProof = [
|
||||
NumericString,
|
||||
NumericString,
|
||||
NumericString,
|
||||
NumericString,
|
||||
NumericString,
|
||||
NumericString,
|
||||
NumericString,
|
||||
NumericString
|
||||
]
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
import { SnarkJSProof, Proof } from "./types"
|
||||
import { Groth16Proof } from "snarkjs"
|
||||
import { PackedProof } from "./types"
|
||||
|
||||
/**
|
||||
* Unpacks a proof into its original form.
|
||||
* @param proof The proof compatible with Semaphore.
|
||||
* @returns The proof compatible with SnarkJS.
|
||||
*/
|
||||
export default function unpackProof(proof: Proof): SnarkJSProof {
|
||||
export default function unpackProof(proof: PackedProof): Groth16Proof {
|
||||
return {
|
||||
pi_a: [proof[0], proof[1]],
|
||||
pi_b: [
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { groth16 } from "snarkjs"
|
||||
import hash from "./hash"
|
||||
import { FullProof } from "./types"
|
||||
import { SemaphoreProof } from "./types"
|
||||
import unpackProof from "./unpackProof"
|
||||
import verificationKeys from "./verificationKeys.json"
|
||||
import groth16Verify from "./groth16/verify"
|
||||
|
||||
/**
|
||||
* Verifies a Semaphore proof.
|
||||
@@ -11,7 +11,7 @@ import verificationKeys from "./verificationKeys.json"
|
||||
* @returns True if the proof is valid, false otherwise.
|
||||
*/
|
||||
export default function verifyProof(
|
||||
{ merkleTreeRoot, nullifierHash, externalNullifier, signal, proof }: FullProof,
|
||||
{ merkleTreeRoot, nullifierHash, externalNullifier, signal, proof }: SemaphoreProof,
|
||||
treeDepth: number
|
||||
): Promise<boolean> {
|
||||
if (treeDepth < 16 || treeDepth > 32) {
|
||||
@@ -24,7 +24,7 @@ export default function verifyProof(
|
||||
IC: verificationKeys.IC[treeDepth - 16]
|
||||
}
|
||||
|
||||
return groth16.verify(
|
||||
return groth16Verify(
|
||||
verificationKey,
|
||||
[merkleTreeRoot, nullifierHash, hash(signal), hash(externalNullifier)],
|
||||
unpackProof(proof)
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
{
|
||||
"extends": "../../tsconfig.json",
|
||||
"compilerOptions": {
|
||||
"allowJs": true
|
||||
},
|
||||
"include": ["src", "rollup.config.ts"]
|
||||
}
|
||||
|
||||
3
packages/proof/typedoc.json
Normal file
3
packages/proof/typedoc.json
Normal file
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"entryPoints": ["src/index.ts"]
|
||||
}
|
||||
@@ -4,9 +4,9 @@
|
||||
"tagline": "Semaphore explorer for on-chain groups.",
|
||||
"icon": "",
|
||||
"links": {
|
||||
"website": "https://community.semaphore.appliedzkp.org/semaphore-explorer",
|
||||
"website": "https://community.semaphore.pse.dev/semaphore-explorer",
|
||||
"github": "https://github.com/semaphore-protocol/explorer",
|
||||
"discord": "https://semaphore.appliedzkp.org/discord"
|
||||
"discord": "https://semaphore.pse.dev/discord"
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -16,7 +16,7 @@
|
||||
"links": {
|
||||
"website": "https://discord.com/api/oauth2/authorize?client_id=1082429985496772628&permissions=1024&scope=bot",
|
||||
"github": "https://github.com/semaphore-protocol/discord-bot",
|
||||
"discord": "https://semaphore.appliedzkp.org/discord"
|
||||
"discord": "https://semaphore.pse.dev/discord"
|
||||
}
|
||||
},
|
||||
{
|
||||
|
||||
6
typedoc.json
Normal file
6
typedoc.json
Normal file
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"entryPoints": ["packages/*"],
|
||||
"name": "Semaphore SDK",
|
||||
"entryPointStrategy": "packages",
|
||||
"exclude": ["**/cli-template*", "**/circuits", "**/contracts", "**/hardhat", "**/cli"]
|
||||
}
|
||||
895
types/circomlibjs/index.d.ts
vendored
895
types/circomlibjs/index.d.ts
vendored
@@ -1,895 +0,0 @@
|
||||
/** Declaration file generated by dts-gen */
|
||||
|
||||
declare module "circomlibjs" {
|
||||
export class evmasm {
|
||||
constructor(...args: any[])
|
||||
|
||||
add(...args: any[]): void
|
||||
|
||||
addmod(...args: any[]): void
|
||||
|
||||
address(...args: any[]): void
|
||||
|
||||
and(...args: any[]): void
|
||||
|
||||
balance(...args: any[]): void
|
||||
|
||||
blockhash(...args: any[]): void
|
||||
|
||||
byte(...args: any[]): void
|
||||
|
||||
call(...args: any[]): void
|
||||
|
||||
callcode(...args: any[]): void
|
||||
|
||||
calldatacopy(...args: any[]): void
|
||||
|
||||
calldataload(...args: any[]): void
|
||||
|
||||
calldatasize(...args: any[]): void
|
||||
|
||||
caller(...args: any[]): void
|
||||
|
||||
callvalue(...args: any[]): void
|
||||
|
||||
codecopy(...args: any[]): void
|
||||
|
||||
codesize(...args: any[]): void
|
||||
|
||||
coinbase(...args: any[]): void
|
||||
|
||||
create(...args: any[]): void
|
||||
|
||||
createTxData(...args: any[]): void
|
||||
|
||||
delegatecall(...args: any[]): void
|
||||
|
||||
difficulty(...args: any[]): void
|
||||
|
||||
div(...args: any[]): void
|
||||
|
||||
dup(...args: any[]): void
|
||||
|
||||
eq(...args: any[]): void
|
||||
|
||||
exp(...args: any[]): void
|
||||
|
||||
extcodecopy(...args: any[]): void
|
||||
|
||||
extcodesize(...args: any[]): void
|
||||
|
||||
gas(...args: any[]): void
|
||||
|
||||
gaslimit(...args: any[]): void
|
||||
|
||||
gasprice(...args: any[]): void
|
||||
|
||||
gt(...args: any[]): void
|
||||
|
||||
invalid(...args: any[]): void
|
||||
|
||||
iszero(...args: any[]): void
|
||||
|
||||
jmp(...args: any[]): void
|
||||
|
||||
jmpi(...args: any[]): void
|
||||
|
||||
keccak(...args: any[]): void
|
||||
|
||||
label(...args: any[]): void
|
||||
|
||||
log0(...args: any[]): void
|
||||
|
||||
log1(...args: any[]): void
|
||||
|
||||
log2(...args: any[]): void
|
||||
|
||||
log3(...args: any[]): void
|
||||
|
||||
log4(...args: any[]): void
|
||||
|
||||
lt(...args: any[]): void
|
||||
|
||||
mload(...args: any[]): void
|
||||
|
||||
mod(...args: any[]): void
|
||||
|
||||
msize(...args: any[]): void
|
||||
|
||||
mstore(...args: any[]): void
|
||||
|
||||
mstore8(...args: any[]): void
|
||||
|
||||
mul(...args: any[]): void
|
||||
|
||||
mulmod(...args: any[]): void
|
||||
|
||||
not(...args: any[]): void
|
||||
|
||||
number(...args: any[]): void
|
||||
|
||||
or(...args: any[]): void
|
||||
|
||||
origin(...args: any[]): void
|
||||
|
||||
pc(...args: any[]): void
|
||||
|
||||
pop(...args: any[]): void
|
||||
|
||||
push(...args: any[]): void
|
||||
|
||||
return(...args: any[]): void
|
||||
|
||||
returndatacopy(...args: any[]): void
|
||||
|
||||
returndatasize(...args: any[]): void
|
||||
|
||||
revert(...args: any[]): void
|
||||
|
||||
sdiv(...args: any[]): void
|
||||
|
||||
selfdestruct(...args: any[]): void
|
||||
|
||||
sgt(...args: any[]): void
|
||||
|
||||
sha3(...args: any[]): void
|
||||
|
||||
shor(...args: any[]): void
|
||||
|
||||
signextend(...args: any[]): void
|
||||
|
||||
sload(...args: any[]): void
|
||||
|
||||
slt(...args: any[]): void
|
||||
|
||||
smod(...args: any[]): void
|
||||
|
||||
sstore(...args: any[]): void
|
||||
|
||||
staticcall(...args: any[]): void
|
||||
|
||||
stop(...args: any[]): void
|
||||
|
||||
sub(...args: any[]): void
|
||||
|
||||
swap(...args: any[]): void
|
||||
|
||||
timestamp(...args: any[]): void
|
||||
}
|
||||
|
||||
export class smt_memdb {
|
||||
constructor(...args: any[])
|
||||
|
||||
get(...args: any[]): void
|
||||
|
||||
getRoot(...args: any[]): void
|
||||
|
||||
multiDel(...args: any[]): void
|
||||
|
||||
multiGet(...args: any[]): void
|
||||
|
||||
multiIns(...args: any[]): void
|
||||
|
||||
setRoot(...args: any[]): void
|
||||
}
|
||||
|
||||
export function poseidon(inputs: any): any
|
||||
|
||||
export function poseidon_slow(inputs: any): any
|
||||
|
||||
export namespace babyjub {
|
||||
const A: any
|
||||
|
||||
const Base8: any[]
|
||||
|
||||
const D: any
|
||||
|
||||
const Generator: any[]
|
||||
|
||||
const order: any
|
||||
|
||||
const p: any
|
||||
|
||||
const subOrder: any
|
||||
|
||||
function addPoint(a: any, b: any): any
|
||||
|
||||
function inCurve(P: any): any
|
||||
|
||||
function inSubgroup(P: any): any
|
||||
|
||||
function mulPointEscalar(base: any, e: any): any
|
||||
|
||||
function packPoint(P: any): any
|
||||
|
||||
function unpackPoint(_buff: any): any
|
||||
|
||||
namespace F {
|
||||
const R: any
|
||||
|
||||
const Ri: any
|
||||
|
||||
const bitLength: number
|
||||
|
||||
const half: any
|
||||
|
||||
const m: number
|
||||
|
||||
const mask: any
|
||||
|
||||
const n32: number
|
||||
|
||||
const n64: number
|
||||
|
||||
const n8: number
|
||||
|
||||
const negone: any
|
||||
|
||||
const nqr: any
|
||||
|
||||
const nqr_to_t: any
|
||||
|
||||
const one: any
|
||||
|
||||
const p: any
|
||||
|
||||
const s: number
|
||||
|
||||
const sqrt_q: any
|
||||
|
||||
const sqrt_s: number
|
||||
|
||||
const sqrt_t: any
|
||||
|
||||
const sqrt_tm1d2: any
|
||||
|
||||
const sqrt_z: any
|
||||
|
||||
const t: any
|
||||
|
||||
const two: any
|
||||
|
||||
const type: string
|
||||
|
||||
const zero: any
|
||||
|
||||
function add(...args: any[]): void
|
||||
|
||||
function band(...args: any[]): void
|
||||
|
||||
function bnot(...args: any[]): void
|
||||
|
||||
function bor(...args: any[]): void
|
||||
|
||||
function bxor(...args: any[]): void
|
||||
|
||||
function div(...args: any[]): void
|
||||
|
||||
function e(...args: any[]): void
|
||||
|
||||
function eq(...args: any[]): void
|
||||
|
||||
function exp(...args: any[]): void
|
||||
|
||||
function fromRng(...args: any[]): void
|
||||
|
||||
function fromRprBE(...args: any[]): void
|
||||
|
||||
function fromRprBEM(...args: any[]): void
|
||||
|
||||
function fromRprLE(...args: any[]): void
|
||||
|
||||
function fromRprLEM(...args: any[]): void
|
||||
|
||||
function geq(...args: any[]): void
|
||||
|
||||
function gt(...args: any[]): void
|
||||
|
||||
function idiv(...args: any[]): void
|
||||
|
||||
function inv(...args: any[]): void
|
||||
|
||||
function isZero(...args: any[]): void
|
||||
|
||||
function land(...args: any[]): void
|
||||
|
||||
function leq(...args: any[]): void
|
||||
|
||||
function lnot(...args: any[]): void
|
||||
|
||||
function lor(...args: any[]): void
|
||||
|
||||
function lt(...args: any[]): void
|
||||
|
||||
function mod(...args: any[]): void
|
||||
|
||||
function mul(...args: any[]): void
|
||||
|
||||
function mulScalar(...args: any[]): void
|
||||
|
||||
function neg(...args: any[]): void
|
||||
|
||||
function neq(...args: any[]): void
|
||||
|
||||
function normalize(...args: any[]): void
|
||||
|
||||
function pow(...args: any[]): void
|
||||
|
||||
function random(...args: any[]): void
|
||||
|
||||
function shl(...args: any[]): void
|
||||
|
||||
function shr(...args: any[]): void
|
||||
|
||||
function sqrt(a: any): any
|
||||
|
||||
function sqrt_old(...args: any[]): void
|
||||
|
||||
function square(...args: any[]): void
|
||||
|
||||
function sub(...args: any[]): void
|
||||
|
||||
function toRprBE(...args: any[]): void
|
||||
|
||||
function toRprBEM(...args: any[]): void
|
||||
|
||||
function toRprLE(...args: any[]): void
|
||||
|
||||
function toRprLEM(...args: any[]): void
|
||||
|
||||
function toString(...args: any[]): void
|
||||
}
|
||||
}
|
||||
|
||||
export namespace eddsa {
|
||||
function packSignature(sig: any): any
|
||||
|
||||
function pruneBuffer(_buff: any): any
|
||||
|
||||
function prv2pub(prv: any): any
|
||||
|
||||
function sign(prv: any, msg: any): any
|
||||
|
||||
function signMiMC(prv: any, msg: any): any
|
||||
|
||||
function signMiMCSponge(prv: any, msg: any): any
|
||||
|
||||
function signPoseidon(prv: any, msg: any): any
|
||||
|
||||
function unpackSignature(sigBuff: any): any
|
||||
|
||||
function verify(msg: any, sig: any, A: any): any
|
||||
|
||||
function verifyMiMC(msg: any, sig: any, A: any): any
|
||||
|
||||
function verifyMiMCSponge(msg: any, sig: any, A: any): any
|
||||
|
||||
function verifyPoseidon(msg: any, sig: any, A: any): any
|
||||
}
|
||||
|
||||
export namespace mimc7 {
|
||||
function getConstants(seed: any, nRounds: any): any
|
||||
|
||||
function getIV(seed: any): any
|
||||
|
||||
function hash(_x_in: any, _k: any): any
|
||||
|
||||
function multiHash(arr: any, key: any): any
|
||||
|
||||
namespace F {
|
||||
const R: any
|
||||
|
||||
const Ri: any
|
||||
|
||||
const bitLength: number
|
||||
|
||||
const half: any
|
||||
|
||||
const m: number
|
||||
|
||||
const mask: any
|
||||
|
||||
const n32: number
|
||||
|
||||
const n64: number
|
||||
|
||||
const n8: number
|
||||
|
||||
const negone: any
|
||||
|
||||
const nqr: any
|
||||
|
||||
const nqr_to_t: any
|
||||
|
||||
const one: any
|
||||
|
||||
const p: any
|
||||
|
||||
const s: number
|
||||
|
||||
const sqrt_q: any
|
||||
|
||||
const sqrt_s: number
|
||||
|
||||
const sqrt_t: any
|
||||
|
||||
const sqrt_tm1d2: any
|
||||
|
||||
const sqrt_z: any
|
||||
|
||||
const t: any
|
||||
|
||||
const two: any
|
||||
|
||||
const type: string
|
||||
|
||||
const zero: any
|
||||
|
||||
function add(...args: any[]): void
|
||||
|
||||
function band(...args: any[]): void
|
||||
|
||||
function bnot(...args: any[]): void
|
||||
|
||||
function bor(...args: any[]): void
|
||||
|
||||
function bxor(...args: any[]): void
|
||||
|
||||
function div(...args: any[]): void
|
||||
|
||||
function e(...args: any[]): void
|
||||
|
||||
function eq(...args: any[]): void
|
||||
|
||||
function exp(...args: any[]): void
|
||||
|
||||
function fromRng(...args: any[]): void
|
||||
|
||||
function fromRprBE(...args: any[]): void
|
||||
|
||||
function fromRprBEM(...args: any[]): void
|
||||
|
||||
function fromRprLE(...args: any[]): void
|
||||
|
||||
function fromRprLEM(...args: any[]): void
|
||||
|
||||
function geq(...args: any[]): void
|
||||
|
||||
function gt(...args: any[]): void
|
||||
|
||||
function idiv(...args: any[]): void
|
||||
|
||||
function inv(...args: any[]): void
|
||||
|
||||
function isZero(...args: any[]): void
|
||||
|
||||
function land(...args: any[]): void
|
||||
|
||||
function leq(...args: any[]): void
|
||||
|
||||
function lnot(...args: any[]): void
|
||||
|
||||
function lor(...args: any[]): void
|
||||
|
||||
function lt(...args: any[]): void
|
||||
|
||||
function mod(...args: any[]): void
|
||||
|
||||
function mul(...args: any[]): void
|
||||
|
||||
function mulScalar(...args: any[]): void
|
||||
|
||||
function neg(...args: any[]): void
|
||||
|
||||
function neq(...args: any[]): void
|
||||
|
||||
function normalize(...args: any[]): void
|
||||
|
||||
function pow(...args: any[]): void
|
||||
|
||||
function random(...args: any[]): void
|
||||
|
||||
function shl(...args: any[]): void
|
||||
|
||||
function shr(...args: any[]): void
|
||||
|
||||
function sqrt(a: any): any
|
||||
|
||||
function sqrt_old(...args: any[]): void
|
||||
|
||||
function square(...args: any[]): void
|
||||
|
||||
function sub(...args: any[]): void
|
||||
|
||||
function toRprBE(...args: any[]): void
|
||||
|
||||
function toRprBEM(...args: any[]): void
|
||||
|
||||
function toRprLE(...args: any[]): void
|
||||
|
||||
function toRprLEM(...args: any[]): void
|
||||
|
||||
function toString(...args: any[]): void
|
||||
}
|
||||
}
|
||||
|
||||
export namespace mimc_gencontract {
|
||||
const abi: {
|
||||
constant: boolean
|
||||
inputs: {
|
||||
name: string
|
||||
type: string
|
||||
}[]
|
||||
name: string
|
||||
outputs: {
|
||||
name: string
|
||||
type: string
|
||||
}[]
|
||||
payable: boolean
|
||||
stateMutability: string
|
||||
type: string
|
||||
}[]
|
||||
|
||||
function createCode(seed: any, n: any): any
|
||||
}
|
||||
|
||||
export namespace mimcsponge {
|
||||
function getConstants(seed: any, nRounds: any): any
|
||||
|
||||
function getIV(seed: any): any
|
||||
|
||||
function hash(_xL_in: any, _xR_in: any, _k: any): any
|
||||
|
||||
function multiHash(arr: any, key: any, numOutputs: any): any
|
||||
}
|
||||
|
||||
export namespace mimcsponge_gencontract {
|
||||
const abi: {
|
||||
constant: boolean
|
||||
inputs: {
|
||||
name: string
|
||||
type: string
|
||||
}[]
|
||||
name: string
|
||||
outputs: {
|
||||
name: string
|
||||
type: string
|
||||
}[]
|
||||
payable: boolean
|
||||
stateMutability: string
|
||||
type: string
|
||||
}[]
|
||||
|
||||
function createCode(seed: any, n: any): any
|
||||
}
|
||||
|
||||
export namespace pedersenHash {
|
||||
function getBasePoint(baseHashType: any, pointIdx: any): any
|
||||
|
||||
function hash(msg: any, options: any): any
|
||||
}
|
||||
|
||||
export namespace poseidon_gencontract {
|
||||
function createCode(nInputs: any): any
|
||||
|
||||
function generateABI(nInputs: any): any
|
||||
}
|
||||
|
||||
export namespace smt {
|
||||
class SMT {
|
||||
constructor(...args: any[])
|
||||
|
||||
delete(...args: any[]): void
|
||||
|
||||
find(...args: any[]): void
|
||||
|
||||
insert(...args: any[]): void
|
||||
|
||||
update(...args: any[]): void
|
||||
}
|
||||
|
||||
class SMTMemDB {
|
||||
constructor(...args: any[])
|
||||
|
||||
get(...args: any[]): void
|
||||
|
||||
getRoot(...args: any[]): void
|
||||
|
||||
multiDel(...args: any[]): void
|
||||
|
||||
multiGet(...args: any[]): void
|
||||
|
||||
multiIns(...args: any[]): void
|
||||
|
||||
setRoot(...args: any[]): void
|
||||
}
|
||||
|
||||
function loadFromFile(fileName: any): void
|
||||
|
||||
function newMemEmptyTrie(): any
|
||||
}
|
||||
|
||||
export namespace smt_hashes_mimc {
|
||||
function hash0(left: any, right: any): any
|
||||
|
||||
function hash1(key: any, value: any): any
|
||||
|
||||
namespace F {
|
||||
const R: any
|
||||
|
||||
const Ri: any
|
||||
|
||||
const bitLength: number
|
||||
|
||||
const half: any
|
||||
|
||||
const m: number
|
||||
|
||||
const mask: any
|
||||
|
||||
const n32: number
|
||||
|
||||
const n64: number
|
||||
|
||||
const n8: number
|
||||
|
||||
const negone: any
|
||||
|
||||
const nqr: any
|
||||
|
||||
const nqr_to_t: any
|
||||
|
||||
const one: any
|
||||
|
||||
const p: any
|
||||
|
||||
const s: number
|
||||
|
||||
const sqrt_q: any
|
||||
|
||||
const sqrt_s: number
|
||||
|
||||
const sqrt_t: any
|
||||
|
||||
const sqrt_tm1d2: any
|
||||
|
||||
const sqrt_z: any
|
||||
|
||||
const t: any
|
||||
|
||||
const two: any
|
||||
|
||||
const type: string
|
||||
|
||||
const zero: any
|
||||
|
||||
function add(...args: any[]): void
|
||||
|
||||
function band(...args: any[]): void
|
||||
|
||||
function bnot(...args: any[]): void
|
||||
|
||||
function bor(...args: any[]): void
|
||||
|
||||
function bxor(...args: any[]): void
|
||||
|
||||
function div(...args: any[]): void
|
||||
|
||||
function e(...args: any[]): void
|
||||
|
||||
function eq(...args: any[]): void
|
||||
|
||||
function exp(...args: any[]): void
|
||||
|
||||
function fromRng(...args: any[]): void
|
||||
|
||||
function fromRprBE(...args: any[]): void
|
||||
|
||||
function fromRprBEM(...args: any[]): void
|
||||
|
||||
function fromRprLE(...args: any[]): void
|
||||
|
||||
function fromRprLEM(...args: any[]): void
|
||||
|
||||
function geq(...args: any[]): void
|
||||
|
||||
function gt(...args: any[]): void
|
||||
|
||||
function idiv(...args: any[]): void
|
||||
|
||||
function inv(...args: any[]): void
|
||||
|
||||
function isZero(...args: any[]): void
|
||||
|
||||
function land(...args: any[]): void
|
||||
|
||||
function leq(...args: any[]): void
|
||||
|
||||
function lnot(...args: any[]): void
|
||||
|
||||
function lor(...args: any[]): void
|
||||
|
||||
function lt(...args: any[]): void
|
||||
|
||||
function mod(...args: any[]): void
|
||||
|
||||
function mul(...args: any[]): void
|
||||
|
||||
function mulScalar(...args: any[]): void
|
||||
|
||||
function neg(...args: any[]): void
|
||||
|
||||
function neq(...args: any[]): void
|
||||
|
||||
function normalize(...args: any[]): void
|
||||
|
||||
function pow(...args: any[]): void
|
||||
|
||||
function random(...args: any[]): void
|
||||
|
||||
function shl(...args: any[]): void
|
||||
|
||||
function shr(...args: any[]): void
|
||||
|
||||
function sqrt(a: any): any
|
||||
|
||||
function sqrt_old(...args: any[]): void
|
||||
|
||||
function square(...args: any[]): void
|
||||
|
||||
function sub(...args: any[]): void
|
||||
|
||||
function toRprBE(...args: any[]): void
|
||||
|
||||
function toRprBEM(...args: any[]): void
|
||||
|
||||
function toRprLE(...args: any[]): void
|
||||
|
||||
function toRprLEM(...args: any[]): void
|
||||
|
||||
function toString(...args: any[]): void
|
||||
}
|
||||
}
|
||||
|
||||
export namespace smt_hashes_poseidon {
|
||||
function hash0(left: any, right: any): any
|
||||
|
||||
function hash1(key: any, value: any): any
|
||||
|
||||
namespace F {
|
||||
const R: any
|
||||
|
||||
const Ri: any
|
||||
|
||||
const bitLength: number
|
||||
|
||||
const half: any
|
||||
|
||||
const m: number
|
||||
|
||||
const mask: any
|
||||
|
||||
const n32: number
|
||||
|
||||
const n64: number
|
||||
|
||||
const n8: number
|
||||
|
||||
const negone: any
|
||||
|
||||
const nqr: any
|
||||
|
||||
const nqr_to_t: any
|
||||
|
||||
const one: any
|
||||
|
||||
const p: any
|
||||
|
||||
const s: number
|
||||
|
||||
const sqrt_q: any
|
||||
|
||||
const sqrt_s: number
|
||||
|
||||
const sqrt_t: any
|
||||
|
||||
const sqrt_tm1d2: any
|
||||
|
||||
const sqrt_z: any
|
||||
|
||||
const t: any
|
||||
|
||||
const two: any
|
||||
|
||||
const type: string
|
||||
|
||||
const zero: any
|
||||
|
||||
function add(...args: any[]): void
|
||||
|
||||
function band(...args: any[]): void
|
||||
|
||||
function bnot(...args: any[]): void
|
||||
|
||||
function bor(...args: any[]): void
|
||||
|
||||
function bxor(...args: any[]): void
|
||||
|
||||
function div(...args: any[]): void
|
||||
|
||||
function e(...args: any[]): void
|
||||
|
||||
function eq(...args: any[]): void
|
||||
|
||||
function exp(...args: any[]): void
|
||||
|
||||
function fromRng(...args: any[]): void
|
||||
|
||||
function fromRprBE(...args: any[]): void
|
||||
|
||||
function fromRprBEM(...args: any[]): void
|
||||
|
||||
function fromRprLE(...args: any[]): void
|
||||
|
||||
function fromRprLEM(...args: any[]): void
|
||||
|
||||
function geq(...args: any[]): void
|
||||
|
||||
function gt(...args: any[]): void
|
||||
|
||||
function idiv(...args: any[]): void
|
||||
|
||||
function inv(...args: any[]): void
|
||||
|
||||
function isZero(...args: any[]): void
|
||||
|
||||
function land(...args: any[]): void
|
||||
|
||||
function leq(...args: any[]): void
|
||||
|
||||
function lnot(...args: any[]): void
|
||||
|
||||
function lor(...args: any[]): void
|
||||
|
||||
function lt(...args: any[]): void
|
||||
|
||||
function mod(...args: any[]): void
|
||||
|
||||
function mul(...args: any[]): void
|
||||
|
||||
function mulScalar(...args: any[]): void
|
||||
|
||||
function neg(...args: any[]): void
|
||||
|
||||
function neq(...args: any[]): void
|
||||
|
||||
function normalize(...args: any[]): void
|
||||
|
||||
function pow(...args: any[]): void
|
||||
|
||||
function random(...args: any[]): void
|
||||
|
||||
function shl(...args: any[]): void
|
||||
|
||||
function shr(...args: any[]): void
|
||||
|
||||
function sqrt(a: any): any
|
||||
|
||||
function sqrt_old(...args: any[]): void
|
||||
|
||||
function square(...args: any[]): void
|
||||
|
||||
function sub(...args: any[]): void
|
||||
|
||||
function toRprBE(...args: any[]): void
|
||||
|
||||
function toRprBEM(...args: any[]): void
|
||||
|
||||
function toRprLE(...args: any[]): void
|
||||
|
||||
function toRprLEM(...args: any[]): void
|
||||
|
||||
function toString(...args: any[]): void
|
||||
}
|
||||
}
|
||||
}
|
||||
57
types/snarkjs/index.d.ts
vendored
57
types/snarkjs/index.d.ts
vendored
@@ -1,57 +0,0 @@
|
||||
/** Declaration file generated by dts-gen */
|
||||
|
||||
declare module "snarkjs" {
|
||||
export = snarkjs
|
||||
|
||||
declare const snarkjs: {
|
||||
groth16: {
|
||||
exportSolidityCallData: any
|
||||
fullProve: any
|
||||
prove: any
|
||||
verify: any
|
||||
}
|
||||
plonk: {
|
||||
exportSolidityCallData: any
|
||||
fullProve: any
|
||||
prove: any
|
||||
setup: any
|
||||
verify: any
|
||||
}
|
||||
powersOfTau: {
|
||||
beacon: any
|
||||
challengeContribute: any
|
||||
contribute: any
|
||||
convert: any
|
||||
exportChallenge: any
|
||||
exportJson: any
|
||||
importResponse: any
|
||||
newAccumulator: any
|
||||
preparePhase2: any
|
||||
truncate: any
|
||||
verify: any
|
||||
}
|
||||
r1cs: {
|
||||
exportJson: any
|
||||
info: any
|
||||
print: any
|
||||
}
|
||||
wtns: {
|
||||
calculate: any
|
||||
debug: any
|
||||
exportJson: any
|
||||
}
|
||||
zKey: {
|
||||
beacon: any
|
||||
bellmanContribute: any
|
||||
contribute: any
|
||||
exportBellman: any
|
||||
exportJson: any
|
||||
exportSolidityVerifier: any
|
||||
exportVerificationKey: any
|
||||
importBellman: any
|
||||
newZKey: any
|
||||
verifyFromInit: any
|
||||
verifyFromR1cs: any
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1 +1 @@
|
||||
14647f7bb1147ded614a3201a53e50dbecc65188
|
||||
dc2f95a0a229d9a66a7b3900e3f2c2eeb3c4cd81
|
||||
Reference in New Issue
Block a user