PHPackages                             bitwasp/secp256k1-php - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Security](/categories/security)
4. /
5. bitwasp/secp256k1-php

ActiveLibrary[Security](/categories/security)

bitwasp/secp256k1-php
=====================

PHP Extension with bindings for bitcoin/secp256k1.

v0.2.2(7y ago)58190.4k↑43.3%38[10 issues](https://github.com/Bit-Wasp/secp256k1-php/issues)[6 PRs](https://github.com/Bit-Wasp/secp256k1-php/pulls)20UnlicensePHPPHP ^7.0

Since May 9Pushed 4y ago6 watchersCompare

[ Source](https://github.com/Bit-Wasp/secp256k1-php)[ Packagist](https://packagist.org/packages/bitwasp/secp256k1-php)[ RSS](/packages/bitwasp-secp256k1-php/feed)WikiDiscussions v0.2 Synced 3d ago

READMEChangelogDependenciesVersions (24)Used By (20)

secp256k1-php
=============

[](#secp256k1-php)

[![Build Status](https://camo.githubusercontent.com/ea0cb507b248f3e2259b4756119fbf8744f68bb0729033d6d9881be07302aa4c/68747470733a2f2f7472617669732d63692e6f72672f4269742d576173702f736563703235366b312d7068702e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/Bit-Wasp/secp256k1-php)[![codecov](https://camo.githubusercontent.com/c2517ff1e56d3409ef01fcab02523754161b5f1d442e9318c52f0124e444c96d/68747470733a2f2f636f6465636f762e696f2f67682f4269742d576173702f736563703235366b312d7068702f6272616e63682f6d61737465722f67726170682f62616467652e737667)](https://codecov.io/gh/Bit-Wasp/secp256k1-php)

PHP bindings for

Please note that the upstream library, [libsecp256k1](https://github.com/bitcoin-core/secp256k1) is still considered experimental by it's authors, and has not yet been formally released. For this reason, it's use should be discouraged. For consensus systems this warning is critical.

The library supports the EcDH, and signature recovery modules - these libraries are required for installation.

### Requirements

[](#requirements)

PHP 5.\* versions are supported in the v0.0.x release. PHP 7 is supported in the v0.1.x series.

### About the extension

[](#about-the-extension)

- Fully unit tested, with &gt;99 code coverage since the v0.1.3 release.
- This extension only supports deterministic signatures at present. In fact, no RNG is utilized in this extension - private keys must be generated elsewhere.
- The extension exposes the same raw API of libsecp256k1. As such, you must ensure you are passing the binary representations of each value.
- In keeping with libsecp256k1, this extension returns certain data to the user by writing to a variable reference, and returning a code indicating the failure/success.

### To Install:

[](#to-install)

libsecp256k1:

```
    git clone git@github.com:bitcoin-core/secp256k1 && \
    cd secp256k1 &&                                    \
    ./autogen.sh &&                                    \
    ./configure --enable-experimental --enable-module-{ecdh,recovery} && \
     make &&                                           \
     sudo make install &&                              \
     cd ../

```

secp256k1-php:

```
    git clone git@github.com:Bit-Wasp/secp256k1-php && \
    cd secp256k1-php/secp256k1 &&                      \
    phpize &&                                          \
    ./configure --with-secp256k1 &&                    \
    make && sudo make install &&                       \
    cd ../../

```

### Examples

[](#examples)

See [the examples folder](./examples), or [the \*\_basic.phpt files in the test suite](./secp256k1/tests)

### (Optional) - Enable extension by default!

[](#optional---enable-extension-by-default)

If you're a heavy user, you can add this line to your php.ini files for php-cli, apache2, or php-fpm.

> /etc/php/7.0/cli/conf.d/20-secp256k1.ini -&gt; /etc/php/7.0/mods-available/secp256k1.ini

```
extension=secp256k1.so

```

### Run Tests

[](#run-tests)

(Commands issued from secp256k1-php directory)

Basic tests:

```
cd secp256k1-php/secp256k1 && make test

```

###  Health Score

41

—

FairBetter than 87% of packages

Maintenance17

Infrequent updates — may be unmaintained

Popularity48

Moderate usage in the ecosystem

Community33

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 86.5% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~71 days

Recently: every ~102 days

Total

23

Last Release

2504d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/763cdc5cc50414bacd4ff1080eede79432f7c3cc26a3d8aa9031b1537a8bd734?d=identicon)[thomaskerin](/maintainers/thomaskerin)

---

Top Contributors

[![afk11](https://avatars.githubusercontent.com/u/5617245?v=4)](https://github.com/afk11 "afk11 (180 commits)")[![rubensayshi](https://avatars.githubusercontent.com/u/649160?v=4)](https://github.com/rubensayshi "rubensayshi (24 commits)")[![deweller](https://avatars.githubusercontent.com/u/51414?v=4)](https://github.com/deweller "deweller (2 commits)")[![Bablakeluke](https://avatars.githubusercontent.com/u/2579753?v=4)](https://github.com/Bablakeluke "Bablakeluke (1 commits)")[![vamenard](https://avatars.githubusercontent.com/u/443162?v=4)](https://github.com/vamenard "vamenard (1 commits)")

---

Tags

ext-secp256k1php-bindingsphp-extensionsecp256k1phpextensionbitcoincryptocurrencyECDSAeccsecp256k1bitwasp

### Embed Badge

![Health badge](/badges/bitwasp-secp256k1-php/health.svg)

```
[![Health](https://phpackages.com/badges/bitwasp-secp256k1-php/health.svg)](https://phpackages.com/packages/bitwasp-secp256k1-php)
```

###  Alternatives

[simplito/elliptic-php

Fast elliptic curve cryptography

2302.4M272](/packages/simplito-elliptic-php)[ionux/phactor

Phactor is a high-performance PHP implementation of the elliptic curve math functions required to generate &amp; verify private/public (asymmetric) EC keypairs and ECDSA signatures based on secp256k1 curve parameters. This library also includes a class to generate Service Identification Numbers (SINs) based on the published Identity Protocol v1 spec.

5287.3k30](/packages/ionux-phactor)[bitwasp/bitcoin-lib

Implementation of raw transactions in bitcoin, HD wallets, Electrum wallets, and other fun stuff.

13922.5k5](/packages/bitwasp-bitcoin-lib)[paragonie/ecc

PHP Elliptic Curve Cryptography library

24820.0k38](/packages/paragonie-ecc)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
