skillfed

coincurve

Safest and fastest Python library for secp256k1 elliptic curve operations

coincurve v21.0.0 3.3M downloads/30d#2,683 on PyPI181
Permissive license MIT OR Apache-2.0 Active released

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 coincurve

uv

uv add coincurve

poetry

poetry add coincurve

Installing 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

Development Status :: 5 - Production/StableIntended Audience :: DevelopersLicense :: OSI Approved :: Apache Software LicenseLicense :: OSI Approved :: MIT LicenseNatural Language :: EnglishOperating System :: OS IndependentProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.9Programming Language :: Python :: Implementation :: CPythonProgramming Language :: Python :: Implementation :: PyPyTopic :: Security :: CryptographyTopic :: Software Development :: Libraries

Tags

secp256k1 python bindingselliptic curve cryptography librarybitcoin ethereum signingecdsa ecdh operationslibsecp256k1 wrapper
elliptic-curveblockchaincryptography

More Libraries packages