From 75138beed936c7cd30757ee263f7c7fd5009f5b0 Mon Sep 17 00:00:00 2001 From: Andrew Date: Tue, 5 Nov 2019 11:26:58 -0500 Subject: [PATCH] added Thought network spec --- changelog.md | 4 ++++ src/index.html | 2 +- src/js/bitcoinjs-extensions.js | 11 +++++++++++ src/js/index.js | 15 +++++++++++---- 4 files changed, 27 insertions(+), 5 deletions(-) diff --git a/changelog.md b/changelog.md index 39a1531..29a2b6f 100644 --- a/changelog.md +++ b/changelog.md @@ -1,3 +1,7 @@ +# 0.3.13 + +* Add Thought network + # 0.3.12 * Fix typos diff --git a/src/index.html b/src/index.html index 95fccc1..6714a9f 100644 --- a/src/index.html +++ b/src/index.html @@ -15,7 +15,7 @@

Mnemonic Code Converter

-

v0.3.12

+

v0.3.13


diff --git a/src/js/bitcoinjs-extensions.js b/src/js/bitcoinjs-extensions.js index a9db485..255ac86 100644 --- a/src/js/bitcoinjs-extensions.js +++ b/src/js/bitcoinjs-extensions.js @@ -1716,3 +1716,14 @@ bitcoinjs.bitcoin.networks.aryacoin = { scriptHash: 0x6f, wif: 0x97 }; + +bitcoinjs.bitcoin.networks.thought = { + messagePrefix: 'unused', + bip32: { + public: 0xFbC6A00D, + private: 0x5AEBD8C6 + }, + pubKeyHash: 0x07, + scriptHash: 0x09, + wif: 0x7B +}; diff --git a/src/js/index.js b/src/js/index.js index f3302a6..0ecb735 100644 --- a/src/js/index.js +++ b/src/js/index.js @@ -637,9 +637,9 @@ } function validateRootKey(rootKeyBase58) { - if(isGRS()) + if(isGRS()) return validateRootKeyGRS(rootKeyBase58); - + // try various segwit network params since this extended key may be from // any one of them. if (networkHasSegwit()) { @@ -991,7 +991,7 @@ privkey = keyPair.toWIF(); // BIP38 encode private key if required if (useBip38) { - if(isGRS()) + if(isGRS()) privkey = groestlcoinjsBip38.encrypt(keyPair.d.toBuffer(), false, bip38password, function(p) { console.log("Progressed " + p.percent.toFixed(1) + "% for index " + index); }, null, networks[DOM.network.val()].name.includes("Testnet")); @@ -1121,7 +1121,7 @@ else if (isP2wpkhInP2sh) { address = groestlcoinjs.address.fromOutputScript(scriptpubkey, network) } - } + } //non-segwit addresses are handled by using groestlcoinjs for bip32RootKey } @@ -2840,6 +2840,13 @@ setHdCoin(113); }, }, + { + name: "THT - Thought", + onSelect: function() { + network = bitcoinjs.bitcoin.networks.thought; + setHdCoin(1618); + }, + }, { name: "TOA - Toa", onSelect: function() { -- 2.41.0