aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoriancoleman <coleman.ian@gmail.com>2016-08-25 07:59:39 +1000
committerGitHub <noreply@github.com>2016-08-25 07:59:39 +1000
commit8ecffe72af4091193870d970c58688ae87b4cc59 (patch)
tree72e8932d529ea34e7db7701bccf2d20950463758
parent06c4c6e31411158c1e9ff1943f12886991005120 (diff)
parent3821c0d34596dbbf7ff1ba9ce02b54ca4e0d9fda (diff)
downloadBIP39-8ecffe72af4091193870d970c58688ae87b4cc59.tar.gz
BIP39-8ecffe72af4091193870d970c58688ae87b4cc59.tar.zst
BIP39-8ecffe72af4091193870d970c58688ae87b4cc59.zip
Merge pull request #27 from dangershony/master
Adding DASH and fixing the root key network bug
-rw-r--r--bip39-standalone.html20
-rw-r--r--src/js/bitcoinjs-extensions.js11
-rw-r--r--src/js/index.js9
3 files changed, 38 insertions, 2 deletions
diff --git a/bip39-standalone.html b/bip39-standalone.html
index 5f9cf7c..9b3c4f1 100644
--- a/bip39-standalone.html
+++ b/bip39-standalone.html
@@ -13353,6 +13353,17 @@ bitcoin.networks.clam = {
13353 pubKeyHash: 0x89, 13353 pubKeyHash: 0x89,
13354 wif: 0x85, 13354 wif: 0x85,
13355}; 13355};
13356
13357bitcoin.networks.dash = {
13358 bip32: {
13359 public: 0x0488b21e,
13360 private: 0x0488ade4
13361 },
13362 pubKeyHash: 0x4c,
13363 scriptHash: 0x10,
13364 wif: 0xcc,
13365};
13366
13356</script> 13367</script>
13357 <script>// Select components from sjcl to suit the crypto operations bip39 requires. 13368 <script>// Select components from sjcl to suit the crypto operations bip39 requires.
13358 13369
@@ -15041,7 +15052,7 @@ var Mnemonic = function(language) {
15041 } 15052 }
15042 15053
15043 function calcBip32RootKeyFromBase58(rootKeyBase58) { 15054 function calcBip32RootKeyFromBase58(rootKeyBase58) {
15044 bip32RootKey = bitcoin.HDNode.fromBase58(rootKeyBase58); 15055 bip32RootKey = bitcoin.HDNode.fromBase58(rootKeyBase58, network);
15045 } 15056 }
15046 15057
15047 function calcBip32ExtendedKey(path) { 15058 function calcBip32ExtendedKey(path) {
@@ -15414,6 +15425,13 @@ var Mnemonic = function(language) {
15414 DOM.bip44coin.val(23); 15425 DOM.bip44coin.val(23);
15415 }, 15426 },
15416 }, 15427 },
15428 {
15429 name: "DASH",
15430 onSelect: function() {
15431 network = bitcoin.networks.dash;
15432 DOM.bip44coin.val(5);
15433 },
15434 },
15417 ] 15435 ]
15418 15436
15419 init(); 15437 init();
diff --git a/src/js/bitcoinjs-extensions.js b/src/js/bitcoinjs-extensions.js
index a7ca2ec..9f11de8 100644
--- a/src/js/bitcoinjs-extensions.js
+++ b/src/js/bitcoinjs-extensions.js
@@ -34,3 +34,14 @@ bitcoin.networks.clam = {
34 pubKeyHash: 0x89, 34 pubKeyHash: 0x89,
35 wif: 0x85, 35 wif: 0x85,
36}; 36};
37
38bitcoin.networks.dash = {
39 bip32: {
40 public: 0x0488b21e,
41 private: 0x0488ade4
42 },
43 pubKeyHash: 0x4c,
44 scriptHash: 0x10,
45 wif: 0xcc,
46};
47
diff --git a/src/js/index.js b/src/js/index.js
index 8f7d658..5cd09b6 100644
--- a/src/js/index.js
+++ b/src/js/index.js
@@ -207,7 +207,7 @@
207 } 207 }
208 208
209 function calcBip32RootKeyFromBase58(rootKeyBase58) { 209 function calcBip32RootKeyFromBase58(rootKeyBase58) {
210 bip32RootKey = bitcoin.HDNode.fromBase58(rootKeyBase58); 210 bip32RootKey = bitcoin.HDNode.fromBase58(rootKeyBase58, network);
211 } 211 }
212 212
213 function calcBip32ExtendedKey(path) { 213 function calcBip32ExtendedKey(path) {
@@ -580,6 +580,13 @@
580 DOM.bip44coin.val(23); 580 DOM.bip44coin.val(23);
581 }, 581 },
582 }, 582 },
583 {
584 name: "DASH",
585 onSelect: function() {
586 network = bitcoin.networks.dash;
587 DOM.bip44coin.val(5);
588 },
589 },
583 ] 590 ]
584 591
585 init(); 592 init();