coincurve
Safest and fastest Python library for secp256k1 elliptic curve operations
What it is and what it does
coincurve wraps libsecp256k1, the heavily optimized C library used by Bitcoin Core, to provide Python developers with fast, production-grade elliptic curve operations on the secp256k1 curve. It handles ECDSA signing and verification, ECDH key exchange, and Schnorr signatures—the cryptographic primitives underlying blockchain systems.
The package is used by major projects including Ethereum, LBRY, and libp2p. It supports Python 3.9 through 3.13 and both CPython and PyPy implementations. Installation is straightforward on common platforms thanks to prebuilt wheels; on less common architectures, you may need a C compiler and libsecp256k1 development headers.
Use it for:
- Sign and verify transactions in Bitcoin or Ethereum applications without implementing elliptic curve math yourself.
- Perform ECDH key exchange for establishing shared secrets in peer-to-peer or blockchain protocols.
- Generate and manage secp256k1 keypairs for cryptocurrency wallets or signing services.
- Implement Schnorr signatures for protocols that require this signature scheme.
- Integrate cryptographic operations into applications that depend on libsecp256k1 semantics.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
coincurve provides Python bindings to libsecp256k1, enabling fast elliptic curve cryptography operations on the secp256k1 curve used by Bitcoin and Ethereum.
Yes. coincurve is production-stable, actively maintained, widely adopted in blockchain infrastructure, has no known vulnerabilities, and offers fast Python bindings to secp256k1. Install it if you need secp256k1 operations; the medium install friction is justified by the performance and correctness guarantees of the underlying C library.
Install
coincurve on PyPI
pip
pip install coincurveuv
uv add coincurvepoetry
poetry add coincurveInstalling coincurve
Before you install
Medium install friction due to compiled C bindings; prebuilt wheels are available for Python 3.9–3.13 across macOS, Linux, and Windows architectures, reducing build overhead on common platforms.
License in practice
Dual-licensed under MIT or Apache-2.0, both permissive licenses; you may choose either license when using or redistributing the package.
Quickstart
pip install coincurve
from coincurve import PrivateKey
private_key = PrivateKey()
public_key = private_key.public_key
signature = private_key.sign(b'message')
Requires Python 3.9 or later; on platforms without prebuilt wheels, a C compiler and libsecp256k1 development headers are needed.
Verify before relying
- Whether the package supports key derivation (BIP32/BIP44) or only basic signing and verification operations.
- Performance characteristics compared to pure-Python elliptic curve libraries for typical workloads.
- Full API surface for ECDH, Schnorr signatures, and other operations beyond basic signing.
Package facts
| License | MIT OR Apache-2.0 (permissive) |
| Python support | supports the current Python release (>=3.9) |
| Install friction | medium — platform-specific wheel |
| Runtime dependencies | none |
| Maintenance | actively maintained — 524 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 3,254,947/month — #2,683 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: coincurve-21.0.0-cp310-cp310-macosx_10_9_x86_64.whl; coincurve-21.0.0-cp310-cp310-macosx_11_0_arm64.whl; coincurve-21.0.0-cp310-cp310-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl; coincurve-21.0.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl; coincurve-21.0.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl; coincurve-21.0.0-cp310-cp310-musllinux_1_2_aarch64.whl; coincurve-21.0.0-cp310-cp310-musllinux_1_2_i686.whl; coincurve-21.0.0-cp310-cp310-musllinux_1_2_x86_64.whl; coincurve-21.0.0-cp310-cp310-win_amd64.whl; coincurve-21.0.0-cp310-cp310-win_arm64.whl; coincurve-21.0.0-cp311-cp311-macosx_10_9_x86_64.whl; coincurve-21.0.0-cp311-cp311-macosx_11_0_arm64.whl; coincurve-21.0.0-cp311-cp311-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl; coincurve-21.0.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl; coincurve-21.0.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl; coincurve-21.0.0-cp311-cp311-musllinux_1_2_aarch64.whl; coincurve-21.0.0-cp311-cp311-musllinux_1_2_i686.whl; coincurve-21.0.0-cp311-cp311-musllinux_1_2_x86_64.whl; coincurve-21.0.0-cp311-cp311-win_amd64.whl; coincurve-21.0.0-cp311-cp311-win_arm64.whl
Keywords: bitcoin, crypto, cryptocurrency, ecdh, ecdsa, elliptic curves, ethereum, libsecp256k1, schnorr, secp256k1
Tags
More Libraries packages
urllib3 is an HTTP client library that provides…
permissive · top 100 on PyPI
requestsRequests is a Python HTTP library that…
permissive · top 100 on PyPI
pluggyPluggy provides a plugin system that lets you…
permissive · top 100 on PyPI
python-dateutilProvides parsing, arithmetic, and recurrence…
permissive · top 100 on PyPI
sixSix provides utility functions to write Python…
permissive · top 100 on PyPI
pytestpytest is a testing framework that lets you…
permissive · top 100 on PyPI
py-eccImplements elliptic curve cryptography…
permissive · top 5,000 on PyPI
ecdsaPure-Python implementation of ECDSA, EdDSA, and…
permissive · top 1,000 on PyPI
sslcryptoProvides AES, ECIES, and ECDSA cryptographic…
unclear · top 15,000 on PyPI
fastecdsaProvides fast elliptic curve digital signature…
permissive · top 15,000 on PyPI
eth-keysProvides a unified API for Ethereum key…
permissive · top 5,000 on PyPI
crypto-cpp-pyProvides hashing and signing operations for…
unclear · top 15,000 on PyPI
ckzgProvides Python bindings to C-KZG-4844, a…
permissive · top 5,000 on PyPI
ECPyECPy is a pure Python elliptic curve library…
permissive · top 15,000 on PyPI
eciespyEncrypts and decrypts data using Elliptic Curve…
permissive · top 15,000 on PyPI
slip10Implements SLIP-0010 hierarchical deterministic…
permissive · top 15,000 on PyPI