PHPackages                             power/php-bitcoin-address - 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. power/php-bitcoin-address

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

power/php-bitcoin-address
=========================

A simple P2PK, P2PKH, P2SH, P2WPKH, P2WSH output script/address generator.

1.1(3y ago)069MITPHPPHP &gt;=7.0

Since Jan 11Pushed 3y agoCompare

[ Source](https://github.com/alexdnepro/php-bitcoin-address)[ Packagist](https://packagist.org/packages/power/php-bitcoin-address)[ RSS](/packages/power-php-bitcoin-address/feed)WikiDiscussions master Synced 1mo ago

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

PHP Bitcoin Address
-------------------

[](#php-bitcoin-address)

A simple P2PK, P2PKH, P2SH, P2WPKH, P2WSH output script/address parser/generator.

**Supported types:**

- Pay-To-PubKey (P2PK)
- Pay-To-PubKeyHash (P2PKH)
- Pay-To-Multisig (P2MS)
- Pay-To-ScriptHash (P2SH)
- Pay-To-WitnessPubKeyHash (P2WPKH)
- Pay-To-WitnessScriptHash (P2WSH)
- P2WPKH-over-P2SH
- P2WSH-over-P2SH
- any combination

**Supported networks:**

- Bitcoin
- Bitcoin Testnet
- Bitcoin Gold
- Bitcoin Cash
- Litecoin
- Litecoin Testnet
- Dogecoin
- Dogecoin Testnet
- Viacoin
- Viacoin Testnet
- Dash
- Dash Testnet
- Zcash

### Installation

[](#installation)

```
composer require andkom/php-bitcoin-address
```

### Examples

[](#examples)

Generate a P2PK/P2PKH address:

```
$address = OutputFactory::p2pk($pubKey)->address();
$address = OutputFactory::p2pkh($pubKeyHash)->address();
```

Generate a P2MS address:

```
$address = OutputFactory::p2ms(2, [$pubKey1, $pubKey2, $pubKey3])->address();
```

Generate a P2SH address:

```
$factory = new OutputFactory();
$p2ms = $factory->p2ms(2, [$pubKey1, $pubKey2, $pubKey3]);
$address = $factory->p2sh($p2ms)->address();
```

Generate a P2WPKH address:

```
$address = OutputFactory::p2wpkh($pubKeyHash)->address();
```

Generate a P2WSH address:

```
$factory = new OutputFactory();
$p2ms = $factory->p2ms(2, [$pubKey1, $pubKey2, $pubKey3]);
$address = $factory->p2wsh($p2ms)->address();
```

Generate a P2WPKH-over-P2SH address:

```
$factory = new OutputFactory();
$p2wpkh = $factory->p2wpkh($pubKeyHash);
$address = $factory->p2sh($p2wpkh)->address();
```

Generate a P2WSH-over-P2SH address:

```
$factory = new OutputFactory();
$p2ms = $factory->p2ms(2, [$pubKey1, $pubKey2, $pubKey3]);
$p2wsh = $factory->p2wsh($p2ms);
$address = $factory->p2sh($p2wsh)->address();
```

Generate an address from an output script:

```
$address = OutputFactory::fromScript($script)->address();
```

###  Health Score

21

—

LowBetter than 19% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity42

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 83.3% 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

1222d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/6689371ddad2e268b759a400ea81d55284a115c950669ce1bc48a645d7782328?d=identicon)[alexdnepro](/maintainers/alexdnepro)

---

Top Contributors

[![andkom](https://avatars.githubusercontent.com/u/150830?v=4)](https://github.com/andkom "andkom (10 commits)")[![alexdnepro](https://avatars.githubusercontent.com/u/29249402?v=4)](https://github.com/alexdnepro "alexdnepro (2 commits)")

---

Tags

addressgeneratorbitcoin

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/power-php-bitcoin-address/health.svg)

```
[![Health](https://phpackages.com/badges/power-php-bitcoin-address/health.svg)](https://phpackages.com/packages/power-php-bitcoin-address)
```

###  Alternatives

[symfony/maker-bundle

Symfony Maker helps you create empty commands, controllers, form classes, tests and more so you can forget about writing boilerplate code.

3.4k111.1M568](/packages/symfony-maker-bundle)[simplesoftwareio/simple-qrcode

Simple QrCode is a QR code generator made for Laravel.

2.9k27.6M92](/packages/simplesoftwareio-simple-qrcode)[nimiq/xpub

A simple class to derive BTC and ETH extended public keys and addresses without GMP.

123.4k](/packages/nimiq-xpub)

PHPackages © 2026

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