PHPackages                             valadanchik/blockchain - 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. valadanchik/blockchain

ActiveLibrary

valadanchik/blockchain
======================

Blockchain API With HD functionality

114PHP

Since Sep 23Pushed 5y ago1 watchersCompare

[ Source](https://github.com/Valadanchik/Blockchain-API-with-HD)[ Packagist](https://packagist.org/packages/valadanchik/blockchain)[ RSS](/packages/valadanchik-blockchain/feed)WikiDiscussions master Synced 4d ago

READMEChangelogDependenciesVersions (1)Used By (0)

Blockchain API library (PHP, v1)
================================

[](#blockchain-api-library-php-v1)

An official PHP library for interacting with the blockchain.info API.

Getting Started
---------------

[](#getting-started)

This php library works with the [Composer](https://getcomposer.org/) package manager. Install it into your project by running the following command.

```
$ composer require valadanchik/blockchain dev-master

```

In order to use Wallet and CreateWallet functionality, you must provide an URL to an instance of [service-my-wallet-v3](https://github.com/blockchain/service-my-wallet-v3). Before using these functionalities, call \\Blockchain\\Blockchain::setServiceUrl to set the URL to the instance of of [service-my-wallet-v3](https://github.com/blockchain/service-my-wallet-v3).

In the php source, simply:

```
// Include the autoload.php from its vendor directory
require 'vendor/autoload.php'

// Create the base Blockchain class instance
$Blockchain = new \Blockchain\Blockchain();

// Needed before calling $Blockchain->Wallet or $Blockchain->Create
$Blockchain->setServiceUrl('http://localhost:3000');
```

All functionality is provided through the `Blockchain` object.

### Call Limits

[](#call-limits)

The [official documentation](https://blockchain.info/api) lists API call limits, which may be bypassed with an API code. If you use a code, enter it when you create the `Blockchain` object:

```
$Blockchain = new \Blockchain\Blockchain('http://localhost:3000', $my_api_code);
```

If you need an API code, you may request one [here](https://blockchain.info/api/api_create_code).

### Network Timeouts

[](#network-timeouts)

Set the `cURL` timeout, in seconds, with the `setTimeout` member function:

```
$Blockchain->setTimeout($timeout_seconds);
```

The default network timeout is `60` seconds.

A Note about Bitcoin Values
---------------------------

[](#a-note-about-bitcoin-values)

All Bitcoin values returned by the API are in string float format, in order to preserve full value precision. It is recommended that all arithmetic operations performed on Bitcoin values within PHP utilize the `bcmath` functions as follows:

##### `bcadd` Add Two Numbers

[](#bcadd-add-two-numbers)

```
$result = bcadd("101.234115", "34.92834753", 8); // "136.16246253"
```

##### `bcsub` Subtract Two Numbers

[](#bcsub-subtract-two-numbers)

```
$result = bcsub("101.234115", "34.92834753", 8); // "66.30576747"
```

##### `bcmul` Multiply Two Numbers

[](#bcmul-multiply-two-numbers)

```
$result = bcmul("101.234115", "34.92834753", 8); // "3535.940350613"
```

##### `bcdiv` Divide Two Numbers

[](#bcdiv-divide-two-numbers)

```
$result = bcdiv("101.234115", "34.92834753", 8); // "2.89833679"
```

The `8` in the final parameter of each `bcmath` function call represents the numerical precision to keep in the result.

More help on the `bcmath` functions can be found in the [PHP BC Math documentation](http://php.net/manual/en/ref.bc.php).

Documentation
-------------

[](#documentation)

[Block explorer](docs/blockexplorer.md) - Access details of the Bitcoin blockchain

[Create Wallets](docs/create.md) - Create new Blockchain wallets

[Exchange Rates](docs/rates.md) - See the value of Bitcoin relative to world currencies

[Push Transaction](docs/pushtx.md) - Push raw transactions to the Bitcoin network

[Receive v2](docs/v2/receive.md) - The easiest way to accept Bitcoin payments with the v2 Receive API

[Statistics](docs/stats.md) - Bitcoin network statistics

[Wallet](docs/wallet.md) - Send and receive Bitcoin programmatically

Dependencies
------------

[](#dependencies)

The library depends on having the `curl` and `bcmath` modules enabled in your PHP installation.

###  Health Score

18

—

LowBetter than 8% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity32

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/6b3037a7a315cbe9c78593a4697ae329dbc80e64fa0aab6379bb98f9790adf77?d=identicon)[Volodya](/maintainers/Volodya)

---

Top Contributors

[![Valadanchik](https://avatars.githubusercontent.com/u/26608275?v=4)](https://github.com/Valadanchik "Valadanchik (12 commits)")

### Embed Badge

![Health badge](/badges/valadanchik-blockchain/health.svg)

```
[![Health](https://phpackages.com/badges/valadanchik-blockchain/health.svg)](https://phpackages.com/packages/valadanchik-blockchain)
```

PHPackages © 2026

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