PHPackages                             hdfchain/hdfchain-php-api - 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. [API Development](/categories/api)
4. /
5. hdfchain/hdfchain-php-api

ActiveLibrary[API Development](/categories/api)

hdfchain/hdfchain-php-api
=========================

PHP API for the Hdfchain Cryptocurrency

v1.0.0(5y ago)18ISCPHPPHP &gt;=5.6

Since Sep 22Pushed 5y ago1 watchersCompare

[ Source](https://github.com/hdfchain/hdfchain-php-api)[ Packagist](https://packagist.org/packages/hdfchain/hdfchain-php-api)[ RSS](/packages/hdfchain-hdfchain-php-api/feed)WikiDiscussions master Synced 5d ago

READMEChangelog (1)Dependencies (8)Versions (2)Used By (0)

Hdfchain PHP API
================

[](#hdfchain-php-api)

[![Build Status](https://github.com/hdfchain/hdfchain-php-api/workflows/Build%20and%20Test/badge.svg)](https://github.com/hdfchain/hdfchain-php-api/actions)[![ISC License](https://camo.githubusercontent.com/95c61c397ca3825757ec835268e50886b2c10ddc4f0676e1222b19037610927f/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4953432d626c75652e737667)](http://copyfree.org)

PHP API for the [Hdfchain](https://clkj.ltd) Cryptocurrency

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

[](#installation)

IF PHP version &gt;7.0 composer It can be ignored version, Command：

```
composer install --ignore-platform-reqs
```

or

```
composer update --ignore-platform-reqs

```

PHP COMMOND CLI VERSION = 7.0 Add composer package to your project

```
composer require hdfchain/hdfchain-php-api
```

Make sure [GMP PHP extesion](https://www.php.net/manual/en/book.gmp.php) is installed. In ubuntu:

```
sudo apt install php7.0-gmp
```

### From repository

[](#from-repository)

You also can clone git package with

```
git clone https://github.com/hdfchain/hdfchain-php-api.git
```

But still you will need to fetch library dependencies with [composer](https://getcomposer.org/doc/00-intro.md).

```
composer install --no-dev
```

Don't forget to include composer autoloader.

```
include __DIR__.'/../vendor/autoload.php';
```

Usage examples
--------------

[](#usage-examples)

Library have wide functionality, so you could find usage examples in `examples` library or looking into PHPUnit tests.

### Generating seed

[](#generating-seed)

First of all we need to get Network intance to start working with library.

```
$testnet = \Hdfchain\TestNet::instance();
```

And mainnet accordingly

```
$mainnet = \Hdfchain\MainNet::instance();
```

Now lets generate a seed, that will be also verified for usage on testnet. Defaut account and branch address will be derivded to verify the seed.

```
$seed = \Hdfchain\Crypto\ExtendedKey::generateSeed($testnet);
```

### HD Wallets

[](#hd-wallets)

When we have usable seed we can create HD master key.

```
$master = \Hdfchain\Crypto\ExtendedKey::newMaster($seed, $testnet);
```

`newMaster` method will return `ExtendedKey` object, that have variant API for working with HD wallets.

#### `ExtendedKey::privateChildKey($index)`

[](#extendedkeyprivatechildkeyindex)

Derives HD private child key from parent HD private key, returns `ExtendedKey` object.

#### `ExtendedKey::hardenedChildKey($index)`

[](#extendedkeyhardenedchildkeyindex)

Derives HD hardened child key from parent HD private key, returns `ExtendedKey` object.

Can't be dervied from HD public key.

#### `ExtendedKey::publicChildKey($index)`

[](#extendedkeypublicchildkeyindex)

Derives HD public child key from parent HD private or public key, returns `ExtendedKey` object.

#### `ExtendedKey::neuter`

[](#extendedkeyneuter)

Verify that extended key is public, returns `ExtendedKey` object.

### Default account

[](#default-account)

Using this basic methods we can derive default account HD private and public keys accourding to [BIP44](https://github.com/bitcoin/bips/blob/master/bip-0044.mediawiki).

HD path (m\\44'\\42'\\0')

```
$defaultAccountPrivateKey = $master
    ->hardenedChildKey(44)
    ->hardenedChildKey(42)
    ->hardenedChildKey(0);

$defaultAccountPublicKey = $master->neuter();
```

`ExtendedKey` implements `__toString()` method, so you can easily get Base58 representation of HD key.

```
echo sprintf("Default account HD private key: %s\n", $defaultAccountPrivateKey);
echo sprintf("Default account HD public key: %s\n", $defaultAccountPublicKey);
```

From default account we can derive 0 branch and 0 index and the get default address.

```
$defaultAddress = $defaultAccountPublicKey
    ->publicChildKey(0)
    ->publicChildKey(0)
    ->getAddress();

echo sprintf("Default address: %s\n", $defaultAddress);
```

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity49

Maturing project, gaining track record

 Bus Factor1

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

Unknown

Total

1

Last Release

2063d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/c29128afe564ce6cb026266ac4d4d94ec849bffba3011d9a3be13d941d77e1ad?d=identicon)[ihqgfboy](/maintainers/ihqgfboy)

---

Top Contributors

[![ifishnet](https://avatars.githubusercontent.com/u/24865480?v=4)](https://github.com/ifishnet "ifishnet (3 commits)")[![hdfchain](https://avatars.githubusercontent.com/u/70999649?v=4)](https://github.com/hdfchain "hdfchain (1 commits)")

---

Tags

cryptobitcoinhdfchainhdf

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/hdfchain-hdfchain-php-api/health.svg)

```
[![Health](https://phpackages.com/badges/hdfchain-hdfchain-php-api/health.svg)](https://phpackages.com/packages/hdfchain-hdfchain-php-api)
```

###  Alternatives

[coinpaymentsnet/coinpayments-php

A PHP wrapper for the CoinPayments.net v1 API.

55126.2k](/packages/coinpaymentsnet-coinpayments-php)[blocktrail/blocktrail-sdk

The BlockTrail PHP SDK, for integration of Bitcoin functionality through the BlockTrail API

4921.1k3](/packages/blocktrail-blocktrail-sdk)[mocking-magician/coinbase-pro-sdk

Library for coinbase pro API calls

223.2k](/packages/mocking-magician-coinbase-pro-sdk)

PHPackages © 2026

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