aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--bip39-standalone.html91
-rw-r--r--changelog.md6
-rw-r--r--src/index.html2
3 files changed, 60 insertions, 39 deletions
diff --git a/bip39-standalone.html b/bip39-standalone.html
index f268cae..18b2220 100644
--- a/bip39-standalone.html
+++ b/bip39-standalone.html
@@ -118,7 +118,7 @@
118 <div class="container"> 118 <div class="container">
119 119
120 <h1 class="text-center">Mnemonic Code Converter</h1> 120 <h1 class="text-center">Mnemonic Code Converter</h1>
121 <p class="version">v0.2.4</p> 121 <p class="version">v0.2.5</p>
122 <hr> 122 <hr>
123 <div class="row"> 123 <div class="row">
124 <div class="col-md-12"> 124 <div class="col-md-12">
@@ -413,6 +413,13 @@
413 </label> 413 </label>
414 </div> 414 </div>
415 <div class="form-group"> 415 <div class="form-group">
416 <div class="col-sm-2"></div>
417 <label class="col-sm-10">
418 <input class="p2wpkh-nested-in-p2sh" type="checkbox">
419 <span data-translate>Use SegWit addresses (ie P2WPKH Nested In P2SH)</span>
420 </label>
421 </div>
422 <div class="form-group">
416 <label for="core-path" class="col-sm-2 control-label" data-translate>Bitcoin Core</label> 423 <label for="core-path" class="col-sm-2 control-label" data-translate>Bitcoin Core</label>
417 <div class="col-sm-10"> 424 <div class="col-sm-10">
418 <p class="form-control no-border" data-translate-html> 425 <p class="form-control no-border" data-translate-html>
@@ -46190,6 +46197,7 @@ window.Entropy = new (function() {
46190 DOM.bip49change = $("#bip49 .change"); 46197 DOM.bip49change = $("#bip49 .change");
46191 DOM.generatedStrength = $(".generate-container .strength"); 46198 DOM.generatedStrength = $(".generate-container .strength");
46192 DOM.hardenedAddresses = $(".hardened-addresses"); 46199 DOM.hardenedAddresses = $(".hardened-addresses");
46200 DOM.useP2wpkhNestedInP2sh = $(".p2wpkh-nested-in-p2sh");
46193 DOM.addresses = $(".addresses"); 46201 DOM.addresses = $(".addresses");
46194 DOM.rowsToAdd = $(".rows-to-add"); 46202 DOM.rowsToAdd = $(".rows-to-add");
46195 DOM.more = $(".more"); 46203 DOM.more = $(".more");
@@ -46226,6 +46234,7 @@ window.Entropy = new (function() {
46226 DOM.bip49change.on("input", calcForDerivationPath); 46234 DOM.bip49change.on("input", calcForDerivationPath);
46227 DOM.tab.on("shown.bs.tab", calcForDerivationPath); 46235 DOM.tab.on("shown.bs.tab", calcForDerivationPath);
46228 DOM.hardenedAddresses.on("change", calcForDerivationPath); 46236 DOM.hardenedAddresses.on("change", calcForDerivationPath);
46237 DOM.useP2wpkhNestedInP2sh.on("change", calcForDerivationPath);
46229 DOM.indexToggle.on("click", toggleIndexes); 46238 DOM.indexToggle.on("click", toggleIndexes);
46230 DOM.addressToggle.on("click", toggleAddresses); 46239 DOM.addressToggle.on("click", toggleAddresses);
46231 DOM.publicKeyToggle.on("click", togglePublicKeys); 46240 DOM.publicKeyToggle.on("click", togglePublicKeys);
@@ -46248,11 +46257,11 @@ window.Entropy = new (function() {
46248 var networkIndex = e.target.value; 46257 var networkIndex = e.target.value;
46249 var network = networks[networkIndex]; 46258 var network = networks[networkIndex];
46250 network.onSelect(); 46259 network.onSelect();
46251 if (network.bip49available) { 46260 if (network.p2wpkhNestedInP2shAvailable) {
46252 showBip49(); 46261 showP2wpkhNestedInP2shAvailable();
46253 } 46262 }
46254 else { 46263 else {
46255 hideBip49(); 46264 showP2wpkhNestedInP2shUnavailable();
46256 } 46265 }
46257 if (seed != null) { 46266 if (seed != null) {
46258 phraseChanged(); 46267 phraseChanged();
@@ -46384,7 +46393,6 @@ window.Entropy = new (function() {
46384 function rootKeyChanged() { 46393 function rootKeyChanged() {
46385 showPending(); 46394 showPending();
46386 hideValidationError(); 46395 hideValidationError();
46387 // Validate the root key TODO
46388 var rootKeyBase58 = DOM.rootKey.val(); 46396 var rootKeyBase58 = DOM.rootKey.val();
46389 var errorText = validateRootKey(rootKeyBase58); 46397 var errorText = validateRootKey(rootKeyBase58);
46390 if (errorText) { 46398 if (errorText) {
@@ -46577,7 +46585,7 @@ window.Entropy = new (function() {
46577 46585
46578 function validateRootKey(rootKeyBase58) { 46586 function validateRootKey(rootKeyBase58) {
46579 try { 46587 try {
46580 bitcoinjs.bitcoin.HDNode.fromBase58(rootKeyBase58); 46588 bitcoinjs.bitcoin.HDNode.fromBase58(rootKeyBase58, network);
46581 } 46589 }
46582 catch (e) { 46590 catch (e) {
46583 return "Invalid root key"; 46591 return "Invalid root key";
@@ -46755,8 +46763,8 @@ window.Entropy = new (function() {
46755 var self = this; 46763 var self = this;
46756 this.shouldGenerate = true; 46764 this.shouldGenerate = true;
46757 var useHardenedAddresses = DOM.hardenedAddresses.prop("checked"); 46765 var useHardenedAddresses = DOM.hardenedAddresses.prop("checked");
46758 var isBip49 = bip49TabSelected(); 46766 var isP2wpkhNestedInP2sh = bip49TabSelected() || (bip32TabSelected() && useP2wpkhNestedInP2sh());
46759 var bip49available = networkHasBip49(); 46767 var p2wpkhNestedInP2shAvailable = networkHasBip49();
46760 46768
46761 function init() { 46769 function init() {
46762 calculateValues(); 46770 calculateValues();
@@ -46801,8 +46809,8 @@ window.Entropy = new (function() {
46801 address = convertRippleAdrr(address); 46809 address = convertRippleAdrr(address);
46802 } 46810 }
46803 // BIP49 addresses are different 46811 // BIP49 addresses are different
46804 if (isBip49) { 46812 if (isP2wpkhNestedInP2sh) {
46805 if (!bip49available) { 46813 if (!p2wpkhNestedInP2shAvailable) {
46806 return; 46814 return;
46807 } 46815 }
46808 var keyhash = bitcoinjs.bitcoin.crypto.hash160(key.getPublicKeyBuffer()); 46816 var keyhash = bitcoinjs.bitcoin.crypto.hash160(key.getPublicKeyBuffer());
@@ -47282,8 +47290,12 @@ window.Entropy = new (function() {
47282 return DOM.bip32tab.hasClass("active"); 47290 return DOM.bip32tab.hasClass("active");
47283 } 47291 }
47284 47292
47293 function useP2wpkhNestedInP2sh() {
47294 return DOM.useP2wpkhNestedInP2sh.prop("checked");
47295 }
47296
47285 function networkHasBip49() { 47297 function networkHasBip49() {
47286 return networks[DOM.network.val()].bip49available; 47298 return networks[DOM.network.val()].p2wpkhNestedInP2shAvailable;
47287 } 47299 }
47288 47300
47289 function bip49TabSelected() { 47301 function bip49TabSelected() {
@@ -47295,20 +47307,23 @@ window.Entropy = new (function() {
47295 DOM.bip49coin.val(coinValue); 47307 DOM.bip49coin.val(coinValue);
47296 } 47308 }
47297 47309
47298 function showBip49() { 47310 function showP2wpkhNestedInP2shAvailable() {
47299 DOM.bip49unavailable.addClass("hidden"); 47311 DOM.bip49unavailable.addClass("hidden");
47300 DOM.bip49available.removeClass("hidden"); 47312 DOM.bip49available.removeClass("hidden");
47313 DOM.useP2wpkhNestedInP2sh.prop("disabled", false);
47301 } 47314 }
47302 47315
47303 function hideBip49() { 47316 function showP2wpkhNestedInP2shUnavailable() {
47304 DOM.bip49available.addClass("hidden"); 47317 DOM.bip49available.addClass("hidden");
47305 DOM.bip49unavailable.removeClass("hidden"); 47318 DOM.bip49unavailable.removeClass("hidden");
47319 DOM.useP2wpkhNestedInP2sh.prop("disabled", true);
47320 DOM.useP2wpkhNestedInP2sh.prop("checked", false);
47306 } 47321 }
47307 47322
47308 var networks = [ 47323 var networks = [
47309 { 47324 {
47310 name: "BCH - Bitcoin Cash", 47325 name: "BCH - Bitcoin Cash",
47311 bip49available: false, 47326 p2wpkhNestedInP2shAvailable: false,
47312 onSelect: function() { 47327 onSelect: function() {
47313 network = bitcoinjs.bitcoin.networks.bitcoin; 47328 network = bitcoinjs.bitcoin.networks.bitcoin;
47314 setHdCoin(145); 47329 setHdCoin(145);
@@ -47316,7 +47331,7 @@ window.Entropy = new (function() {
47316 }, 47331 },
47317 { 47332 {
47318 name: "BTC - Bitcoin", 47333 name: "BTC - Bitcoin",
47319 bip49available: true, 47334 p2wpkhNestedInP2shAvailable: true,
47320 onSelect: function() { 47335 onSelect: function() {
47321 network = bitcoinjs.bitcoin.networks.bitcoin; 47336 network = bitcoinjs.bitcoin.networks.bitcoin;
47322 setHdCoin(0); 47337 setHdCoin(0);
@@ -47324,7 +47339,7 @@ window.Entropy = new (function() {
47324 }, 47339 },
47325 { 47340 {
47326 name: "BTC - Bitcoin Testnet", 47341 name: "BTC - Bitcoin Testnet",
47327 bip49available: true, 47342 p2wpkhNestedInP2shAvailable: true,
47328 onSelect: function() { 47343 onSelect: function() {
47329 network = bitcoinjs.bitcoin.networks.testnet; 47344 network = bitcoinjs.bitcoin.networks.testnet;
47330 setHdCoin(1); 47345 setHdCoin(1);
@@ -47332,7 +47347,7 @@ window.Entropy = new (function() {
47332 }, 47347 },
47333 { 47348 {
47334 name: "CLAM - Clams", 47349 name: "CLAM - Clams",
47335 bip49available: false, 47350 p2wpkhNestedInP2shAvailable: false,
47336 onSelect: function() { 47351 onSelect: function() {
47337 network = bitcoinjs.bitcoin.networks.clam; 47352 network = bitcoinjs.bitcoin.networks.clam;
47338 setHdCoin(23); 47353 setHdCoin(23);
@@ -47340,7 +47355,7 @@ window.Entropy = new (function() {
47340 }, 47355 },
47341 { 47356 {
47342 name: "CRW - Crown", 47357 name: "CRW - Crown",
47343 bip49available: false, 47358 p2wpkhNestedInP2shAvailable: false,
47344 onSelect: function() { 47359 onSelect: function() {
47345 network = bitcoinjs.bitcoin.networks.crown; 47360 network = bitcoinjs.bitcoin.networks.crown;
47346 setHdCoin(72); 47361 setHdCoin(72);
@@ -47348,7 +47363,7 @@ window.Entropy = new (function() {
47348 }, 47363 },
47349 { 47364 {
47350 name: "DASH - Dash", 47365 name: "DASH - Dash",
47351 bip49available: false, 47366 p2wpkhNestedInP2shAvailable: false,
47352 onSelect: function() { 47367 onSelect: function() {
47353 network = bitcoinjs.bitcoin.networks.dash; 47368 network = bitcoinjs.bitcoin.networks.dash;
47354 setHdCoin(5); 47369 setHdCoin(5);
@@ -47356,7 +47371,7 @@ window.Entropy = new (function() {
47356 }, 47371 },
47357 { 47372 {
47358 name: "DASH - Dash Testnet", 47373 name: "DASH - Dash Testnet",
47359 bip49available: false, 47374 p2wpkhNestedInP2shAvailable: false,
47360 onSelect: function() { 47375 onSelect: function() {
47361 network = bitcoinjs.bitcoin.networks.dashtn; 47376 network = bitcoinjs.bitcoin.networks.dashtn;
47362 setHdCoin(1); 47377 setHdCoin(1);
@@ -47364,7 +47379,7 @@ window.Entropy = new (function() {
47364 }, 47379 },
47365 { 47380 {
47366 name: "DOGE - Dogecoin", 47381 name: "DOGE - Dogecoin",
47367 bip49available: false, 47382 p2wpkhNestedInP2shAvailable: false,
47368 onSelect: function() { 47383 onSelect: function() {
47369 network = bitcoinjs.bitcoin.networks.dogecoin; 47384 network = bitcoinjs.bitcoin.networks.dogecoin;
47370 setHdCoin(3); 47385 setHdCoin(3);
@@ -47372,7 +47387,7 @@ window.Entropy = new (function() {
47372 }, 47387 },
47373 { 47388 {
47374 name: "ETH - Ethereum", 47389 name: "ETH - Ethereum",
47375 bip49available: false, 47390 p2wpkhNestedInP2shAvailable: false,
47376 onSelect: function() { 47391 onSelect: function() {
47377 network = bitcoinjs.bitcoin.networks.bitcoin; 47392 network = bitcoinjs.bitcoin.networks.bitcoin;
47378 setHdCoin(60); 47393 setHdCoin(60);
@@ -47380,7 +47395,7 @@ window.Entropy = new (function() {
47380 }, 47395 },
47381 { 47396 {
47382 name: "GAME - GameCredits", 47397 name: "GAME - GameCredits",
47383 bip49available: false, 47398 p2wpkhNestedInP2shAvailable: false,
47384 onSelect: function() { 47399 onSelect: function() {
47385 network = bitcoinjs.bitcoin.networks.game; 47400 network = bitcoinjs.bitcoin.networks.game;
47386 setHdCoin(101); 47401 setHdCoin(101);
@@ -47388,7 +47403,7 @@ window.Entropy = new (function() {
47388 }, 47403 },
47389 { 47404 {
47390 name: "JBS - Jumbucks", 47405 name: "JBS - Jumbucks",
47391 bip49available: false, 47406 p2wpkhNestedInP2shAvailable: false,
47392 onSelect: function() { 47407 onSelect: function() {
47393 network = bitcoinjs.bitcoin.networks.jumbucks; 47408 network = bitcoinjs.bitcoin.networks.jumbucks;
47394 setHdCoin(26); 47409 setHdCoin(26);
@@ -47396,7 +47411,7 @@ window.Entropy = new (function() {
47396 }, 47411 },
47397 { 47412 {
47398 name: "LTC - Litecoin", 47413 name: "LTC - Litecoin",
47399 bip49available: false, 47414 p2wpkhNestedInP2shAvailable: false,
47400 onSelect: function() { 47415 onSelect: function() {
47401 network = bitcoinjs.bitcoin.networks.litecoin; 47416 network = bitcoinjs.bitcoin.networks.litecoin;
47402 setHdCoin(2); 47417 setHdCoin(2);
@@ -47405,7 +47420,7 @@ window.Entropy = new (function() {
47405 }, 47420 },
47406 { 47421 {
47407 name: "MAZA - Maza", 47422 name: "MAZA - Maza",
47408 bip49available: false, 47423 p2wpkhNestedInP2shAvailable: false,
47409 onSelect: function() { 47424 onSelect: function() {
47410 network = bitcoinjs.bitcoin.networks.maza; 47425 network = bitcoinjs.bitcoin.networks.maza;
47411 setHdCoin(13); 47426 setHdCoin(13);
@@ -47414,7 +47429,7 @@ window.Entropy = new (function() {
47414 47429
47415 { 47430 {
47416 name: "NMC - Namecoin", 47431 name: "NMC - Namecoin",
47417 bip49available: false, 47432 p2wpkhNestedInP2shAvailable: false,
47418 onSelect: function() { 47433 onSelect: function() {
47419 network = bitcoinjs.bitcoin.networks.namecoin; 47434 network = bitcoinjs.bitcoin.networks.namecoin;
47420 setHdCoin(7); 47435 setHdCoin(7);
@@ -47422,7 +47437,7 @@ window.Entropy = new (function() {
47422 }, 47437 },
47423 { 47438 {
47424 name: "PIVX - PIVX", 47439 name: "PIVX - PIVX",
47425 bip49available: false, 47440 p2wpkhNestedInP2shAvailable: false,
47426 onSelect: function() { 47441 onSelect: function() {
47427 network = bitcoinjs.bitcoin.networks.pivx; 47442 network = bitcoinjs.bitcoin.networks.pivx;
47428 setHdCoin(119); 47443 setHdCoin(119);
@@ -47430,7 +47445,7 @@ window.Entropy = new (function() {
47430 }, 47445 },
47431 { 47446 {
47432 name: "PIVX - PIVX Testnet", 47447 name: "PIVX - PIVX Testnet",
47433 bip49available: false, 47448 p2wpkhNestedInP2shAvailable: false,
47434 onSelect: function() { 47449 onSelect: function() {
47435 network = bitcoinjs.bitcoin.networks.pivxtestnet; 47450 network = bitcoinjs.bitcoin.networks.pivxtestnet;
47436 setHdCoin(1); 47451 setHdCoin(1);
@@ -47438,7 +47453,7 @@ window.Entropy = new (function() {
47438 }, 47453 },
47439 { 47454 {
47440 name: "PPC - Peercoin", 47455 name: "PPC - Peercoin",
47441 bip49available: false, 47456 p2wpkhNestedInP2shAvailable: false,
47442 onSelect: function() { 47457 onSelect: function() {
47443 network = bitcoinjs.bitcoin.networks.peercoin; 47458 network = bitcoinjs.bitcoin.networks.peercoin;
47444 setHdCoin(6); 47459 setHdCoin(6);
@@ -47446,7 +47461,7 @@ window.Entropy = new (function() {
47446 }, 47461 },
47447 { 47462 {
47448 name: "SDC - ShadowCash", 47463 name: "SDC - ShadowCash",
47449 bip49available: false, 47464 p2wpkhNestedInP2shAvailable: false,
47450 onSelect: function() { 47465 onSelect: function() {
47451 network = bitcoinjs.bitcoin.networks.shadow; 47466 network = bitcoinjs.bitcoin.networks.shadow;
47452 setHdCoin(35); 47467 setHdCoin(35);
@@ -47454,7 +47469,7 @@ window.Entropy = new (function() {
47454 }, 47469 },
47455 { 47470 {
47456 name: "SDC - ShadowCash Testnet", 47471 name: "SDC - ShadowCash Testnet",
47457 bip49available: false, 47472 p2wpkhNestedInP2shAvailable: false,
47458 onSelect: function() { 47473 onSelect: function() {
47459 network = bitcoinjs.bitcoin.networks.shadowtn; 47474 network = bitcoinjs.bitcoin.networks.shadowtn;
47460 setHdCoin(1); 47475 setHdCoin(1);
@@ -47462,7 +47477,7 @@ window.Entropy = new (function() {
47462 }, 47477 },
47463 { 47478 {
47464 name: "SLM - Slimcoin", 47479 name: "SLM - Slimcoin",
47465 bip49available: false, 47480 p2wpkhNestedInP2shAvailable: false,
47466 onSelect: function() { 47481 onSelect: function() {
47467 network = bitcoinjs.bitcoin.networks.slimcoin; 47482 network = bitcoinjs.bitcoin.networks.slimcoin;
47468 setHdCoin(63); 47483 setHdCoin(63);
@@ -47470,7 +47485,7 @@ window.Entropy = new (function() {
47470 }, 47485 },
47471 { 47486 {
47472 name: "SLM - Slimcoin Testnet", 47487 name: "SLM - Slimcoin Testnet",
47473 bip49available: false, 47488 p2wpkhNestedInP2shAvailable: false,
47474 onSelect: function() { 47489 onSelect: function() {
47475 network = bitcoinjs.bitcoin.networks.slimcointn; 47490 network = bitcoinjs.bitcoin.networks.slimcointn;
47476 setHdCoin(111); 47491 setHdCoin(111);
@@ -47478,7 +47493,7 @@ window.Entropy = new (function() {
47478 }, 47493 },
47479 { 47494 {
47480 name: "VIA - Viacoin", 47495 name: "VIA - Viacoin",
47481 bip49available: false, 47496 p2wpkhNestedInP2shAvailable: false,
47482 onSelect: function() { 47497 onSelect: function() {
47483 network = bitcoinjs.bitcoin.networks.viacoin; 47498 network = bitcoinjs.bitcoin.networks.viacoin;
47484 setHdCoin(14); 47499 setHdCoin(14);
@@ -47486,7 +47501,7 @@ window.Entropy = new (function() {
47486 }, 47501 },
47487 { 47502 {
47488 name: "VIA - Viacoin Testnet", 47503 name: "VIA - Viacoin Testnet",
47489 bip49available: false, 47504 p2wpkhNestedInP2shAvailable: false,
47490 onSelect: function() { 47505 onSelect: function() {
47491 network = bitcoinjs.bitcoin.networks.viacointestnet; 47506 network = bitcoinjs.bitcoin.networks.viacointestnet;
47492 setHdCoin(1); 47507 setHdCoin(1);
@@ -47494,7 +47509,7 @@ window.Entropy = new (function() {
47494 }, 47509 },
47495 { 47510 {
47496 name: "XMY - Myriadcoin", 47511 name: "XMY - Myriadcoin",
47497 bip49available: false, 47512 p2wpkhNestedInP2shAvailable: false,
47498 onSelect: function() { 47513 onSelect: function() {
47499 network = bitcoinjs.bitcoin.networks.myriadcoin; 47514 network = bitcoinjs.bitcoin.networks.myriadcoin;
47500 setHdCoin(90); 47515 setHdCoin(90);
@@ -47502,7 +47517,7 @@ window.Entropy = new (function() {
47502 }, 47517 },
47503 { 47518 {
47504 name: "XRP - Ripple", 47519 name: "XRP - Ripple",
47505 bip49available: false, 47520 p2wpkhNestedInP2shAvailable: false,
47506 onSelect: function() { 47521 onSelect: function() {
47507 network = bitcoinjs.bitcoin.networks.bitcoin; 47522 network = bitcoinjs.bitcoin.networks.bitcoin;
47508 setHdCoin(144); 47523 setHdCoin(144);
diff --git a/changelog.md b/changelog.md
index d41aa5e..13ecc3c 100644
--- a/changelog.md
+++ b/changelog.md
@@ -1,3 +1,9 @@
1# 0.2.5
2
3* Rename variables for clarity between BIP49 and P2WPKH Nested In P2SH
4* Fix bug for validation of root key when using non-bitcoin networks
5* Add option to use P2WPKH Nested In P2SH addresses on BIP32 tab
6
1# 0.2.4 7# 0.2.4
2 8
3* Show error when using xpub with hardened addresses 9* Show error when using xpub with hardened addresses
diff --git a/src/index.html b/src/index.html
index 905f9ea..faed1ec 100644
--- a/src/index.html
+++ b/src/index.html
@@ -114,7 +114,7 @@
114 <div class="container"> 114 <div class="container">
115 115
116 <h1 class="text-center">Mnemonic Code Converter</h1> 116 <h1 class="text-center">Mnemonic Code Converter</h1>
117 <p class="version">v0.2.4</p> 117 <p class="version">v0.2.5</p>
118 <hr> 118 <hr>
119 <div class="row"> 119 <div class="row">
120 <div class="col-md-12"> 120 <div class="col-md-12">