@zk-kit/identity

v1.4.1
Library for managing identities for Semaphore and RLN protocols.

ZK identities

Library for managing identities for Semaphore and RLN protocols.

Github license NPM version Downloads npm bundle size (scoped) Linter eslint Code style prettier


🛠 Install

npm or yarn

Install the @zk-kit/identity package with npm:

npm i @zk-kit/identity

or yarn:

yarn add @zk-kit/identity

📜 Usage

Creating an identity with a random strategy:

import { ZkIdentity } from "@zk-kit/identity"
// const { ZkIdentity } = require("@zk-kit/identity") // with commonJS

const identity = new ZkIdentity()

const trapdoor = identity.getTrapdoor()
const nullifier = identity.getNullifier()
const secret = identity.getSecret()
const multipartSecret = identity.getMultipartSecret()

const identityCommitment = identity.genIdentityCommitment()

Creating an identity with a message strategy:

import { ZkIdentity, Strategy } from "@zk-kit/identity"

const identity = new ZkIdentity(Strategy.MESSAGE, "message")

Creating an identity with a serialized strategy:

import { ZkIdentity, Strategy } from "@zk-kit/identity"

const identity = new ZkIdentity()
const serializedIdentity = identity.serializeIdentity()

const identity2 = new ZkIdentity(Strategy.SERIALIZED, serializedIdentity)
npm i @zk-kit/identity

Metadata

  • MIT
  • Whatever
  • Andrija Novakovic
  • released 2/10/2022

Downloads