Security News
Supply Chain Attack Detected in Solana's web3.js Library
A supply chain attack has been detected in versions 1.95.6 and 1.95.7 of the popular @solana/web3.js library.
poseidon-bls12381
Advanced tools
Implementation of the ZK-friendly Poseidon hash in TypeScript. The hash is prepared for the elliptic curve BLS12-381.
This implementation is based on the original Poseidon paper and the official Poseidon implementation. The updated paper recommends that the parameters are calculated with the script
code/generate_params_poseidon.sage
. The parameters are prepared for the curve BLS12-381 and a security level of 128 bits using the recommended script.
Add to your javascript project through npm
$ npm install poseidon-bls12381
Poseidon hash is designed for ZK circuits and its parameters are a group of field elements of its elliptic curve. That's why, you'll need to know beforehand how many parameters you want to use in your hash function.
This repository provides function from 1 to 16 parameters. This is an example of call with 2 parameters:
import { poseidon2 } from "poseidon-bls12381";
const hash = poseidon2([BigInt("0x01"), BigInt("0x02")]);
This project provides the scripts for building and testing:
# Build
$ npm install
$ npm run build
# Test
$ npm run test
This project is licensed under the MIT License - see the LICENSE file for details.
FAQs
Poseidon implementation for the BLS12-381 elliptic curve
We found that poseidon-bls12381 demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
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.
Security News
A supply chain attack has been detected in versions 1.95.6 and 1.95.7 of the popular @solana/web3.js library.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.