]> git.immae.eu Git - perso/Immae/Projets/Cryptomonnaies/BIP39.git/commitdiff
Merge pull request #27 from dangershony/master
authoriancoleman <coleman.ian@gmail.com>
Wed, 24 Aug 2016 21:59:39 +0000 (07:59 +1000)
committerGitHub <noreply@github.com>
Wed, 24 Aug 2016 21:59:39 +0000 (07:59 +1000)
Adding DASH and fixing the root key network bug

bip39-standalone.html
src/js/bitcoinjs-extensions.js
src/js/index.js

index 5f9cf7cca095f2e3020ac255a9d3bea044bce6a2..9b3c4f18f8e78e90ec9a4ba1787d004a0481d6f5 100644 (file)
@@ -13353,6 +13353,17 @@ bitcoin.networks.clam = {
   pubKeyHash: 0x89,
   wif: 0x85,
 };
+
+bitcoin.networks.dash = {
+  bip32: {
+    public: 0x0488b21e,
+    private: 0x0488ade4
+  },
+  pubKeyHash: 0x4c,
+  scriptHash: 0x10,
+  wif: 0xcc,
+};
+
 </script>
         <script>// Select components from sjcl to suit the crypto operations bip39 requires.
 
@@ -15041,7 +15052,7 @@ var Mnemonic = function(language) {
     }
 
     function calcBip32RootKeyFromBase58(rootKeyBase58) {
-        bip32RootKey = bitcoin.HDNode.fromBase58(rootKeyBase58);
+        bip32RootKey = bitcoin.HDNode.fromBase58(rootKeyBase58, network);
     }
 
     function calcBip32ExtendedKey(path) {
@@ -15414,6 +15425,13 @@ var Mnemonic = function(language) {
                 DOM.bip44coin.val(23);
             },
         },
+        {
+            name: "DASH",
+            onSelect: function() {
+                network = bitcoin.networks.dash;
+                DOM.bip44coin.val(5);
+            },
+        },
     ]
 
     init();
index a7ca2ecd612be268d3aad9fe9c910b0d9dad3653..9f11de8e52e4a0ff1cbc96cedd944fa998844998 100644 (file)
@@ -34,3 +34,14 @@ bitcoin.networks.clam = {
   pubKeyHash: 0x89,
   wif: 0x85,
 };
+
+bitcoin.networks.dash = {
+  bip32: {
+    public: 0x0488b21e,
+    private: 0x0488ade4
+  },
+  pubKeyHash: 0x4c,
+  scriptHash: 0x10,
+  wif: 0xcc,
+};
+
index 8f7d658dad75b1564a5b41f55c37c18d2a65245e..5cd09b6ec2113b48739246d439877d685e2bb46d 100644 (file)
     }
 
     function calcBip32RootKeyFromBase58(rootKeyBase58) {
-        bip32RootKey = bitcoin.HDNode.fromBase58(rootKeyBase58);
+        bip32RootKey = bitcoin.HDNode.fromBase58(rootKeyBase58, network);
     }
 
     function calcBip32ExtendedKey(path) {
                 DOM.bip44coin.val(23);
             },
         },
+        {
+            name: "DASH",
+            onSelect: function() {
+                network = bitcoin.networks.dash;
+                DOM.bip44coin.val(5);
+            },
+        },
     ]
 
     init();