X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=bip39-standalone.html;h=5f9cf7cca095f2e3020ac255a9d3bea044bce6a2;hb=82f91834f640eb66f9f5ab01f9df37cf805bc13b;hp=9d0de5ed924b76f9a1ef1f11ffd5f634270b762a;hpb=efe41586705d3eba480da31bb1002c4e54e73ef0;p=perso%2FImmae%2FProjets%2FCryptomonnaies%2FBIP39.git diff --git a/bip39-standalone.html b/bip39-standalone.html index 9d0de5e..5f9cf7c 100644 --- a/bip39-standalone.html +++ b/bip39-standalone.html @@ -71,14 +71,14 @@
@@ -190,6 +190,13 @@
+
+
+ +
@@ -208,6 +215,15 @@

+
+ +
+

+ Use path m/0'/0' with hardened addresses. + For more info see the Bitcoin Core BIP32 implementation +

+
+
@@ -14853,6 +14869,7 @@ var Mnemonic = function(language) { DOM.bip44account = $("#bip44 .account"); DOM.bip44change = $("#bip44 .change"); DOM.strength = $(".strength"); + DOM.hardenedAddresses = $(".hardened-addresses"); DOM.addresses = $(".addresses"); DOM.rowsToAdd = $(".rows-to-add"); DOM.more = $(".more"); @@ -14876,6 +14893,7 @@ var Mnemonic = function(language) { DOM.bip44account.on("input", calcForDerivationPath); DOM.bip44change.on("input", calcForDerivationPath); DOM.tab.on("shown.bs.tab", calcForDerivationPath); + DOM.hardenedAddresses.on("change", calcForDerivationPath); DOM.indexToggle.on("click", toggleIndexes); DOM.addressToggle.on("click", toggleAddresses); DOM.privateKeyToggle.on("click", togglePrivateKeys); @@ -14888,9 +14906,14 @@ var Mnemonic = function(language) { // Event handlers function networkChanged(e) { - var network = e.target.value; - networks[network].onSelect(); - displayBip32Info(); + var networkIndex = e.target.value; + networks[networkIndex].onSelect(); + if (seed != null) { + phraseChanged(); + } + else { + rootKeyChanged(); + } } function delayedPhraseChanged() { @@ -15180,16 +15203,27 @@ var Mnemonic = function(language) { function TableRow(index) { + var useHardenedAddresses = DOM.hardenedAddresses.prop("checked"); + function init() { calculateValues(); } function calculateValues() { setTimeout(function() { - var key = bip32ExtendedKey.derive(index); + var key = ""; + if (useHardenedAddresses) { + key = bip32ExtendedKey.deriveHardened(index); + } + else { + key = bip32ExtendedKey.derive(index); + } var address = key.getAddress().toString(); var privkey = key.privKey.toWIF(network); var indexText = getDerivationPath() + "/" + index; + if (useHardenedAddresses) { + indexText = indexText + "'"; + } addAddressToList(indexText, address, privkey); }, 50) }