PHPackages                             visvirial/bitcoin-lib - 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. visvirial/bitcoin-lib

ActiveLibrary

visvirial/bitcoin-lib
=====================

Implementation of raw transactions in bitcoin, HD wallets, Electrum wallets, and other fun stuff.

08PHP

Since May 22Pushed 10y ago1 watchersCompare

[ Source](https://github.com/visvirial/bitcoin-lib-php)[ Packagist](https://packagist.org/packages/visvirial/bitcoin-lib)[ RSS](/packages/visvirial-bitcoin-lib/feed)WikiDiscussions fix-composer Synced 1mo ago

READMEChangelogDependenciesVersions (9)Used By (0)

bitcoin-lib-php
===============

[](#bitcoin-lib-php)

PHP libraries implementing bitcoin key functions, as well as BIP32 and electrum.

[![Gitter](https://camo.githubusercontent.com/abe08b740a4156153736f791393ec4da6619c4be73212e75769f52edacc0e2b5/68747470733a2f2f6261646765732e6769747465722e696d2f4a6f696e253230436861742e737667)](https://gitter.im/Bit-Wasp/bitcoin-lib-php?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)

> NB: This library is outdated, and no longer maintained. BC breaks will not be accepted for this reason. For a newer library, please see

The library intends to expose a lot of general functionality which isn't available using the RPC (like deterministic addresses).

It also allows you to reduce the number of queries that are made to bitcoind, such as createrawtransaction/signrawtransaction/decoderawtransaction. As such, such, use of bitcoin RPC functionality can be kept to a minimum.

Libraries
=========

[](#libraries)

- Raw Transactions: create, sign, validate, with support for P2SH.
- Create multi-signature addresses, create redeeming transactions.
- BIP32: Functions for generating BIP32 deterministic keys.
- Electrum: Create seed from mnemonic, create MPK from seed, derive public keys from MPK, or private keys from seed.
- BitcoinLib: The core class, with key functionality, encoding/decoding &amp; validation functions, etc.
- BIP39: Functions for generating Mnemonic code for generating deterministic keys (possibly password protected)

If this library powers your project and you're feeling tipsy, buy me lunch some day! 1sCVtkEhQmvp3D4K22Pw9xhFPTDWFh8SZ

Installation
============

[](#installation)

Installing via Composer (recommended)
-------------------------------------

[](#installing-via-composer-recommended)

1. Install Composer in your project:

    curl -s  | php
2. Create a `composer.json` file in your project root:

    { "require": { "bitwasp/bitcoin-lib": "1.0.\*" } }
3. Install via Composer

    php composer.phar install

Dependencies
============

[](#dependencies)

Mcrypt Extension (Random data)
------------------------------

[](#mcrypt-extension-random-data)

The Mcrypt Extension is required for generating random data, it does this internally by using `/dev/urandom` on unix or `CryptGenRandom` on windows.

GMP Extension (Math)
--------------------

[](#gmp-extension-math)

The GMP Extension is required for the crypto math.

PECL intl extension (BIP39)
---------------------------

[](#pecl-intl-extension-bip39)

The PECL intl extension is required for BIP39 Mnemonic Seeds when a UTF-8 passphrase is used.

Mdanter's PHP Pure PHP Elliptic Curve Cryptography Library
----------------------------------------------------------

[](#mdanters-php-pure-php-elliptic-curve-cryptography-library)

`mdanter/ecc` is required for most of the crypto.

Contributing
============

[](#contributing)

Please make sure that all phpunit tests pass (and preferably added new unit tests) and that the coding style passing PSR2 checks:

- `./vendor/bin/phpunit`
- `./vendor/bin/phpcs --standard=./phpcs.xml -n -s ./src/`

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity48

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 59% 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/c9e2befba501771c2bc7799bbc561c2aae3869fffc5a74b39348631f39359392?d=identicon)[visvirial](/maintainers/visvirial)

---

Top Contributors

[![rubensayshi](https://avatars.githubusercontent.com/u/649160?v=4)](https://github.com/rubensayshi "rubensayshi (82 commits)")[![afk11](https://avatars.githubusercontent.com/u/5617245?v=4)](https://github.com/afk11 "afk11 (43 commits)")[![visvirial](https://avatars.githubusercontent.com/u/6349067?v=4)](https://github.com/visvirial "visvirial (6 commits)")[![willgriffin](https://avatars.githubusercontent.com/u/590602?v=4)](https://github.com/willgriffin "willgriffin (5 commits)")[![OACDesigns](https://avatars.githubusercontent.com/u/2932334?v=4)](https://github.com/OACDesigns "OACDesigns (2 commits)")[![gitter-badger](https://avatars.githubusercontent.com/u/8518239?v=4)](https://github.com/gitter-badger "gitter-badger (1 commits)")

### Embed Badge

![Health badge](/badges/visvirial-bitcoin-lib/health.svg)

```
[![Health](https://phpackages.com/badges/visvirial-bitcoin-lib/health.svg)](https://phpackages.com/packages/visvirial-bitcoin-lib)
```

PHPackages © 2026

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