• Stars
    star
    135
  • Rank 269,297 (Top 6 %)
  • Language
    PHP
  • License
    The Unlicense
  • Created over 10 years ago
  • Updated about 5 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,044
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
64
star
4

secp256k1-php

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

BitWasp-Historic

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

bitcoin-p2p-php

Implementation of Bitcoin protocol using ReactPHP
PHP
37
star
7

node-php

PHP
20
star
8

stratum-php

Implementation of the Stratum protocol (for electrum and mining) using ReactPHP
PHP
19
star
9

multisig

Demonstration of multi-signature transactions
PHP
13
star
10

bech32

Bech32 library
PHP
12
star
11

testing-php

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

bitcoinconsensus-php

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

bitcoind-server

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

electrum-discovery

Electrum wallet server discovery using ReactPHP
PHP
4
star
15

pinentry

pinentry interface for PHP command line applications
PHP
4
star
16

trezor-bridge-client

PHP library for communications with the trezor hardware wallet using the trezor bridge
PHP
3
star
17

trezor-protobuf

Package containing trezor protobuf messages
PHP
3
star
18

bitcoinconsensus-nodejs

Node.js bindings to bitcoinconsensus.h
C
2
star
19

bitcoind-php-guzzle

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

payment-requests

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

trait

PHP
2
star
22

malleability-fixer

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

thread

Experimental library for creating child processes.
PHP
2
star
24

commonblockchain

PHP
2
star
25

sighash-coverage

Library to check a signatures coverage over a bitcoin transaction (ie, what parts are committed)
1
star