The ZK-Kit EdDSA Poseidon package only supports the following private key types: text, buffer. The Semaphore identity supports text and hexadecimal strings. If the identity private key is an hexadicimal string it needs to be converted before being passed to any ZK-Kit function. re #733
| Semaphore is a generic privacy layer. Leveraging zero-knowledge technology, users can prove their membership in groups and send messages (extending from votes to endorsements) off-chain or across EVM-compatible blockchains, all without revealing their personal identity. |
|---|
The core of the Semaphore protocol is in the circuit logic. However, Semaphore also provides Solidity contracts and JavaScript libraries to make the steps for offchain proof creation and onchain/offchain verification easier. To learn more about Semaphore visit semaphore.pse.dev.
📦 Packages
🛠 Install
Clone this repository:
git clone https://github.com/semaphore-protocol/semaphore.git
And install the dependencies:
cd semaphore && yarn
📜 Usage
Copy the .env.example file as .env:
cp .env.example .env
And add your environment variables.
Code quality and formatting
Run ESLint to analyze the code and catch bugs:
yarn lint
Run Prettier to check formatting rules:
yarn prettier
Or to automatically format the code:
yarn prettier:write
Conventional commits
Semaphore uses conventional commits. A command line utility to commit using the correct syntax can be used by running:
yarn commit
It will also automatically check that the modified files comply with ESLint and Prettier rules.
Testing
Run Jest to test the JS libraries:
yarn test:libraries
Run Mocha to test the contracts:
yarn test:contracts
Or test everything with:
yarn test
Build libraries & compile contracts
Run Rollup and TheGraph to build all the packages and the subgraph:
yarn build
Compile the smart contracts with Hardhat:
yarn compile:contracts
Documentation (JS libraries)
Run TypeDoc to generate a documentation website for each package:
yarn docs
The output will be placed on the docs folder.
Releases
Bump a new version with:
yarn version:bump <version>
# e.g. yarn version:bump 2.0.0
It will create a commit and a git tag that will need to pushed on the main branch. A workflow will be triggered and will publish the Semaphore packages on npm and release a new version on Github with its changelogs automatically.