PHP Bitcoin library with functions for transactions, signatures, serialization, Random/Deterministic ECDSA keys, blocks, RPC bindings


Build Status Code Coverage Scrutinizer Code Quality Latest Stable Version

This repository contains an implementation of Bitcoin using mostly pure PHP.


You can install this library via Composer: composer require bitwasp/bitcoin


All contributions are welcome. Please see [this page] before you get started


Check out the beginnings of the documentation for the library: [Introduction]

Presently supported:

  • Bloom filters
  • Blocks, headers, and merkle blocks
  • P2SH & Segregated witness scripts
  • An adaptable elliptic-curve library, using [PhpEcc] by default, or libsecp256k1 if the bindings are found
  • Support for building, parsing, signing/validating transactions
  • Deterministic signatures (RFC6979)
  • BIP32 and electrum (older type I) deterministic key algorithms
  • ScriptFactory for common input/output types, parser, interpreter, and classifiers
  • Supports bindings to libbitcoinconsensus
  • RPC bindings to Bitcoin Core's RPC
  • Bindings to Stratum (electrum) servers
  • Easy serialization to binary representation of most classes
  • SIGHASH types when creating transactions

Other projects