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

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

barechain/bitcoin-address
=========================

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

v1.0.0(3y ago)0214MITPHPPHP &gt;=8.0

Since Oct 24Pushed 3y ago1 watchersCompare

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

READMEChangelog (1)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 barechain/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

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity53

Maturing project, gaining track record

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

Unknown

Total

1

Last Release

1302d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/8aade6fdc2a02f3746572c1e2104443c769d9f4491f67b440bebb1e3b2f97b31?d=identicon)[sanmanto\_dev](/maintainers/sanmanto_dev)

---

Tags

addressgeneratorbitcoin

###  Code Quality

TestsPHPUnit

### Embed Badge

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

```
[![Health](https://phpackages.com/badges/barechain-bitcoin-address/health.svg)](https://phpackages.com/packages/barechain-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)
