light-poseidon Python Bindings
Python bindings for light-poseidon, originally by Mike Rostecki. This package is a fork providing Python access to the Poseidon hash implementation for the BN254 curve.
Compatibility
This package is made to be compatible with Kusama Shield's PoseidonPolkaVM.
Installation
pip install light-poseidon
Usage
from light_poseidon_python import poseidon_hash, poseidon_hash_bytes, Hasher
# One-shot function with uint64 inputs
result = poseidon_hash([1, 2])
print(result) # 0x115cc0f5e7d690413df64c6b9662e9cf2a3617f2743245519e19607a4417189a
# Byte inputs (32 bytes each, big-endian)
a = b"\x01" * 32
b = b"\x02" * 32
result = poseidon_hash_bytes([a, b])
# Reusable Hasher class
hasher = Hasher(2) # 2 inputs
result = hasher.hash([1, 2])
# Byte variants
hasher.hash_bytes_be([a, b]) # big-endian
hasher.hash_bytes_le([a, b]) # little-endian
Supported arities
1-12 inputs are supported.
Development
# Using Makefile
make install # Create venv and build
make test # Run basic tests
make build # Build wheel
make publish # Publish to PyPI
# Or manually
cd light-poseidon-python
python3 -m venv .venv
source .venv/bin/activate
pip install maturin
maturin develop
Metadata
Release files for light-poseidon 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| light_poseidon-0.1.1.tar.gz | 358.2 kB | Without provenance | Details for light_poseidon-0.1.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| light_poseidon-0.1.1-cp311-cp311-manylinux_2_34_x86_64.whl | CPython 3.11 | CPython 3.11 | Linux glibc 2.34+ x86-64 | Details for light_poseidon-0.1.1-cp311-cp311-manylinux_2_34_x86_64.whl |
Total release size: 1.1 MB
Release files / light_poseidon-0.1.1.tar.gz
| Download URL | light_poseidon-0.1.1.tar.gz |
|---|---|
| Size | 358.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ca2386f6591d6a54408a2f46d5e6288bfb8a802be31a713b6a8acae254a6a805
|
|
BLAKE2b-256 checksum How to use checksums |
cc95576e0502057e717194930af570c89a69250a3744c2b82c178b6ccb7d3cee
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/1.14.1
|
Release files / light_poseidon-0.1.1-cp311-cp311-manylinux_2_34_x86_64.whl
| Download URL | light_poseidon-0.1.1-cp311-cp311-manylinux_2_34_x86_64.whl |
|---|---|
| Size | 702.2 kB |
| Tags | CPython 3.11 Linux glibc 2.34+ x86-64 |
|
SHA-256 checksum How to use checksums |
83cad4e9ed1c557a7fa3149be6c74af85b1b8d9e3495db72bbb145e86635147b
|
|
BLAKE2b-256 checksum How to use checksums |
8a29d0d7574dd777f57e52765d2ef9cddeaf4c36ee30bc4f6b5dd5bb2c957f51
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/1.14.1
|
Security for light-poseidon 0.1.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.