• Stars
    star
    137
  • Rank 256,823 (Top 6 %)
  • Language
    PHP
  • License
    The Unlicense
  • Created about 10 years ago
  • Updated over 4 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

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

bitcoin-lib-php

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

Gitter

NB: This library is outdated, and no longer maintained. BC breaks will not be accepted for this reason. For a newer library, please see https://github.com/Bit-Wasp/bitcoin-php

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

  • 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 & 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

Installing via Composer (recommended)

  1. Install Composer in your project:

    curl -s http://getcomposer.org/installer | 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

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)

The GMP Extension is required for the crypto math.

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

mdanter/ecc is required for most of the crypto.

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/

More Repositories

1

bitcoin-php

Bitcoin implementation in PHP
PHP
1,016
star
2

BitWasp

Open Source Bitcoin Marketplace Software
PHP
271
star
3

buffertools-php

Toolbox for working with binary and hex data. Similar to NodeJS Buffer.
PHP
63
star
4

secp256k1-php

PHP bindings for bitcoin-core/secp256k1
PHP
59
star
5

BitWasp-Historic

A secure, anonymous marketplace integrated with the Bitcoin currency
PHP
43
star
6

bitcoin-p2p-php

Implementation of Bitcoin protocol using ReactPHP
PHP
35
star
7

stratum-php

Implementation of the Stratum protocol (for electrum and mining) using ReactPHP
PHP
18
star
8

node-php

PHP
18
star
9

multisig

Demonstration of multi-signature transactions
PHP
13
star
10

bech32

Bech32 library
PHP
11
star
11

testing-php

Composer package for PHP unit testing tools, using Phing for Jenkins or local development
8
star
12

bitcoinconsensus-php

PHP extension for bitcoinconsensus library for script validation
PHP
5
star
13

bitcoind-server

PHP library for spinning up regtest bitcoin instances for unit testing
PHP
3
star
14

electrum-discovery

Electrum wallet server discovery using ReactPHP
PHP
3
star
15

pinentry

pinentry interface for PHP command line applications
PHP
3
star
16

bitcoind-php-guzzle

Guzzle driver for nbobtc/bitcoin-php
PHP
2
star
17

trezor-bridge-client

PHP library for communications with the trezor hardware wallet using the trezor bridge
PHP
2
star
18

trezor-protobuf

Package containing trezor protobuf messages
PHP
2
star
19

payment-requests

Application to generate signed BIP70 payment requests, and listen for payments on the peer-to-peer network
PHP
1
star
20

trait

PHP
1
star
21

bitcoinconsensus-nodejs

Node.js bindings to bitcoinconsensus.h
C
1
star
22

malleability-fixer

Peer to peer node that fixes transactions bearing low-s signature violations
PHP
1
star
23

thread

Experimental library for creating child processes.
PHP
1
star
24

commonblockchain

PHP
1
star