Construct and invoke Pedersen hash functions (Rust-backed, arkworks)
Project description
pedersenpy
Rust-backed Pedersen hash functions for Python — one engine, the whole family of widely-known variants, validated byte-for-byte against their references.
arkworks, circomlib/iden3, and Zcash Sapling all define "a Pedersen hash," but their outputs disagree. pedersenpy implements the shared construction once (in Rust, on arkworks curves) and exposes each ecosystem's hash.
Install
pip install pedersenpy
Wheels are self-contained (abi3, Python ≥ 3.9) — no Rust toolchain needed to install.
Usage
import pedersenpy
# circom / iden3 — byte-identical to circomlibjs pedersenHash
c = pedersenpy.CircomPedersen()
c.hash(b"Hello").hex()
# '0e90d7d613ab8b5ea7f4f8bc537db6bb0fa2e5e97bbac1c1f609ef9e6a35fd8b'
# Zcash Sapling — 32-byte little-endian u-coordinate
z = pedersenpy.ZcashPedersen() # default personalization b"Zcash_PH"
int.from_bytes(z.hash(b"Hello"), "little")
# 8754254972755604884333948367738998890971419059392001151429652007230018821080
# arkworks-shaped instances (deterministic generators)
pedersenpy.BabyJubjubPedersen(64, 4).hash(b"data")
pedersenpy.JubjubBoweHopwood(16, 40).hash(b"data")
CircomPedersen and ZcashPedersen cache their generators — reuse one instance for many hashes.
Hashers
| Class | Returns | Compatible with |
|---|---|---|
CircomPedersen() |
32-byte packed point | byte-exact circomlibjs pedersenHash |
ZcashPedersen(personalization=b"Zcash_PH") |
32-byte LE u-coordinate | byte-exact Zcash Sapling |
BabyJubjubPedersen(segments, bits_per_window) |
compressed point | arkworks pedersen::CRH |
JubjubBoweHopwood(segments, chunks_per_segment) |
x-coordinate | arkworks bowe_hopwood::CRH |
The package ships type stubs (py.typed), so mypy/pyright and editors get full typing.
Links
- Documentation: https://luksgrin.github.io/pedersen-py/
- Source: https://github.com/luksgrin/pedersen-py
- Rust crate (
pedersen-kit): the reusable core engine.
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pedersenpy-0.1.1-cp39-abi3-win_amd64.whl.
File metadata
- Download URL: pedersenpy-0.1.1-cp39-abi3-win_amd64.whl
- Upload date:
- Size: 240.3 kB
- Tags: CPython 3.9+, Windows x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6721304501e4bc20d35ffe60765ad6bb5c0b6216b07153bfc337d64dd30636af
|
|
| MD5 |
b25b1c7ee849437f10722b12e5bde64a
|
|
| BLAKE2b-256 |
d0e5c4c63fdb581acfdd4c17afe201527cbf5d374e25e629aed264b88d5840be
|
Provenance
The following attestation bundles were made for pedersenpy-0.1.1-cp39-abi3-win_amd64.whl:
Publisher:
release.yml on luksgrin/pedersen-py
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pedersenpy-0.1.1-cp39-abi3-win_amd64.whl -
Subject digest:
6721304501e4bc20d35ffe60765ad6bb5c0b6216b07153bfc337d64dd30636af - Sigstore transparency entry: 2143274567
- Sigstore integration time:
-
Permalink:
luksgrin/pedersen-py@eea5fe7f19a1fb2a1c07664bdbf8b14abd61fd38 -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/luksgrin
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@eea5fe7f19a1fb2a1c07664bdbf8b14abd61fd38 -
Trigger Event:
push
-
Statement type:
File details
Details for the file pedersenpy-0.1.1-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.
File metadata
- Download URL: pedersenpy-0.1.1-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 383.8 kB
- Tags: CPython 3.9+, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2e0ca3b867c5014e37e3ea4543dce3693570d6b6c2550788692033c6b65bb3dd
|
|
| MD5 |
2f256a0c4ec5fb2bcd6421b10b864937
|
|
| BLAKE2b-256 |
6cd691d6dfe847dece61a26338440fafeff6d5dcc72fe014654aeeee64ed0e95
|
Provenance
The following attestation bundles were made for pedersenpy-0.1.1-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:
Publisher:
release.yml on luksgrin/pedersen-py
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pedersenpy-0.1.1-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl -
Subject digest:
2e0ca3b867c5014e37e3ea4543dce3693570d6b6c2550788692033c6b65bb3dd - Sigstore transparency entry: 2143274685
- Sigstore integration time:
-
Permalink:
luksgrin/pedersen-py@eea5fe7f19a1fb2a1c07664bdbf8b14abd61fd38 -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/luksgrin
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@eea5fe7f19a1fb2a1c07664bdbf8b14abd61fd38 -
Trigger Event:
push
-
Statement type:
File details
Details for the file pedersenpy-0.1.1-cp39-abi3-macosx_11_0_arm64.whl.
File metadata
- Download URL: pedersenpy-0.1.1-cp39-abi3-macosx_11_0_arm64.whl
- Upload date:
- Size: 349.9 kB
- Tags: CPython 3.9+, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
62d0149bb110b1f5b7d5e4df30f14fcdbbff0108b023e59ac014cc1bc27d5bac
|
|
| MD5 |
650149f6d301424628e51ff2ebaf9efb
|
|
| BLAKE2b-256 |
60757988d3354c6997fa678d9b73c5686a00e80058aa9ae8deb137ae8e904554
|
Provenance
The following attestation bundles were made for pedersenpy-0.1.1-cp39-abi3-macosx_11_0_arm64.whl:
Publisher:
release.yml on luksgrin/pedersen-py
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pedersenpy-0.1.1-cp39-abi3-macosx_11_0_arm64.whl -
Subject digest:
62d0149bb110b1f5b7d5e4df30f14fcdbbff0108b023e59ac014cc1bc27d5bac - Sigstore transparency entry: 2143274505
- Sigstore integration time:
-
Permalink:
luksgrin/pedersen-py@eea5fe7f19a1fb2a1c07664bdbf8b14abd61fd38 -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/luksgrin
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@eea5fe7f19a1fb2a1c07664bdbf8b14abd61fd38 -
Trigger Event:
push
-
Statement type:
File details
Details for the file pedersenpy-0.1.1-cp39-abi3-macosx_10_12_x86_64.whl.
File metadata
- Download URL: pedersenpy-0.1.1-cp39-abi3-macosx_10_12_x86_64.whl
- Upload date:
- Size: 346.9 kB
- Tags: CPython 3.9+, macOS 10.12+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6a66806c76e6d6238a5cb82bd4324e60ad8b8a751512122e3c396a69e0faf897
|
|
| MD5 |
d6a3a253a9358343076c30de1d1ae8e5
|
|
| BLAKE2b-256 |
b0fbd2a9cac5a3381432cf03ceee8bab6e9bc7eec8bb98030299a4e5a3ca60d8
|
Provenance
The following attestation bundles were made for pedersenpy-0.1.1-cp39-abi3-macosx_10_12_x86_64.whl:
Publisher:
release.yml on luksgrin/pedersen-py
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pedersenpy-0.1.1-cp39-abi3-macosx_10_12_x86_64.whl -
Subject digest:
6a66806c76e6d6238a5cb82bd4324e60ad8b8a751512122e3c396a69e0faf897 - Sigstore transparency entry: 2143274639
- Sigstore integration time:
-
Permalink:
luksgrin/pedersen-py@eea5fe7f19a1fb2a1c07664bdbf8b14abd61fd38 -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/luksgrin
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@eea5fe7f19a1fb2a1c07664bdbf8b14abd61fd38 -
Trigger Event:
push
-
Statement type: