Bitcoin Forum

Bitcoin => Project Development => Topic started by: fbueller on April 03, 2014, 10:13:26 AM



Title: PHP library: Bitcoin ECC, transaction, deterministic addresses
Post by: fbueller on April 03, 2014, 10:13:26 AM
I've been working on a few libraries that should help PHP developers. It depends on the GMP extension for big number support, but this is faster than bmath..

https://github.com/Bit-Wasp/bitcoin-lib-php

Everything works independently from bitcoind too, so some RPC calls can be substituted with calls to this library instead, especially if they're in rapid succession. By specifying the magic byte when calling functions you can use all the functions for altcoins as well.

The raw transaction library has compatible serialization/deserialization functions.. So those looking for something to create a raw transaction from an array similar to that of decoderawtransaction(), this is it.

Main point of writing this is to give developers libraries to use instead of requiring extensive use of the API, and so that the role of bitcoind can be as minimal as needed - there's no sense in your app breaking because it's not online to service the validateaddress() call, or createmultisig(), and so on.

BitcoinLib:
 - Base58 encoding/decoding
 - Hash160/256,
 - Key pair generation
 - Converting private to public keys
 - Support for compressed public and private keys.
 - Validation functions for addresses, public keys,
 - functions such as base58_encode/decode, a function to do base58check encoding, keypair generation, conversion to public keys/addresses,
compression/decompression/validation.

Raw Transactions
 - Decode/encode raw transactions
 - Create/decode multisig (P2SH) redeem scripts
 - Creating basic raw transactions
 - Signing transactions! P2PKH and pay-to-script hash (multisig)
 - Signature verification (again P2PKH & P2SH)
 - serialization/deserialization, creating/decoding redeemscripts, creating multisig addresses, creating a raw transaction from simple arrays, script interpreter, signature verification (OP_CHECKSIG),

Deterministic addresses:
BIP32:
 - Derive master key from initial seed.
 - Child key derivation
 - Conversion of extended private -> public keys.
 - Extracting the public key for any extended key
(support for bitcoin mainnet/testnet, litecoin mainnet/testnet, and proposed dogecoin bytes also)

Electrum:
 - Decoding electrum mnemonics to a seed
 - Create a master public key
 - Public key derivation (from master public key)
 - Private key derivation (from seed)


Title: Re: PHP library: Bitcoin ECC, transaction, deterministic addresses
Post by: gatomalo on June 08, 2014, 04:43:44 PM
I'm going to give your tools a test drive, it looks cool and can save me a lot of time. If your looking for some work, I may need your skills pls let me know.
gAtO