skillfed

py_arkworks_bls12381

Python bindings for BLS12-381 curve operations using arkworks

py-arkworks-bls12381 v0.5.0 85.8K downloads/30d#13,896 on PyPI10
Permissive license MIT OR Apache-2.0 Active released

What it is and what it does

py_arkworks_bls12381 wraps the Rust arkworks algebra library to provide Python access to BLS12-381 elliptic curve operations. It exposes G1 and G2 point types with arithmetic (addition, subtraction, scalar multiplication), identity and generator elements, subgroup checks, and multi-scalar multiplication. The library also supports point serialization in compressed and uncompressed formats with both big-endian and little-endian byte order variants, plus unchecked variants that skip subgroup validation for trusted inputs.

The package includes pairing operations—both single and multi-pairing with optimized final exponentiation—and pairing checks for cryptographic proofs. It provides map-to-curve functions for hashing to G1 and G2 using SWU mapping with cofactor clearing. Scalar types support arithmetic, division, exponentiation, and inversion. The primary use case is generating test vectors for EIP4844 in Ethereum consensus-specs, though the generic design supports other BLS12-381 applications.

Use it for:

  • Generate EIP4844 test vectors for Ethereum consensus layer specifications.
  • Implement BLS signature schemes or threshold cryptography in Python applications.
  • Perform elliptic curve pairing checks and bilinear map operations for zero-knowledge proofs.
  • Serialize and deserialize BLS12-381 curve points in cryptographic protocols.
  • Hash arbitrary data to elliptic curve points using map-to-curve functions.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Python bindings for BLS12-381 elliptic curve cryptography operations, enabling G1/G2 point arithmetic, pairing, serialization, and scalar operations via Rust's arkworks library.

Yes, if you need BLS12-381 operations in Python and are targeting Python 3.11+. The package is actively maintained, has no known vulnerabilities, and offers comprehensive curve operations with good platform coverage via prebuilt wheels. Install friction is moderate but manageable; the dual MIT/Apache-2.0 license is permissive. Verify suitability for your specific cryptographic use case beyond EIP4844 test generation.

Install

py-arkworks-bls12381 on PyPI

pip

pip install py-arkworks-bls12381

uv

uv add py-arkworks-bls12381

poetry

poetry add py-arkworks-bls12381

Installing py_arkworks_bls12381

Before you install

Medium install friction due to compiled Rust bindings; prebuilt wheels cover Python 3.11–3.14 across Linux, macOS, and Windows architectures. Repository is active with recent commits and no known vulnerabilities.

License in practice

Dual-licensed under MIT OR Apache-2.0, both permissive; you may choose either license when using or distributing this package.

Quickstart

pip install py_arkworks_bls12381

from py_arkworks_bls12381 import G1Point, G2Point, Scalar

gen = G1Point()
scalar = Scalar(4)
result = gen * scalar

Requires Python >= 3.11; compiled wheels available for common platforms but may require a Rust toolchain if building from source.

Verify before relying

  • Performance characteristics and benchmarks for pairing and multi-scalar multiplication operations.
  • Stability guarantees and API compatibility policy across minor versions.
  • Whether the library is suitable for production cryptographic use beyond EIP4844 test vectors.

Package facts

License MIT OR Apache-2.0 (permissive)
Python support supports the current Python release (>=3.11)
Install friction medium — platform-specific wheel
Runtime dependencies none
Maintenance actively maintained — 52 days since the last release
Last repo commit
First released
Downloads 85,839/month — #13,896 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: py_arkworks_bls12381-0.5.0-cp311-cp311-macosx_10_12_x86_64.whl; py_arkworks_bls12381-0.5.0-cp311-cp311-macosx_11_0_arm64.whl; py_arkworks_bls12381-0.5.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl; py_arkworks_bls12381-0.5.0-cp311-cp311-manylinux_2_17_armv7l.manylinux2014_armv7l.whl; py_arkworks_bls12381-0.5.0-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl; py_arkworks_bls12381-0.5.0-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl; py_arkworks_bls12381-0.5.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl; py_arkworks_bls12381-0.5.0-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.whl; py_arkworks_bls12381-0.5.0-cp311-cp311-musllinux_1_2_aarch64.whl; py_arkworks_bls12381-0.5.0-cp311-cp311-musllinux_1_2_armv7l.whl; py_arkworks_bls12381-0.5.0-cp311-cp311-musllinux_1_2_i686.whl; py_arkworks_bls12381-0.5.0-cp311-cp311-musllinux_1_2_x86_64.whl; py_arkworks_bls12381-0.5.0-cp311-cp311-win32.whl; py_arkworks_bls12381-0.5.0-cp311-cp311-win_amd64.whl; py_arkworks_bls12381-0.5.0-cp311-cp311-win_arm64.whl; py_arkworks_bls12381-0.5.0-cp312-cp312-macosx_10_12_x86_64.whl; py_arkworks_bls12381-0.5.0-cp312-cp312-macosx_11_0_arm64.whl; py_arkworks_bls12381-0.5.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl; py_arkworks_bls12381-0.5.0-cp312-cp312-manylinux_2_17_armv7l.manylinux2014_armv7l.whl; py_arkworks_bls12381-0.5.0-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl

Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Programming Language :: Python :: Implementation :: CPythonProgramming Language :: Rust

Tags

bls12-381 python bindingselliptic curve cryptographypairing operationseip4844 test vectorsg1 g2 point arithmeticcryptographic curve operationsarkworks rust bindings
elliptic-curvesbls12-381cryptography

More Cryptography packages