]> git.immae.eu Git - perso/Immae/Projets/Cryptomonnaies/BIP39.git/commitdiff
Merge pull request #410 from MerkleBlock/handshake
authoriancoleman <1281387+iancoleman@users.noreply.github.com>
Sun, 10 May 2020 22:34:35 +0000 (08:34 +1000)
committerGitHub <noreply@github.com>
Sun, 10 May 2020 22:34:35 +0000 (08:34 +1000)
libs: add handshake support

changelog.md
src/index.html
src/js/bitcoinjs-extensions.js
src/js/index.js
src/js/segwit-parameters.js
tests/spec/tests.js

index dc9842dec632e800e0155ca34e367145553de98c..ab03e2ac5ed662b9fbc19ebbf2c38d1c852ff45c 100644 (file)
@@ -1,3 +1,5 @@
+* Add Argoneum
+
 # 0.4.2
 
 * Fix ethereum private key format
index 1184a0c69aca0ae82aea0bcd08b053f5de7b72f7..ae39c1110f4dee739c4068c468711268720098d1 100644 (file)
@@ -24,7 +24,7 @@
                         <div class="form-group">
                             <div class="col-sm-2"></div>
                             <div class="col-sm-10">
-                                <p>You can enter an existing BIP39 mnemonic, or generate a new random one. Typing your own twelve words will probably not work how you expect, since the words require a particular structure (the last word is a checksum).</p>
+                                <p>You can enter an existing BIP39 mnemonic, or generate a new random one. Typing your own twelve words will probably not work how you expect, since the words require a particular structure (the last word contains a checksum).</p>
                                 <p>
                                     For more info see the
                                     <a href="https://github.com/bitcoin/bips/blob/master/bip-0039.mediawiki" target="_blank">BIP39 spec</a>.
index 17475b137c9b6ed891b5c884b44627d6fcd0fabd..2792e13388501b139f52a83295a6c5715f31b1d2 100644 (file)
@@ -1739,6 +1739,28 @@ libs.bitcoin.networks.elastos = {
     wif: 0xef // TODO set this correctly, same as BTC for now
 };
 
+libs.bitcoin.networks.sugarchain = {
+    messagePrefix: '\x18Sugarchain Signed Message:\n',
+    bip32: {
+        public: 0x0488B21E,
+        private: 0x0488ADE4,
+    },
+    pubKeyHash: 0x3f,
+    scriptHash: 0x7d,
+    wif: 0x80
+};
+
+libs.bitcoin.networks.sugarchaintestnet = {
+    messagePrefix: '\x18Sugarchain Signed Message:\n',
+    bip32: {
+        public: 0x045f1cf6,
+        private: 0x045f18bc,
+    },
+    pubKeyHash: 0x42,
+    scriptHash: 0x80,
+    wif: 0xef
+};
+
 // https://github.com/libs.bitcoinjs-lib/blob/3f6f5ef97a1ee1b8337865209282c0095e22b2e7/src/networks.js
 libs.bitcoin.networks.regtest = {
   messagePrefix: '\x18Bitcoin Signed Message:\n',
@@ -1751,3 +1773,14 @@ libs.bitcoin.networks.regtest = {
   scriptHash: 0xc4,
   wif: 0xef,
 };
+
+libs.bitcoin.networks.argoneum = {
+  messagePrefix: 'unused',
+  bip32: {
+    public: 0x0488b21e,
+    private: 0x0488ade4
+  },
+  pubKeyHash: 0x32,
+  scriptHash: 0x61,
+  wif: 0xbf
+};
index eb914a8f2eba3c92a94864eeb03504aa7b1c1501..32825b2bb2ac282fdbbe699cf24bd5b80360f015 100644 (file)
                 setHdCoin(161);
             },
         },
+        {
+            name: "AGM - Argoneum",
+            onSelect: function() {
+                network = libs.bitcoin.networks.argoneum;
+                setHdCoin(421);
+            },
+        },
         {
             name: "ARYA - Aryacoin",
             onSelect: function() {
                 setHdCoin(105);
             },
         },
