diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/js/bitcoinjs-extensions.js | 12 | ||||
-rw-r--r-- | src/js/index.js | 28 |
2 files changed, 40 insertions, 0 deletions
diff --git a/src/js/bitcoinjs-extensions.js b/src/js/bitcoinjs-extensions.js index b049d78..e4996ed 100644 --- a/src/js/bitcoinjs-extensions.js +++ b/src/js/bitcoinjs-extensions.js | |||
@@ -1553,6 +1553,18 @@ libs.bitcoin.networks.hush3 = { | |||
1553 | wif: 0xBC, | 1553 | wif: 0xBC, |
1554 | }; | 1554 | }; |
1555 | 1555 | ||
1556 | libs.bitcoin.networks.zoobc = { | ||
1557 | messagePrefix: '\x18ZooBC Signed Message:\n', | ||
1558 | bech32: 'bc', | ||
1559 | bip32: { | ||
1560 | public: 0x0488b21e, | ||
1561 | private: 0x0488ade4, | ||
1562 | }, | ||
1563 | pubKeyHash: 0x00, | ||
1564 | scriptHash: 0x05, | ||
1565 | wif: 0x80, | ||
1566 | }; | ||
1567 | |||
1556 | libs.bitcoin.networks.zclassic = { | 1568 | libs.bitcoin.networks.zclassic = { |
1557 | messagePrefix: '\x18Zcash Signed Message:\n', | 1569 | messagePrefix: '\x18Zcash Signed Message:\n', |
1558 | bip32: { | 1570 | bip32: { |
diff --git a/src/js/index.js b/src/js/index.js index fd8c16b..1f4cc1f 100644 --- a/src/js/index.js +++ b/src/js/index.js | |||
@@ -1348,6 +1348,27 @@ | |||
1348 | address = libs.bchaddrSlp.toSlpAddress(address); | 1348 | address = libs.bchaddrSlp.toSlpAddress(address); |
1349 | } | 1349 | } |
1350 | } | 1350 | } |
1351 | |||
1352 | // ZooBC address format may vary | ||
1353 | if (networks[DOM.network.val()].name == "ZBC - ZooBlockchain") { | ||
1354 | |||
1355 | var purpose = parseIntNoNaN(DOM.bip44purpose.val(), 44); | ||
1356 | var coin = parseIntNoNaN(DOM.bip44coin.val(), 0); | ||
1357 | var path = "m/"; | ||
1358 | path += purpose + "'/"; | ||
1359 | path += coin + "'/" + index + "'"; | ||
1360 | var result = libs.zoobcUtil.getKeypair(path, seed); | ||
1361 | |||
1362 | let publicKey = result.pubKey.slice(1, 33); | ||
1363 | let privateKey = result.key; | ||
1364 | |||
1365 | privkey = privateKey.toString('hex'); | ||
1366 | pubkey = publicKey.toString('hex'); | ||
1367 | |||
1368 | indexText = path; | ||
1369 | address = libs.zoobcUtil.getZBCAddress(publicKey, 'ZBC'); | ||
1370 | } | ||
1371 | |||
1351 | // Segwit addresses are different | 1372 | // Segwit addresses are different |
1352 | if (isSegwit) { | 1373 | if (isSegwit) { |
1353 | if (!segwitAvailable) { | 1374 | if (!segwitAvailable) { |
@@ -3541,6 +3562,13 @@ | |||
3541 | }, | 3562 | }, |
3542 | }, | 3563 | }, |
3543 | { | 3564 | { |
3565 | name: "ZBC - ZooBlockchain", | ||
3566 | onSelect: function () { | ||
3567 | network = libs.bitcoin.networks.zoobc; | ||
3568 | setHdCoin(883); | ||
3569 | }, | ||
3570 | }, | ||
3571 | { | ||
3544 | name: "ZCL - Zclassic", | 3572 | name: "ZCL - Zclassic", |
3545 | onSelect: function() { | 3573 | onSelect: function() { |
3546 | network = libs.bitcoin.networks.zclassic; | 3574 | network = libs.bitcoin.networks.zclassic; |