PHPackages                             nicolasflamel/secp256k1-zkp - 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. nicolasflamel/secp256k1-zkp

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

nicolasflamel/secp256k1-zkp
===========================

PHP library for parts of libsecp256k1-zkp

v0.1.2(2y ago)18MITPHPPHP &gt;=8.0.0

Since Mar 8Pushed 2y ago1 watchersCompare

[ Source](https://github.com/NicolasFlamel1/Secp256k1-zkp-PHP-Library)[ Packagist](https://packagist.org/packages/nicolasflamel/secp256k1-zkp)[ RSS](/packages/nicolasflamel-secp256k1-zkp/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (3)DependenciesVersions (4)Used By (0)

Secp256k1-zkp PHP Library
=========================

[](#secp256k1-zkp-php-library)

### Description

[](#description)

PHP library for parts of [libsecp256k1-zkp](https://github.com/mimblewimble/secp256k1-zkp).

### Installing

[](#installing)

Run the following command from the root of your project to install this library and configure your project to use it.

```
composer require nicolasflamel/secp256k1-zkp

```

### Usage

[](#usage)

After an `Secp256k1Zkp` object has been created, it can be used to perform all the secp256k1-zkp functions that this library implements.

The following code briefly shows how to use this library. A more complete example is available [here](https://github.com/NicolasFlamel1/Secp256k1-zkp-PHP-Library/tree/master/example).

```

```

### Functions

[](#functions)

1. Secp256k1-zkp constructor: `constructor(): Secp256k1Zkp`

    This constructor is used to create a `Secp256k1Zkp` object and it returns the following value:

    - `Secp256k1Zkp`: An `Secp256k1Zkp` object.
2. Secp256k1-zkp is valid private key method: `isValidPrivateKey(string $privateKey): bool`

    This method is used to check if a provided private key is valid and it accepts the following parameters:

    - `string $privateKey`: The private key to validate.

    This method returns the following values:

    - `bool`: `TRUE` if the private key is valid or `FALSE` if it is not.
3. Secp256k1-zkp get public key method: `getPublicKey(string $privateKey): string | FALSE`

    This method is used to get a provided private key's public key and it accepts the following parameters:

    - `string $privateKey`: The private key to get the public key for.

    This method returns the following values:

    - `string`: The private key's public key.
    - `FALSE`: Getting the public key failed.
4. Secp256k1-zkp add private keys method: `addPrivateKeys(string &$firstPrivateKey, string $secondPrivateKey): bool`

    This method is used to add two private keys and it accepts the following parameters:

    - `string &$firstPrivateKey`: The private key to add the second private key to. This variable will contain the sum of the private keys if the function returned `TRUE`.
    - `string $secondPrivateKey`: The private key to add to the first private key.

    This method returns the following values:

    - `bool`: `TRUE` if adding private keys was successful or `FALSE` if it failed.
5. Secp256k1-zkp get blinding factor method: `getBlindingFactor(string $blind, string $value): string | FALSE`

    This method is used to get the blinding factor from a provided blind and value and it accepts the following parameters:

    - `string $blind`: The blind to use.
    - `string $value`: The value to use. This must be a non-negative integer.

    This method returns the following values:

    - `string`: The blinding factor for the provided blind and value.
    - `FALSE`: Getting the blinding factor failed.
6. Secp256k1-zkp get commitment method: `getCommitment(string $blindingFactor, string $value): string | FALSE`

    This method is used to get the commitment for a provided value using a provided blinding factor and it accepts the following parameters:

    - `string $blindingFactor`: The blinding factor to use.
    - `string $value`: The value to commit. This must be a non-negative integer.

    This method returns the following values:

    - `string`: The commitment for the provided value using the provided blinding factor.
    - `FALSE`: Getting the commitment failed.
7. Secp256k1-zkp get Bulletproof method: `getBulletproof(string $blindingFactor, string $value, string $rewindNonce, string $privateNonce, string $message): string | FALSE`

    This method is used to get Bulletproof for a provided value committed with a provided blinding factor using a provided rewind nonce, private nonce, and message and it accepts the following parameters:

    - `string $blindingFactor`: The blinding factor use to commit the value.
    - `string $value`: The value committed to. This must be a non-negative integer.
    - `string $rewindNonce`: The rewind nonce to use.
    - `string $privateNonce`: The private nonce to use.
    - `string $message`: The message to use.

    This method returns the following values:

    - `string`: The Bulletproof for the provided value committed with the provided blinding factor using the provided rewind nonce, private nonce, and message.
    - `FALSE`: Getting the Bulletproof failed.
8. Secp256k1-zkp get private nonce method: `getPrivateNonce(): string | FALSE`

    This method is used to get a random private nonce that can be used when creating a partial single-signer signature and it returns the following values:

    - `string`: A private nonce.
    - `FALSE`: Getting a private nonce failed.
9. Secp256k1-zkp combine public keys method: `combinePublicKeys(array $publicKeys): string | FALSE`

    This method is used to get the combined public key for provided public keys and it accepts the following parameters:

    - `array $publicKeys`: The public keys to combine.

    This method returns the following values:

    - `string`: The combined public key.
    - `FALSE`: Combing public keys failed.
10. Secp256k1-zkp get partial single-signer signature method: `getPartialSingleSignerSignature(string $privateKey, string $message, string $privateNonce, string $publicKey, string $publicNonce): string | FALSE`

    This method is used to get the partial single-signer signature for a provided message signed with a provided private key using a provided private nonce, public key, and public nonce and it accepts the following parameters:

    - `string $privateKey`: The private key to use.
    - `string $message`: The message to sign.
    - `string $privateNonce`: The private nonce to use.
    - `string $publicKey`: The public key to use.
    - `string $publicNonce`: The public nonce to use.

    This method returns the following values:

    - `string`: The partial single-signer signature for the provided message signed with the provided private key using the provided private nonce, public key, and public nonce.
    - `FALSE`: Getting the partial single-signer signature failed.
11. Secp256k1-zkp public key to commitment method: `publicKeyToCommitment(string $publicKey): string | FALSE`

    This method is used to convert a provided public key to a commitment and it accepts the following parameters:

    - `string $publicKey`: The public key to convert to a commitment.

    This method returns the following values:

    - `string`: The commitment.
    - `FALSE`: Converting the public key failed.

###  Health Score

19

—

LowBetter than 10% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity38

Early-stage or recently created project

 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 ~1 days

Total

3

Last Release

794d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/30e451b8b48ad310dcd6a8245ff30bfa9a79c7170fe581fc9a428cea9d8cf70a?d=identicon)[nicolasflamel](/maintainers/nicolasflamel)

---

Top Contributors

[![NicolasFlamel1](https://avatars.githubusercontent.com/u/85004915?v=4)](https://github.com/NicolasFlamel1 "NicolasFlamel1 (7 commits)")

---

Tags

secp256k1-zkp

### Embed Badge

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

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

PHPackages © 2026

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