+        {
+            name: "SUGAR - Sugarchain",
+            onSelect: function() {
+                network = libs.bitcoin.networks.sugarchain;
+                setHdCoin(408);
+            },
+        },
+        {
+            name: "TUGAR - Sugarchain Testnet",
+            onSelect: function() {
+                network = libs.bitcoin.networks.sugarchaintestnet;
+                setHdCoin(408);
+            },
+        },
         {
             name: "SWTC - Jingtum",
             onSelect: function() {
index d5ea419e331dba7bc23e2bd7ec36efe70b5c0454..ea6f86e382e9d9ce9e070780e368aa1ac6fe7d53 100644 (file)
@@ -683,4 +683,56 @@ libs.bitcoin.networks.deeponion.p2wpkhInP2sh = {
        wif: 0x9f
 };
 
+libs.bitcoin.networks.sugarchain.p2wpkh = {
+       baseNetwork: "sugarchain",
+       messagePrefix: '\x1DSugarchain Signed Message:\n',
+       bech32: 'sugar',
+       bip32: {
+               public: 0x04b24746,
+               private: 0x04b2430c
+       },
+       pubKeyHash: 0x3f,
+       scriptHash: 0x7d,
+       wif: 0x80
+};
+
+libs.bitcoin.networks.sugarchain.p2wpkhInP2sh = {
+       baseNetwork: "sugarchain",
+       messagePrefix: '\x1DSugarchain Signed Message:\n',
+       bech32: 'sugar',
+       bip32: {
+               public: 0x049d7cb2,
+               private: 0x049d7878
+       },
+       pubKeyHash: 0x3f,
+       scriptHash: 0x7d,
+       wif: 0x80
+};
+
+libs.bitcoin.networks.sugarchaintestnet.p2wpkh = {
+       baseNetwork: "sugarchaintestnet",
+       messagePrefix: '\x18Sugarchain Signed Message:\n',
+       bech32: 'tugar',
+       bip32: {
+               public: 0x045f1cf6,
+               private: 0x045f18bc
+       },
+       pubKeyHash: 0x42,
+       scriptHash: 0x80,
+       wif: 0xef
+};
+
+libs.bitcoin.networks.sugarchaintestnet.p2wpkhInP2sh = {
+       baseNetwork: "sugarchaintestnet",
+       messagePrefix: '\x18Sugarchain Signed Message:\n',
+       bech32: 'tugar',
+       bip32: {
+               public: 0x044a5262,
+               private: 0x044a4e28
+       },
+       pubKeyHash: 0x42,
+       scriptHash: 0x80,
+       wif: 0xef
+};
+
 })();
index 31fa043a0f3133b1414c73594a747a2dd5c93e21..15a52b30c9824ee2cd62dee62fe79e11bb741340 100644 (file)
@@ -1675,6 +1675,26 @@ it('Allows selection of Stratis Test', function(done) {
     };
     testNetwork(done, params);
 });
+it('Allows selection of Sugarchain', function(done) {
+    var params = {
+        selectText: "SUGAR - Sugarchain",
+        phrase: "abandon abandon ability",
+        firstAddress: "SYnd31fYr39VgKju87Vz1sYBmEeHg5cudk",
+        firstPubKey: "035bc9fa22eff2246ec07bb09c9e32f5f9fee517b4f49a8f117508f8fb41905b25",
+        firstPrivKey: "L2G3axGdZv5EV8osAsBPMese74i4dTHaGvxDh7DsRF5Ky6hKkPDY",
+    };
+    testNetwork(done, params);
+});
+it('Allows selection of Sugarchain Testnet', function(done) {
+    var params = {
+        selectText: "TUGAR - Sugarchain Testnet",
+        phrase: "abandon abandon ability",
+        firstAddress: "TkoRzLZQyaY88dAACNVwUFMYekR7pv6CbY",
+        firstPubKey: "035bc9fa22eff2246ec07bb09c9e32f5f9fee517b4f49a8f117508f8fb41905b25",
+        firstPrivKey: "cSd33sGUzymVeaH8ZGzWiyNhjJ1UHuPGLy6goXgNvMjLDqioARWW",
+    };
+    testNetwork(done, params);
+});
 it('Allows selection of Syscoin', function(done) {
     var params = {
         selectText: "SYS - Syscoin",
@@ -2216,6 +2236,16 @@ it('Allows selection of tRBTC - RSK Testnet', function(done) {
     };
     testNetwork(done, params);
 });
+it('Allows selection of Argoneum', function(done) {
+    var params = {
+        selectText: "AGM - Argoneum",
+        phrase: "abandon abandon ability",
+        firstAddress: "MWgLPvJkaJwH6hrXFs1MimAC4FwC1kYRhe",
+        firstPubKey: "0348e5252045fee1d3b1e5bce25dbc16284d5b6c3bfff9c305d4ffa6078c16f3f8",
+        firstPrivKey: "VJXpuMEFnK8USLyo5tgF7M4cBXU44U8MUor1KRTQ6t9DVno9AAgg",
+    };
+    testNetwork(done, params);
+});
 
 // BIP39 seed is set from phrase
 it('Sets the bip39 seed from the prhase', function(done) {