🚨 Shai-Hulud Strikes Again:834 Packages Compromised.Technical Analysis →
Socket
Book a DemoInstallSign in
Socket

@zk-kit/circuits

Package Overview
Dependencies
Maintainers
3
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@zk-kit/circuits

A comprehensive library of general-purpose zero-knowledge circuits.

latest
npmnpm
Version
1.0.0-beta
Version published
Weekly downloads
954
3.7%
Maintainers
3
Weekly downloads
 
Created
Source

ZK-kit circuits

A comprehensive library of general-purpose zero-knowledge circuits.

NPM license NPM version Downloads

🗣️ Chat & Support

This package offers a collection of reusable circuits designed for integration into other projects or protocols, promoting code modularization within the zero-knowledge ecosystem.

[!IMPORTANT]
Installation of Circom and Nargo required for circuit tests.

Circuits

  • Circom:
    • PoseidonProof: proves the possession of Poseidon pre-images without revealing the pre-images themselves.
    • BinaryMerkleRoot: calculates the root of a binary Merkle tree using a provided proof-of-membership.
    • EddsaProof: proves the possession of a private key of an identity commitment without revealing the private key itself.
    • PoseidonDecrypt: decrypts a ciphertext using Poseidon hash function, considering an initial nonce and a key, and adjusts output length to a multiple of 3.
    • PoseidonDecryptWithoutCheck: decrypts a ciphertext using the Poseidon hash without validating the last ciphertext element or ensuring the last elements equal 0.
    • PoseidonDecryptIterations: decrypts a ciphertext in iterations, adjusting for a 3-element block size and validating nonce size, while revealing intermediate decryption states.
    • PoseidonPerm: performs Poseidon permutation on a given number of inputs, revealing all intermediate values and using specified rounds and constants for the operation.
  • Noir:
    • Sparse Merkle Tree PoseidonBN254: A reusable library of functions related to Sparse Merkle Trees based on the JS implementation of @zk-kit/smt. The library uses the Poseidon hash to implement the following functions:
      • verifying membership and non-membership proofs
      • adding a new entry to a SMT
      • updating an entry of an SMT
      • deleting an existing entry from an SMT

đź›  Install

Using NPM or Yarn (Circom circuits)

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

npm i @zk-kit/circuits --save

or yarn:

yarn add @zk-kit/circuits

Using Nargo (Noir circuits)

In your Nargo.toml file, add the following dependency:

[dependencies]
smt_bn254 = { tag = "v0.1.0", git = "https://github.com/privacy-scaling-explorations/zk-kit/packages/circuits/noir", directory="crates/smt_bn254" }

FAQs

Package last updated on 18 Mar 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts