BitGo/bitcoinjs-lib — pull request #4 by imrehg (2014-01-24 05:15:03+00:00)
Title: BIP32 derive_child uses wrong parameter of eckey

Eckey no longer has a pub and pubKeyHash variable, but
pubComp/pubUncomp and pubKeyHashComp/pubKeyHashUncomp variables
for compressed and uncompressed values.

Because of this, the way derive_child worked before this:
1) create a new random eckey
2) derive child pubkey, add it to the new eckey's pub and pubHash.
3) later when dealing with the child, the eckey's pubComp is used,
resulting in a completely random outcome every time (because of
step 1.) I.e. calling derive_child multiple times results in
independent, and random keys.

Fixing:
Use pubComp and pubKeyHashComp correctly, repeatable derive_child
operation.

**Important**: in the previous behaviour a lot of public keys are generated
which have no recoverable private key parts (ie. non-spendable if received
funds), very dangerous!