PHPackages                             eike-grundke/xpub - 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. eike-grundke/xpub

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

eike-grundke/xpub
=================

Derivation of extended public keys, for BTC and ETH network

01PHP

Since Jan 28Pushed 3y ago1 watchersCompare

[ Source](https://github.com/eike-grundke/xpub)[ Packagist](https://packagist.org/packages/eike-grundke/xpub)[ RSS](/packages/eike-grundke-xpub/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependenciesVersions (1)Used By (0)

eike-grundke/xpub
=================

[](#eike-grundkexpub)

With this library extended public keys of BTC or ETH network can be derived for any index

`xpub`, `tpub`, `vpub` and `zpub` supported

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

[](#installation)

```
composer require eike-grundke/xpub
```

### Requirements

[](#requirements)

- PHP &gt;= 8.1
- BCMath or GMP extension

Usage
-----

[](#usage)

```
use Grundke\ExtendedPublicKey;
use Grundke\Enum\CoinEnum;
use Grundke\Enum\BipEnum;

$xPub = ExtendedPublicKey::fromString('xpub...' ; // bip44
$xPub = ExtendedPublicKey::fromString('zpub...'); // bip84 (native SegWit)

// explicit bip
$xPub = ExtendedPublicKey::fromString('xpub...', BipEnum::BIP84);
$xPub = ExtendedPublicKey::fromString('zpub...', BipEnum::BIP44);

$xPubFromIndex = $xPub->derive($i);
$xPubFromIndices = $xpub->derive([$i1, $i2]);

// to base58 string
$xPubString = $xPubFromIndex->toString();
// to hex string
$xPubHex = $xPubFromIndex->toString(true);
// to address
$address = $xPubFromIndex->toAddress(CoinEnum::BTC);

# static functions

# hash160
$hash = ExtendedPublicKey::hash160($hex);
# double sha256
$hash = ExtendedPublicKey::doubleSha256($hex);
```

###  Health Score

14

—

LowBetter than 1% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity1

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity24

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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/7c939b4338f02cc10babd29106da394f2c52dba8a05d9c0494809982532b2b7e?d=identicon)[eike-grundke](/maintainers/eike-grundke)

---

Top Contributors

[![eike-grundke](https://avatars.githubusercontent.com/u/30509642?v=4)](https://github.com/eike-grundke "eike-grundke (3 commits)")

### Embed Badge

![Health badge](/badges/eike-grundke-xpub/health.svg)

```
[![Health](https://phpackages.com/badges/eike-grundke-xpub/health.svg)](https://phpackages.com/packages/eike-grundke-xpub)
```

###  Alternatives

[pragmarx/ia-collection

Laravel Illuminate Agnostic Collection

473.5M2](/packages/pragmarx-ia-collection)[monzer/filament-workflows

Automation made easy!

6515.5k](/packages/monzer-filament-workflows)[astrotomic/laravel-unavatar

Laravel integration of unavatar service.

298.0k](/packages/astrotomic-laravel-unavatar)

PHPackages © 2026

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