mirror of
https://github.com/privacy-scaling-explorations/zk-kit.git
synced 2026-04-22 03:00:15 -04:00
update readme
This commit is contained in:
@@ -59,14 +59,14 @@ const { ZkIdentity } = require("@libsem/identity")
|
||||
**Mainpulation**
|
||||
|
||||
```typescript
|
||||
const identity: Identity = ZkIdentity.genIdentity()
|
||||
const identityCommitment: bigint = ZkIdentity.genIdentityCommitment(identity)
|
||||
const identity: ZkIdentity = new ZkIdentity();
|
||||
const identityCommitment: bigint = identity.genIdentityCommitment();
|
||||
```
|
||||
|
||||
**Serialization**
|
||||
|
||||
```typescript
|
||||
const identity: Identity = ZkIdentity.genIdentity()
|
||||
const serialized: string = ZkIdentity.serializeIdentity(identity)
|
||||
const unserialized: Identity = ZkIdentity.unSerializeIdentity(serialized)
|
||||
const identity: ZkIdentity = new ZkIdentity();
|
||||
const serialized: string = identity.serializeIdentity()
|
||||
const unserialized: ZkIdentity = ZkIdentity.genFromSerialized(serialized);
|
||||
```
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@libsem/identity",
|
||||
"version": "1.0.12",
|
||||
"version": "1.0.13",
|
||||
"description": "Library for managing identites for Semaphore and Rln protocols.",
|
||||
"main": "dist/index.node.js",
|
||||
"types": "dist/types/index.d.ts",
|
||||
|
||||
@@ -70,7 +70,8 @@ Generate merkle proof for your identity given the array of registered identity c
|
||||
|
||||
```typescript
|
||||
const identityCommitments: Array<bigint> = [...];
|
||||
const identityCommitment: bigint = ZkIdentity.genIdentityCommitment(identity);
|
||||
const identity: ZkIdentity = new ZkIdentity();
|
||||
const identityCommitment: bigint = identity.genIdentityCommitment();
|
||||
|
||||
const merkleProof: MerkleProof = generateMerkleProof(TREE_DEPTH, ZERO_VALUE, NUMBER_OF_LEAVES_PER_NODE, identityCommitments, identityCommitment);
|
||||
```
|
||||
@@ -84,14 +85,6 @@ const witness = Semaphore.genWitness(identity, merkleProof, externalNullifier, s
|
||||
const fullProof = await Semaphore.genProof(witness, wasmFilePath, finalZkeyPath)
|
||||
```
|
||||
|
||||
**Serialization**
|
||||
|
||||
```typescript
|
||||
const identity: Identity = ZkIdentity.genIdentity()
|
||||
const serialized: string = ZkIdentity.serializeIdentity(identity)
|
||||
const unserialized: Identity = ZkIdentity.unSerializeIdentity(serialized)
|
||||
```
|
||||
|
||||
## 📜 Final Note
|
||||
|
||||
For full examples of how to integrate with contracts check https://github.com/appliedzkp/semaphore repository.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@libsem/protocols",
|
||||
"version": "1.0.13",
|
||||
"version": "1.0.14",
|
||||
"description": "Client library for generating and verifying Semaphore & Rln ZK proofs.",
|
||||
"main": "dist/index.node.js",
|
||||
"types": "dist/types/index.d.ts",
|
||||
|
||||
Reference in New Issue
Block a user