2017 © Pedro Peláez
 

library bitcoinconsensus

Composer package containing stubs for bitcoinconsensus. Make sure your version is correct!

image

bitwasp/bitcoinconsensus

Composer package containing stubs for bitcoinconsensus. Make sure your version is correct!

  • Sunday, July 22, 2018
  • by thomaskerin
  • Repository
  • 2 Watchers
  • 1 Stars
  • 20 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 3 Forks
  • 0 Open issues
  • 3 Versions
  • 0 % Grown

The README.md

bitcoinconsensus-php

Build Status codecov, (*1)

PHP extension for Bitcoin Script validation., (*2)

It exposes bindings to the bitcoinconsensus.h library, which exposes the VerifyScript with a C compatible interface., (*3)

The library is normally build during compilation of Bitcoin Core, and is also distributed in signed releases of Bitcoin Core. This means you can build your own or get a trusted copy., (*4)

Requirements

Version v3.0.0 can be run on PHP versions > 7.0. - In theory can be built with versions before Bitcoin Core v0.13.0., (*5)

Version v2.0.0 can run on PHP versions 5.3 - 5.6, and PHP 7.0 - 7.2, 7.3-RC - It must be built against Bitcoin Core v0.13.0 upwards., (*6)

See how to install a certain branch in the installation section., (*7)

Supported features

Script verification flags:, (*8)

BITCOINCONSENSUS_SCRIPT_FLAGS_VERIFY_NONE
BITCOINCONSENSUS_SCRIPT_FLAGS_VERIFY_P2SH
BITCOINCONSENSUS_SCRIPT_FLAGS_VERIFY_DERSIG

Optional (depends on bitcoinconsensus.h build):
BITCOINCONSENSUS_SCRIPT_FLAGS_VERIFY_CHECKLOCKTIMEVERIFY
BITCOINCONSENSUS_SCRIPT_FLAGS_VERIFY_CHECKSEQUENCEVERIFY
BITCOINCONSENSUS_SCRIPT_FLAGS_VERIFY_WITNESS
BITCOINCONSENSUS_SCRIPT_FLAGS_VERIFY_NULLDUMMY

Error codes for bitcoinconsensus_verify_script{,with_amount}, (*9)

BITCOINCONSENSUS_ERR_OK                   no error
BITCOINCONSENSUS_ERR_TX_INDEX             input index not set in transaction
BITCOINCONSENSUS_ERR_TX_SIZE_MISMATCH     (not possible)
BITCOINCONSENSUS_ERR_TX_DESERIALIZE       invalid transaction serialization

Optional (depends on bitcoinconsensus.h build):
BITCOINCONSENSUS_ERR_AMOUNT_REQUIRED      used segwit flag with old function
BITCOINCONSENSUS_ERR_INVALID_FLAGS        invalid script verification flags used

Compatibility

Script verification constants following the naming BITCOINCONSENSUS_VERIFY_x were removed in favor of those following upstreams naming., (*10)

To Install:

    git clone -b v3.0.0 git@github.com:bit-wasp/bitcoinconsensus-php
    cd bitcoinconsensus-php/bitcoinconsensus
    phpize && ./configure --with-bitcoinconsensus && make && sudo make install

(Optional) - Enable the extension by default!

Add this line to your php.ini files to enable the extension in PHP by default., (*11)

extension=bitcoinconsensus.so

Examples

Get version

echo bitcoinconsensus_version() . PHP_EOL;

The Versions

22/07 2018

dev-master

9999999-dev https://github.com/Bit-Wasp/bitcoinconsensus-php

Composer package containing stubs for bitcoinconsensus. Make sure your version is correct!

  Sources   Download

Unlicense

The Requires

  • php >=7.0

 

The Development Requires

bitcoin transaction script bitcoinconsensus

22/07 2018

v3.0.0

3.0.0.0 https://github.com/Bit-Wasp/bitcoinconsensus-php

Composer package containing stubs for bitcoinconsensus. Make sure your version is correct!

  Sources   Download

Unlicense

The Requires

  • php >=7.0

 

The Development Requires

bitcoin transaction script bitcoinconsensus

13/07 2018

2.0.0.x-dev

2.0.0.9999999-dev

  Sources   Download

The Development Requires