Skip to content
The PHP library for's easy wallet creation, money sending and received API for Dogecoin, Litecoin, and Bitcoin.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.
examples minor May 16, 2019
.gitignore test for php7 and prevent passing of pin May 10, 2019
composer.json support PHP5.6+ only + replace mCrypt with OpenSSL + version bump Sep 10, 2017
phpconfig.ini PHP

Current Release: 1.2.1

05/10/19: Minor updates. Tested for PHP7.x. 09/10/17: Replace mCrypt with OpenSSL. PHP5.6+ only. 02/06/17: Enforce use of TLSv1.2.
01/29/15: Added support for getting Wallet Import Format private keys from custom keys.
01/19/15: Added support for sweeping legacy keys.
01/09/15: Added sweep functionality.
11/03/14: Fix DER signature encoding. Now stable.
18/10/14: Enforcing Determinism in Signatures (RFC6979), also using BIP62 to hinder transaction malleability.
15/10/14: Enforce use of TLSv1, step away from the vulnerable SSLv3.
10/10/14: Added 3 of 4 MultiSig example.
09/28/14: Updated for v2 handling.

PHP wrapper for for use with Dogecoin, Bitcoin, and Litecoin. API key validation on instantiation, simple abstraction layer on top of existing API interfaces, and automatic JSON decoding on response.


This library requires the 'gmp', and cURL extensions for PHP. To enable these extensions, see:

GMP Installation Guide

cURL Installation Guide


If you're using Windows, beware that SSL will not function properly, and this library will throw errors.

To fix the SSL issue on Windows, please do the following:

Download to a directory of your choice
Make PHP use this file to validate's SSL certificate by adding this line to your php.ini:



First, sign up for an account at and take note of your API key under Account > Dashboard.

Download and include the block_io.php class:

require_once 'path/to/block_io.php';

Or preferably install via Composer

composer require block_io-php/block_io-php

Instantiate the class and set your API key. If the API key is valid the set function will return true otherwise false.

$version = 2; // the API version to use

$block_io = new BlockIo($apiKey, $pin, $version);

echo "Confirmed Balance: " . $block_io->get_balance()->data->available_balance . "\n";

The wrapper abstracts all methods listed at using the same interface names. For example, to get your current account balance:

$balance = $block_io->get_balance(array('label' => 'default'));
echo $balance->data->available_balance . "\n";

To make requests that require parameters (eg. an address label or address to withdraw to), pass through each parameter in an associative array. For example, the request below will withdraw 50 DOGE to the wallet you specify in place of WALLET-ADDRESS-HERE:

$withdraw = $block_io->withdraw(array('amount' => '50.0', 'to_address' => 'WALLET-ADDRESS-HERE'));

Note: This library throws Exceptions when calls fail. Implement try/catch blocks, and retrieve the Exception message to see details.

Please see PHP Docs for details on available calls.

You can’t perform that action at this time.