Bitcoin Forum
April 19, 2024, 06:49:53 PM *
News: Latest Bitcoin Core release: 26.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: PHP library: Bitcoin ECC, transaction, deterministic addresses  (Read 933 times)
fbueller (OP)
Sr. Member
****
Offline Offline

Activity: 412
Merit: 266


View Profile
April 03, 2014, 10:13:26 AM
Last edit: May 15, 2014, 12:08:47 PM by fbueller
 #1

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)

Bitwasp Developer.
1713552593
Hero Member
*
Offline Offline

Posts: 1713552593

View Profile Personal Message (Offline)

Ignore
1713552593
Reply with quote  #2

1713552593
Report to moderator
1713552593
Hero Member
*
Offline Offline

Posts: 1713552593

View Profile Personal Message (Offline)

Ignore
1713552593
Reply with quote  #2

1713552593
Report to moderator
Even in the event that an attacker gains more than 50% of the network's computational power, only transactions sent by the attacker could be reversed or double-spent. The network would not be destroyed.
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1713552593
Hero Member
*
Offline Offline

Posts: 1713552593

View Profile Personal Message (Offline)

Ignore
1713552593
Reply with quote  #2

1713552593
Report to moderator
1713552593
Hero Member
*
Offline Offline

Posts: 1713552593

View Profile Personal Message (Offline)

Ignore
1713552593
Reply with quote  #2

1713552593
Report to moderator
1713552593
Hero Member
*
Offline Offline

Posts: 1713552593

View Profile Personal Message (Offline)

Ignore
1713552593
Reply with quote  #2

1713552593
Report to moderator
gatomalo
Newbie
*
Offline Offline

Activity: 14
Merit: 0



View Profile WWW
June 08, 2014, 04:43:44 PM
 #2

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
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!