Files
zk-kit/packages/identity
cedoor 5536a18022 build(ts): add zk-kit types path on build tsconfigs
Former-commit-id: 646f4f71a223d22ed0bf0119edd13a1d98d59b39 [formerly fe290e7847a12af90ec3bda31715f855408b05a9] [formerly 3d25a852e9c1848cfc2ccdd6ddbd9a9c3dd47ddf [formerly 9f930764ab3ff48686e89060db49c8ed38bbcada]] [formerly 159c11c051f0beb6247016a6b2f9f81b23a88e6e [formerly 0ffc887122e0bc6c826412302687331180c5b8dc] [formerly b52fd0cff4370692dda613988b31e0c993c9b593 [formerly bd48b10474]]]
Former-commit-id: 140d2048207d1f13076b0a5daa57ebb1fcffdbbf [formerly d28b41fa99920eef151f344b406fd39aff5b889f] [formerly a5bd3cda7c160ffd3657f8b8ff79e6c5d21344af [formerly 32860b344803c0900a8b939951402b76f55b1f4c]]
Former-commit-id: f230562806bc73f2e597cb50e07212a2f6557aef [formerly a4af48f4d3c4de94e2356c16d1e55fe30c9270d2]
Former-commit-id: 9f4c66f9cb674eff7c00142652f807bfa4f7da79
2022-01-24 17:19:06 +01:00
..
2022-01-21 13:56:04 +01:00
2022-01-21 13:56:04 +01:00
2022-01-23 12:26:40 +01:00
2022-01-21 22:43:14 +01:00
2022-01-20 14:05:43 +01:00

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)