Advice and answers from the BitPay Team

Configuration of this library can be done two different ways: using a PHP array or by using a YML file.

Config Options

All configuration options can be found in the class BitpayConfigConfiguration:


This is the full path and name for the public key. The default value is $HOME/.bitpay/


This is the full path and name for the private key. The default value is $HOME/.bitpay/bitpay.key


Specifies using the Live Bitcoin network or the Test Bitcoin network: livenet or testnet. The default is livenet.


Used mostly for testing. You shouldn't need to change or update this value.


The key_storage option allows you to specify a class for persisting and retrieving keys. By default this uses the Bitpay\Storage\EncryptedFilesystemStorage class.


This is the password used to encrypt and decrypt keys on the filesystem.

Example YAML config

# /path/to/config.yml
 network: testnet

Corresponding PHP code:

$bitpay = new \Bitpay\Bitpay('/path/to/config.yml');

Example array config

$bitpay = new \Bitpay\Bitpay(
 'bitpay' => array(
 'network' => 'testnet',
Did this answer your question?