diff options
author | Andrew <ajhacker@mistiqtech.com> | 2019-11-05 11:26:58 -0500 |
---|---|---|
committer | Andrew <ajhacker@mistiqtech.com> | 2019-11-05 11:26:58 -0500 |
commit | 75138beed936c7cd30757ee263f7c7fd5009f5b0 (patch) | |
tree | 74752768b05eaeb3c1758ba1f82f7e02f6332530 | |
parent | bc32c841663821ba94c12afc5a7e73d689c7b153 (diff) | |
download | BIP39-75138beed936c7cd30757ee263f7c7fd5009f5b0.tar.gz BIP39-75138beed936c7cd30757ee263f7c7fd5009f5b0.tar.zst BIP39-75138beed936c7cd30757ee263f7c7fd5009f5b0.zip |
added Thought network spec
-rw-r--r-- | changelog.md | 4 | ||||
-rw-r--r-- | src/index.html | 2 | ||||
-rw-r--r-- | src/js/bitcoinjs-extensions.js | 11 | ||||
-rw-r--r-- | 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 @@ | |||
1 | # 0.3.13 | ||
2 | |||
3 | * Add Thought network | ||
4 | |||
1 | # 0.3.12 | 5 | # 0.3.12 |
2 | 6 | ||
3 | * Fix typos | 7 | * 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 @@ | |||
15 | <div class="container"> | 15 | <div class="container"> |
16 | 16 | ||
17 | <h1 class="text-center">Mnemonic Code Converter</h1> | 17 | <h1 class="text-center">Mnemonic Code Converter</h1> |
18 | <p class="version">v0.3.12</p> | 18 | <p class="version">v0.3.13</p> |
19 | <hr> | 19 | <hr> |
20 | <div class="row"> | 20 | <div class="row"> |
21 | <div class="col-md-12"> | 21 | <div class="col-md-12"> |
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 = { | |||
1716 | scriptHash: 0x6f, | 1716 | scriptHash: 0x6f, |
1717 | wif: 0x97 | 1717 | wif: 0x97 |
1718 | }; | 1718 | }; |
1719 | |||
1720 | bitcoinjs.bitcoin.networks.thought = { | ||
1721 | messagePrefix: 'unused', | ||
1722 | bip32: { | ||
1723 | public: 0xFbC6A00D, | ||
1724 | private: 0x5AEBD8C6 | ||
1725 | }, | ||
1726 | pubKeyHash: 0x07, | ||
1727 | scriptHash: 0x09, | ||
1728 | wif: 0x7B | ||
1729 | }; | ||
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 @@ | |||
637 | } | 637 | } |
638 | 638 | ||
639 | function validateRootKey(rootKeyBase58) { | 639 | function validateRootKey(rootKeyBase58) { |
640 | if(isGRS()) | 640 | if(isGRS()) |
641 | return validateRootKeyGRS(rootKeyBase58); | 641 | return validateRootKeyGRS(rootKeyBase58); |
642 | 642 | ||
643 | // try various segwit network params since this extended key may be from | 643 | // try various segwit network params since this extended key may be from |
644 | // any one of them. | 644 | // any one of them. |
645 | if (networkHasSegwit()) { | 645 | if (networkHasSegwit()) { |
@@ -991,7 +991,7 @@ | |||
991 | privkey = keyPair.toWIF(); | 991 | privkey = keyPair.toWIF(); |
992 | // BIP38 encode private key if required | 992 | // BIP38 encode private key if required |
993 | if (useBip38) { | 993 | if (useBip38) { |
994 | if(isGRS()) | 994 | if(isGRS()) |
995 | privkey = groestlcoinjsBip38.encrypt(keyPair.d.toBuffer(), false, bip38password, function(p) { | 995 | privkey = groestlcoinjsBip38.encrypt(keyPair.d.toBuffer(), false, bip38password, function(p) { |
996 | console.log("Progressed " + p.percent.toFixed(1) + "% for index " + index); | 996 | console.log("Progressed " + p.percent.toFixed(1) + "% for index " + index); |
997 | }, null, networks[DOM.network.val()].name.includes("Testnet")); | 997 | }, null, networks[DOM.network.val()].name.includes("Testnet")); |
@@ -1121,7 +1121,7 @@ | |||
1121 | else if (isP2wpkhInP2sh) { | 1121 | else if (isP2wpkhInP2sh) { |
1122 | address = groestlcoinjs.address.fromOutputScript(scriptpubkey, network) | 1122 | address = groestlcoinjs.address.fromOutputScript(scriptpubkey, network) |
1123 | } | 1123 | } |
1124 | } | 1124 | } |
1125 | //non-segwit addresses are handled by using groestlcoinjs for bip32RootKey | 1125 | //non-segwit addresses are handled by using groestlcoinjs for bip32RootKey |
1126 | } | 1126 | } |
1127 | 1127 | ||
@@ -2841,6 +2841,13 @@ | |||
2841 | }, | 2841 | }, |
2842 | }, | 2842 | }, |
2843 | { | 2843 | { |
2844 | name: "THT - Thought", | ||
2845 | onSelect: function() { | ||
2846 | network = bitcoinjs.bitcoin.networks.thought; | ||
2847 | setHdCoin(1618); | ||
2848 | }, | ||
2849 | }, | ||
2850 | { | ||
2844 | name: "TOA - Toa", | 2851 | name: "TOA - Toa", |
2845 | onSelect: function() { | 2852 | onSelect: function() { |
2846 | network = bitcoinjs.bitcoin.networks.toa; | 2853 | network = bitcoinjs.bitcoin.networks.toa; |