PHPackages                             web3p/secp256k1 - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. web3p/secp256k1

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

web3p/secp256k1
===============

Ethereum secp256k1 library in PHP.

v0.2(8y ago)63715[1 issues](https://github.com/web3p/secp256k1/issues)[1 PRs](https://github.com/web3p/secp256k1/pulls)MITPHP

Since Feb 16Pushed 8y ago1 watchersCompare

[ Source](https://github.com/web3p/secp256k1)[ Packagist](https://packagist.org/packages/web3p/secp256k1)[ RSS](/packages/web3p-secp256k1/feed)WikiDiscussions master Synced today

READMEChangelog (3)Dependencies (2)Versions (4)Used By (0)

secp256k1
=========

[](#secp256k1)

secp256k1 for ethereum, this package depends on mdanter/ecc package.

[![Build Status](https://camo.githubusercontent.com/db63dac847f4266f871e0aac78233a2e89408d3db0da411852a7923226fbe8c2/68747470733a2f2f7472617669732d63692e6f72672f77656233702f736563703235366b312e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/web3p/secp256k1)[![codecov](https://camo.githubusercontent.com/60e68efe010b6d53fdfb340cffd419982efe6fe830a9e5e0baf251b8bd85ab62/68747470733a2f2f636f6465636f762e696f2f67682f77656233702f736563703235366b312f6272616e63682f6d61737465722f67726170682f62616467652e737667)](https://codecov.io/gh/web3p/secp256k1)[![Licensed under the MIT License](https://camo.githubusercontent.com/08cef40a9105b6526ca22088bc514fbfdbc9aac1ddbf8d4e6c750e3a88a44dca/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d4d49542d626c75652e737667)](https://github.com/web3p/secp256k1/blob/master/LICENSE)

Install
=======

[](#install)

Set minimum stability to dev

```
composer require web3p/secp256k1

```

Usage
=====

[](#usage)

Sign a message:

```
use Web3p\Secp256k1\Secp256k1;
use Web3p\Secp256k1\Serializer\HexSignatureSerializer;

$secp256k1 = new Secp256k1();

// return signature contains r and s.
// message and privateKey are hex string
$signature = $secp256k1->sign($message, $privateKey);

// get r
$r = $signature->getR();

// get s
$s = $signature->getS();

// encode to hex
$serializer = new HexSignatureSerializer();
$signatureString = $serializer->serialize($signature);

// or you can call toHex
$signatureString = $signature->toHex();
```

Verify a message:

```
use Web3p\Secp256k1\Secp256k1;

$secp256k1 = new Secp256k1();

// signature was created from sign method.
// hash and publicKey are hex string
$isVerified = $secp256k1->verify($hash, $signature, $publicKey);
```

API
===

[](#api)

Todo.

License
=======

[](#license)

MIT

###  Health Score

29

—

LowBetter than 57% of packages

Maintenance17

Infrequent updates — may be unmaintained

Popularity23

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity55

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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 ~16 days

Total

3

Last Release

3024d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/10494397?v=4)[Peter Lai](/maintainers/sc0Vu)[@sc0Vu](https://github.com/sc0Vu)

---

Top Contributors

[![sc0Vu](https://avatars.githubusercontent.com/u/10494397?v=4)](https://github.com/sc0Vu "sc0Vu (17 commits)")

---

Tags

ethereumsecp256k1

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[bitwasp/bitcoin-lib

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

13922.4k5](/packages/bitwasp-bitcoin-lib)

PHPackages © 2026

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