@semaphore-protocol/identity v4.5.0
This library provides a class that can be used to create identities compatible with the Semaphore circuits. Each identity contains two secret values: trapdoor and nullifier, and one public value: commitment. The Poseidon hash of the secret values is the identity secret, and its hash is the identity commitment. |
---|
🛠 Install
npm or yarn
Install the @semaphore-protocol/identity
package with npm:
npm i @semaphore-protocol/identity
or yarn:
yarn add @semaphore-protocol/identity
📜 Usage
# new Identity(identityOrMessage?: string): Identity
import { Identity } from "@semaphore-protocol/identity"
// The identity can be generated randomly.
const identity1 = new Identity()
// Deterministically from a secret message.
const identity2 = new Identity("secret-message")
// Or it can be retrieved from an existing identity.
const identity3 = new Identity(identity1.toString())
// Trapdoor, nullifier and commitment are the attributes (e.g. JS getters).
const { trapdoor, nullifier, commitment } = identity1
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
3 months ago
3 months ago
3 months ago
6 months ago
6 months ago
5 months ago
6 months ago
6 months ago
7 months ago
5 months ago
5 months ago
4 months ago
4 months ago
5 months ago
5 months ago
7 months ago
7 months ago
8 months ago
8 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
12 months ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago