Merge pull request #462 from zoobc/master

Add ZooBC coin support
This commit is contained in:
iancoleman
2021-02-11 12:55:36 +11:00
committed by GitHub
4 changed files with 84 additions and 0 deletions

View File

@@ -1553,6 +1553,18 @@ libs.bitcoin.networks.hush3 = {
wif: 0xBC,
};
libs.bitcoin.networks.zoobc = {
messagePrefix: '\x18ZooBC Signed Message:\n',
bech32: 'bc',
bip32: {
public: 0x0488b21e,
private: 0x0488ade4,
},
pubKeyHash: 0x00,
scriptHash: 0x05,
wif: 0x80,
};
libs.bitcoin.networks.zclassic = {
messagePrefix: '\x18Zcash Signed Message:\n',
bip32: {

View File

@@ -1348,6 +1348,27 @@
address = libs.bchaddrSlp.toSlpAddress(address);
}
}
// ZooBC address format may vary
if (networks[DOM.network.val()].name == "ZBC - ZooBlockchain") {
var purpose = parseIntNoNaN(DOM.bip44purpose.val(), 44);
var coin = parseIntNoNaN(DOM.bip44coin.val(), 0);
var path = "m/";
path += purpose + "'/";
path += coin + "'/" + index + "'";
var result = libs.zoobcUtil.getKeypair(path, seed);
let publicKey = result.pubKey.slice(1, 33);
let privateKey = result.key;
privkey = privateKey.toString('hex');
pubkey = publicKey.toString('hex');
indexText = path;
address = libs.zoobcUtil.getZBCAddress(publicKey, 'ZBC');
}
// Segwit addresses are different
if (isSegwit) {
if (!segwitAvailable) {
@@ -3540,6 +3561,13 @@
setHdCoin(136);
},
},
{
name: "ZBC - ZooBlockchain",
onSelect: function () {
network = libs.bitcoin.networks.zoobc;
setHdCoin(883);
},
},
{
name: "ZCL - Zclassic",
onSelect: function() {