Files
semaphore/packages/core
Vivian Plasencia 5c9d1737d3 chore: v4.9.2
2025-03-31 12:50:00 +02:00
..
2024-02-10 15:26:07 +00:00
2025-03-31 12:50:00 +02:00

Semaphore core

Core library for the essential Semaphore features.

NPM license NPM version Downloads Linter eslint Code style prettier

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

npm or yarn

Install the @semaphore-protocol/core package with npm:

npm i @semaphore-protocol/core

or yarn:

yarn add @semaphore-protocol/core

📜 Usage

import { 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)