Core library for the essential Semaphore features.
This library is a simple re-export of the Semaphore core libraries: @semaphore-protocol/identity, @semaphore-protocol/group, @semaphore-protocol/proof. So that developers can install a single package to use all the core functionalities of the protocol. |
|---|
Install the @semaphore-protocol/core package with npm:
npm i @semaphore-protocol/coreor yarn:
yarn add @semaphore-protocol/coreimport { Identity, Group, generateProof, verifyProof } from "@semaphore-protocol/core"
const identity1 = new Identity()
const identity2 = new Identity()
const identity3 = new Identity()
const group = new Group([identity1.commitment, identity2.commitment, identity3.commitment])
const message = "Hello world"
const scope = "Semaphore"
const proof = await generateProof(identity1, group, message, scope)
await verifyProof(proof)