Bitcoin Forum

Bitcoin => Development & Technical Discussion => Topic started by: Kazimir on November 09, 2015, 10:49:41 AM



Title: JS or PHP lib that allows separate HD public+private keys? (for offline wallet)
Post by: Kazimir on November 09, 2015, 10:49:41 AM
Hi, is there a JavaScript or PHP library that features:

1. generating a public and private 'seed' or 'root key'
2. based on the private seed or root key, generating a deterministic sequence of private keys
3. based on the public seed or root key, generating a deterministic sequence of Bitcoin addresses (corresponding with the private keys from step 2)

Steps 2 and 3 should be able to operate independently. The idea is to have an online 'read only' wallet, where one can check balance, generate new addresses, and prepare transactions. And having a separate offline wallet (in a safe, isolated environment) where the corresponding private keys can be generated, and where the previously created transactions can be signed (and then the hex tx data can be exported and pushed on the network separately).

Is bitcoin-js capable of this? The github repos (https://github.com/bitcoinjs/bitcoinjs-lib) mentions HD wallet capabilities, but not the separation of public and private keys. And bitcoinjs.org (http://bitcoinjs.org/) seems rather outdated.


Title: Re: JS or PHP lib that allows separate HD public+private keys? (for offline wallet)
Post by: luv2drnkbr on November 09, 2015, 02:47:45 PM
Any hierarchical deterministic wallet code will be able to do that.  Take a look at the bip32-utils (https://github.com/bitcoinjs/bip32-utils) from the same user as your link.


Title: Re: JS or PHP lib that allows separate HD public+private keys? (for offline wallet)
Post by: fbueller on November 09, 2015, 11:34:47 PM
Bitcore or Bitcoinjs-lib works well for clientside stuff, and your server if you like.

https://github.com/Bit-Wasp/bitcoin-php can do public HD derivations on your server if PHP is preferred for that. (I wrote this library)


Title: Re: JS or PHP lib that allows separate HD public+private keys? (for offline wallet)
Post by: CrazyJoker on November 09, 2015, 11:43:52 PM
Are you looking for a functionality like https://coinb.in/#newHDaddress ?

Then check coinb.in code on Github. It is an awesome JS implementation.