PHPackages                             sandermuller/solana-pubkey - 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. sandermuller/solana-pubkey

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

sandermuller/solana-pubkey
==========================

Tiny, framework-agnostic PHP library for Solana public keys and Ed25519 signature verification.

v0.1.1(4w ago)1192[1 PRs](https://github.com/SanderMuller/solana-pubkey/pulls)1MITPHPPHP ^8.3CI passing

Since May 11Pushed 1w agoCompare

[ Source](https://github.com/SanderMuller/solana-pubkey)[ Packagist](https://packagist.org/packages/sandermuller/solana-pubkey)[ RSS](/packages/sandermuller-solana-pubkey/feed)WikiDiscussions main Synced 1w ago

READMEChangelog (2)Dependencies (16)Versions (3)Used By (1)

solana-pubkey
=============

[](#solana-pubkey)

[![Latest Version on Packagist](https://camo.githubusercontent.com/f5279ce5d452532753a5da5ee64d502d67f6e2d55a19ee33d72ff2702d2f41ad/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f73616e6465726d756c6c65722f736f6c616e612d7075626b65792e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/sandermuller/solana-pubkey)[![run-tests](https://github.com/sandermuller/solana-pubkey/actions/workflows/run-tests.yml/badge.svg)](https://github.com/sandermuller/solana-pubkey/actions/workflows/run-tests.yml)[![PHPStan](https://github.com/sandermuller/solana-pubkey/actions/workflows/phpstan.yml/badge.svg)](https://github.com/sandermuller/solana-pubkey/actions/workflows/phpstan.yml)[![Total Downloads](https://camo.githubusercontent.com/31c1bd6c0681c6f739ed349f29b22ba1d039a36490a398bf7927fa9562657934/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f73616e6465726d756c6c65722f736f6c616e612d7075626b65792e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/sandermuller/solana-pubkey)[![License](https://camo.githubusercontent.com/c7ee42856cc14b029bbca0927064665bd7b45c1f85416f13c623cdbf1e7864ba/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f73616e6465726d756c6c65722f736f6c616e612d7075626b65792e7376673f7374796c653d666c61742d737175617265)](LICENSE)

Tiny, framework-agnostic PHP library for Solana public keys and Ed25519 signature verification.

Built for [Sign-In With Solana](https://github.com/phantom/sign-in-with-solana) flows where you need to validate a wallet address and verify a detached signature — without pulling in a full Solana SDK.

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

[](#installation)

```
composer require sandermuller/solana-pubkey
```

Requires PHP **8.3+** and **ext-sodium**. No other runtime dependencies.

Usage
-----

[](#usage)

### Verify a Solana wallet signature

[](#verify-a-solana-wallet-signature)

```
use SanderMuller\SolanaPubkey\Base58;
use SanderMuller\SolanaPubkey\PublicKey;

$pubkey    = PublicKey::from($walletAddressBase58);
$signature = Base58::decode($signatureBase58);

if ($pubkey->verify($message, $signature)) {
    // signature is valid for $message under $pubkey
}
```

### Construct from raw bytes

[](#construct-from-raw-bytes)

```
use SanderMuller\SolanaPubkey\PublicKey;

$keypair = sodium_crypto_sign_keypair();
$pubkey  = PublicKey::fromBytes(sodium_crypto_sign_publickey($keypair));

echo $pubkey->toBase58();
```

### Base58 encoding

[](#base58-encoding)

```
use SanderMuller\SolanaPubkey\Base58;

$encoded = Base58::encode($binary);   // throws nothing
$decoded = Base58::decode($base58);   // throws InvalidBase58Exception on bad input
```

API surface
-----------

[](#api-surface)

See [PUBLIC\_API.md](PUBLIC_API.md) for the SemVer-governed surface. Anything not listed there is `@internal` and may change in any release.

Exceptions
----------

[](#exceptions)

All thrown exceptions extend `SanderMuller\SolanaPubkey\Exceptions\SolanaPubkeyException` (which extends `RuntimeException`):

ExceptionThrown by`InvalidPublicKeyException``PublicKey::from()`, `PublicKey::fromBytes()` — wrong length or invalid base58`InvalidBase58Exception``Base58::decode()` — non-alphabet character`InvalidSignatureException``PublicKey::verify()` — signature is not exactly 64 bytes`PublicKey::verify()` returns `false` (does not throw) for wrong-but-well-formed signatures and tampered messages.

Why this exists
---------------

[](#why-this-exists)

The [`collectiq/solana-php-sdk`](https://github.com/collectiq/solana-php-sdk) is a full Solana SDK (RPC, transactions, Borsh, programs, DID). For SIWS-style auth flows, you only need three primitives: base58 codec, Ed25519 verify, and pubkey validation. This package ships exactly those, with no framework dependencies and no proprietary-license upstream.

Development
-----------

[](#development)

```
composer install
composer test      # Pest
composer qa        # Rector + Pint + PHPStan + lean-package-validator + tests
```

License
-------

[](#license)

MIT — see [LICENSE](LICENSE).

###  Health Score

42

—

FairBetter than 88% of packages

Maintenance97

Actively maintained with recent releases

Popularity17

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity39

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

Total

2

Last Release

29d ago

### Community

Maintainers

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

---

Top Contributors

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

---

Tags

signatureEd25519base58solanasiwspubkey

###  Code Quality

TestsPest

Static AnalysisPHPStan, Rector

Code StyleLaravel Pint

Type Coverage Yes

### Embed Badge

![Health badge](/badges/sandermuller-solana-pubkey/health.svg)

```
[![Health](https://phpackages.com/badges/sandermuller-solana-pubkey/health.svg)](https://phpackages.com/packages/sandermuller-solana-pubkey)
```

###  Alternatives

[brinley/jsignature

Signature For Javascript

70032.1k1](/packages/brinley-jsignature)[tuupola/base58

Base58 encoder and decoder for arbitrary data

56651.7k24](/packages/tuupola-base58)[sop/crypto-types

A PHP library of various ASN.1 types for cryptographic applications.

121.4M34](/packages/sop-crypto-types)[xobotyi/basen

Text and integers encoding utilities for PHP with no extensions dependencies. Base32, Base58, Base64 and much more!

1220.1k](/packages/xobotyi-basen)[falseclock/advanced-cms

A PHP Library that allows you to decode and manipulate CAdES or in other words CMS Advanced Electronic Signatures described in ETSI standart TS 101 733.

223.4k](/packages/falseclock-advanced-cms)

PHPackages © 2026

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