bitpay/bitcore — pull request #748 by yemel (2014-12-15 18:45:15+00:00)
Title: Refactor/remove network

The `PrivateKey` have a `network` reference because we are supporting the `WIF` format. However that is somehow cumbersome to understand. Private keys should be network agnostic.

This PR proposes the removal of the `network` argument while still importing the `WIF` format. The new interface looks like this:

```
var priv1, priv2;
priv1 = new PrivateKey();

priv2 = new PrivateKey(priv1);
priv2 = new PrivateKey(priv1.bn);

priv2 = new PrivateKey(priv1.toString());
priv2 = new PrivateKey(priv1.toBuffer());
priv2 = new PrivateKey(priv1.toJSON());
priv2 = new PrivateKey(priv1.toWIF());

var wif = 'L5VAA64X5fBY6Ve1umoXfRR3FdywkJcHr45sBtM4C7gnBP2HcX3U';
priv2 = new PrivateKey(wif);

var wifObj = PrivateKey.fromWIF(wif);
// returns { privateKey: , network: 'livenet' }
```

Also, the `PrivateKey.toString()` has been been changed to use the `BN.toString('hex')` representation.