protonlabs/bitcoin

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

Package info

github.com/ProtonMail/bitcoin-php

Homepage

pkg:composer/protonlabs/bitcoin

Statistics

Installs: 197 601

Dependents: 10

Suggesters: 0

Stars: 31

Open Issues: 4

v1.1.0 2025-05-22 08:01 UTC

Requires

Suggests

  • ext-bitcoinconsensus: The bitcoinconsensus library for safest possible script verification
  • ext-secp256k1: The secp256k1 library for fast and safe elliptic curve operations

Provides

None

Conflicts

None

Replaces

None

Unlicense 4499c52069c6d6a4d3311213229a1af557eb26b9

This package is auto-updated.

Last update: 2026-06-22 10:23:27 UTC


README

👁 Build Status
👁 Code Coverage
👁 Scrutinizer Code Quality
👁 Latest Stable Version

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

This repository is a fork of Bit-Wasp/bitcoin-php with modern PHP compatibility.

Warning: This library does not support 32-bit installs of PHP. Please also note that composer is the only supported installation method.

Installation

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

Contributing

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

Documentation

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

Presently supported:

  • Blocks, headers, and merkle blocks and bloom filters
  • 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
  • BIP39, and the older electrum seed format.
  • ScriptFactory for common input/output types, parser, interpreter, and classifiers
  • Supports bindings to libbitcoinconsensus
  • Bindings to Stratum (electrum) servers

Other projects

Supporters

This library is a 100% open source project. We do not receive any funding from the industry, nor provide paid support or development of features. That said, we are grateful for our supporters who provide free access for open source projects:

👁 JetBrains

Thanks to JetBrains for supporting the project through sponsoring some All Products Packs within their Free Open Source License program.