PHPackages                             public-square/jwk-multibase-key-converter-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. [Utility &amp; Helpers](/categories/utility)
4. /
5. public-square/jwk-multibase-key-converter-php

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

public-square/jwk-multibase-key-converter-php
=============================================

Enables conversion of multibase strings to/from JWK, limited to secp256k1 and P-384. Additionally, has support for did:key method spec.

v0.1.1(3y ago)091MITPHPPHP &gt;=8.1

Since Nov 29Pushed 3y ago2 watchersCompare

[ Source](https://github.com/public-square/jwk-multibase-key-converter-php)[ Packagist](https://packagist.org/packages/public-square/jwk-multibase-key-converter-php)[ RSS](/packages/public-square-jwk-multibase-key-converter-php/feed)WikiDiscussions main Synced today

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

JWK Multibase Key Converter
===========================

[](#jwk-multibase-key-converter)

[![Latest Stable Version](https://camo.githubusercontent.com/5e3e4556ccc44fd76df1ffa2a968dd35c6c40f507fc23f845c117eb0cd7e1a63/68747470733a2f2f706f7365722e707567782e6f72672f7075626c69632d7371756172652f6a776b2d6d756c7469626173652d6b65792d636f6e7665727465722d7068702f762f737461626c652e706e67)](https://packagist.org/packages/public-square/jwk-multibase-key-converter-php)[![Total Downloads](https://camo.githubusercontent.com/90cf5780d2ae4ef279840bde35f4f29de80613eb0222abcd088bd428601b0afa/68747470733a2f2f706f7365722e707567782e6f72672f7075626c69632d7371756172652f6a776b2d6d756c7469626173652d6b65792d636f6e7665727465722d7068702f646f776e6c6f6164732e706e67)](https://packagist.org/packages/public-square/jwk-multibase-key-converter-php)[![Latest Unstable Version](https://camo.githubusercontent.com/a1bef415dfd4fc821fca1077aa5c853c20e0c20401ef0b5c6569abeecba7cde2/68747470733a2f2f706f7365722e707567782e6f72672f7075626c69632d7371756172652f6a776b2d6d756c7469626173652d6b65792d636f6e7665727465722d7068702f762f756e737461626c652e706e67)](https://packagist.org/packages/public-square/jwk-multibase-key-converter-php)[![License](https://camo.githubusercontent.com/00f1c4ae354bbeeec526c735f988bf904f8d2ebbeed1664db5f2760b055b43cc/68747470733a2f2f706f7365722e707567782e6f72672f7075626c69632d7371756172652f6a776b2d6d756c7469626173652d6b65792d636f6e7665727465722d7068702f6c6963656e73652e706e67)](https://packagist.org/packages/public-square/jwk-multibase-key-converter-php)

Information
-----------

[](#information)

This library is a tool to assist in the conversion of Multibase/Multicodec strings and **did:key** method spec keys to JWK, and vice versa. It utilizes Multibase/Multicodec, Simplito-EC, and JWT Framework to aid in these conversions.

For more information on the **did:key** spec, please read the current unofficial draft [here](https://w3c-ccg.github.io/did-method-key/).

Currently, this libary only supports the following curves:

- secp256k1
- nistp384

OpenSSL and Windows
-------------------

[](#openssl-and-windows)

In order for key generation to work on Windows machines, this [Installation](https://www.php.net/manual/en/openssl.installation.php) documentation must be done correctly, specifically regarding `openssl.cnf`.

How It Works
------------

[](#how-it-works)

- Public JWK Generation
    - [Generating a Public Key](docs/examples/jwk_generation.md)
- Multibase Conversion
    - [Converting a Multibase Key to a Public JWK](docs/examples/multibase_conversion.md)
- **did:key** Conversion
    - [Converting a did:key to a Public JWK](docs/examples/didkey_conversion.md)
- Public JWK Conversion
    - [Converting a Public JWK to a Multibase Key](docs/examples/jwk_to_mbase.md)
    - [Converting a Public JWK to a did:key](docs/examples/jwk_to_didkey.md)

Requirements
------------

[](#requirements)

- &gt;= PHP 8.1
- composer
- ext-gmp

Installation
------------

[](#installation)

You can install this library via Composer :

`composer require public-square/jwk-multibase-key-converter-php`

Contribute
----------

[](#contribute)

Please open a pull request.

License
-------

[](#license)

This software is release under [MIT license](LICENSE).

###  Health Score

22

—

LowBetter than 21% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity46

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

Total

2

Last Release

1194d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/f5e2817b784d96765432101f19007abf72dc9540c5fbf54bd780df1a7398ee58?d=identicon)[vpsqr](/maintainers/vpsqr)

---

Top Contributors

[![agccurtis](https://avatars.githubusercontent.com/u/5039714?v=4)](https://github.com/agccurtis "agccurtis (8 commits)")

---

Tags

JWKsecp256k1nistmultibasemulticodecpublic-squaredid keypsqrp-384secgsecp384r1

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StyleECS

Type Coverage Yes

### Embed Badge

![Health badge](/badges/public-square-jwk-multibase-key-converter-php/health.svg)

```
[![Health](https://phpackages.com/badges/public-square-jwk-multibase-key-converter-php/health.svg)](https://phpackages.com/packages/public-square-jwk-multibase-key-converter-php)
```

###  Alternatives

[web3p/ethereum-tx

Ethereum transaction library in PHP.

193379.0k25](/packages/web3p-ethereum-tx)[kornrunner/secp256k1

Pure PHP secp256k1

40609.0k117](/packages/kornrunner-secp256k1)[web3p/ethereum-util

A collection of utility functions for Ethereum written in PHP.

30467.4k26](/packages/web3p-ethereum-util)[swentel/nostr-php

Nostr helper library for PHP

6930.4k5](/packages/swentel-nostr-php)[digitaldonkey/ecverify

A library integrating Ethereum with typed PHP.

16121.7k2](/packages/digitaldonkey-ecverify)[minter/minter-php-bip-44

2312.7k11](/packages/minter-minter-php-bip-44)

PHPackages © 2026

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