Python FFI (Foreign Function Interface) bindings to libsecp256k1, the optimized C library used by Bitcoin for elliptic curve cryptography. Version 0.14.0 wraps libsecp256k1 with secure memory handling (by default) and provides low-level primitives for EC operations, signing, verification, and public key recovery. Release cadence is irregular; maintained by the same author for over a decade.
pip install secp256k1No compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Creates a PrivateKey, signs a message, then verifies using the public key.
Read the 'About memory safety' section in the README; prefer keys generated via `PrivateKey.random()`.
Use `private_key.serialize()` (z) and `private_key.deserialize()` (z).
Replace `All()` with `secp256k1.FLAG_SIGN | secp256k1.FLAG_VERIFY`.
Use `secp256k1.FLAG_SIGN | secp256k1.FLAG_VERIFY`.
Install libsecp256k1 via your system package manager (e.g., `apt install libsecp256k1-0`) or build from source with `pip install --no-binary :all: secp256k1` to compile statically.
Ensure the private key is a 32-byte value less than the secp256k1 curve order (0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141). Use `secp256k1.PrivateKey(random_bytes)` where random_bytes is 32 cryptographically random bytes.
No dependency data recorded yet.