Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multibyte pubKeyHash - zcash #94

Closed
alkley opened this issue Aug 23, 2017 · 4 comments
Closed

Multibyte pubKeyHash - zcash #94

alkley opened this issue Aug 23, 2017 · 4 comments

Comments

@alkley
Copy link
Contributor

alkley commented Aug 23, 2017

When trying to add ZEC I encountered an error in believe in bitcoinjs which enforces pubkeyhash as a UInt8 and therefore doesn't allow values great than 255. ZEC uses 7352 (0x1CB8).

See:
https://github.com/trezor/trezor-common/blob/5f7a1a7a5a4311fd71ed113624dd1d0fe9e72ff5/coins.json#L179

This is a fork of this project but with an older version of bitcoinjs:
https://github.com/Coinomi/bip39/blob/58a3bb9680a0291a2bc57f3fcc1c7d22e3ab2259/src/js/bitcoinjs-extensions.js#L863

To reproduce adding to bitcoin-extensions.js:

bitcoinjs.bitcoin.networks.zec = {
  messagePrefix: "unused",
  bip32: {
    public: 0x0488b21e,
    private: 0x488ade4
  },
  pubKeyHash: 0x1cb8,
  scriptHash: 0x1cbd,
  wif: 0x80,
};

throws TfPropertyTypeError for property pubKeyHash.

@iancoleman
Copy link
Owner

Thanks for this. I'm following it up with bitcoinjs-lib

bitcoinjs/bitcoinjs-lib#865

@iancoleman
Copy link
Owner

I'm not willing to fork / modify bitcoinjs-lib to support this feature. I've subscribed to the relevant issue in bitcoinjs-lib, so when this feature is ready I'll look into addressing this issue.

@iancoleman iancoleman changed the title Multibyte pubKeyHash Multibyte pubKeyHash - zcash Nov 30, 2017
@avibrazil
Copy link

avibrazil commented Dec 7, 2017

Coinomi has a tool that seems to be derived from this one. See:

https://coinomi.com/recovery-phrase-tool.html

It supports many many coin types. Maybe support for more coin types can be borrowed from their JavaScript source code and added to this project.

@iancoleman
Copy link
Owner

Closed via #212

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants