cryptocoinjs / coininfo

JavaScript component for crypto currency specific information.
116 stars 114 forks source link

update Dash values to match 0.12.1 release #28

Closed UdjinM6 closed 7 years ago

UdjinM6 commented 7 years ago

References:

jprichardson commented 7 years ago

Thanks!

gpip commented 7 years ago

@UdjinM6 is it ok to continue using the old bytes for bip32? bitcore-lib gets confused with this dup from bitcoin, e.g.:

> var b = require('bitcore-lib');
> var c = require('coininfo');
> var dashmain = c.dash.main.toBitcore();
> dashmain.name = 'dash';
> dashmain.alias = 'dashmainnet';
> b.Networks.add(dashmain);
> b.HDPrivateKey('dash').network
'dash'  # OK
> b.HDPrivateKey(b.Networks.mainnet).network
'dash'  # FAIL

Without modifying:

> var b = require('bitcore-lib');
> b.HDPrivateKey(b.Networks.mainnet).network.name
'livenet'  # OK
UdjinM6 commented 7 years ago

@gpip We had a conversation with multi-coin wallet devs (Jaxx, Exodus) and turned out that none of them are using pure bip32, they see bip32 as coin-agnostic bip and use bip44 to produce coin-specific keys, so we decided to adopt this policy in our reference client as well.

Litecoin values were changed this way too btw (https://www.reddit.com/r/litecoin/comments/48wd2e/why_arent_the_litecoin_bip32_serialization_values/) and they don't match now:

gpip commented 7 years ago

@UdjinM6 even if they don't use pure bip32, this change still breaks bitcore-lib (see https://github.com/bitpay/bitcore-lib/issues/131). You also can't use two bitcore-lib instances as there are checks against that (so you couldn't use bitcore-dash-lib and bitcore-lib to handle this issue). Seems like a good idea to patch bitcore-lib to handle duplicates on network settings correctly.

UdjinM6 commented 7 years ago

@gpip

Seems like a good idea to patch bitcore-lib to handle duplicates on network settings correctly.

I agree

jprichardson commented 7 years ago

Yeah, per BIP43 recommendations: https://github.com/bitcoin/bips/blob/master/bip-0043.mediawiki#node-serialization we (Exodus) uses xpub and xpriv for all assets.