The addUncompressed function is for node-only, and is a temporary workaround
until we expose a better crypto interface in both node and the browser. I wrote
tests for this function that were node-only, but were broken in the browser. I
also wrote tests for the Point class that should have worked in both node and
the browser, and did, but I was using the wrong module such that it worked only
in node. This update makes the tests work in the browser by using the correct
module.
The Point class will ultimately be an all purpose tool for dealing with points
on the secp256k1 tool. For now, it just needs to have the ability to add two
points together, and work both in node and the browser, so that it can be used
for BIP32.
This testnet transaction was being parsed incorrectly:
cc64de74ba7002bbf4e3646824d7bbf0920004fb2ce45aa7270c4116ff11b715
Script was throwing an error when it should not have been. The error was that
PUSHDATA1 was trying to push 117 bytes to the stack, but it was followed by
only 75 bytes. But this transaction is accepted as valid by bitcoin-qt on
testnet. So we are mistaken by throwing an error in this case.
The way I was outputting the pubkeys would be incorrect if the first byte of
one of the coordinates was 0, since it would print the first non-zero byte
first. The solution was to use the standard openssl function that outputs a
public key to oct.
BIP32 needs to be able to add two points on the secp256k1 curve. This
functionality was not already being exposed from OpenSSL in bitcore. I have
added an "addUncompressed" function to the Key class which takes in two points
in uncompressed form, adds them, and returns the result. This is necessary for
BIP32.
Added the ability to create a new master bip32 with new private key and chain code. The way this works is like this:
var bip32 = new BIP32('mainnet');
or:
var bip32 = new BIP32('testnet');