diff options
Diffstat (limited to 'bip39-standalone.html')
-rw-r--r-- | bip39-standalone.html | 31 |
1 files changed, 30 insertions, 1 deletions
diff --git a/bip39-standalone.html b/bip39-standalone.html index 9d0de5e..5230003 100644 --- a/bip39-standalone.html +++ b/bip39-standalone.html | |||
@@ -191,6 +191,13 @@ | |||
191 | </div> | 191 | </div> |
192 | </div> | 192 | </div> |
193 | <div class="form-group"> | 193 | <div class="form-group"> |
194 | <div class="col-sm-2"></div> | ||
195 | <label class="col-sm-10"> | ||
196 | <input class="hardened-addresses" type="checkbox"> | ||
197 | Use hardened addresses | ||
198 | </label> | ||
199 | </div> | ||
200 | <div class="form-group"> | ||
194 | <label class="col-sm-2 control-label">Hive Wallet</label> | 201 | <label class="col-sm-2 control-label">Hive Wallet</label> |
195 | <div class="col-sm-10"> | 202 | <div class="col-sm-10"> |
196 | <p class="form-control no-border"> | 203 | <p class="form-control no-border"> |
@@ -208,6 +215,15 @@ | |||
208 | </p> | 215 | </p> |
209 | </div> | 216 | </div> |
210 | </div> | 217 | </div> |
218 | <div class="form-group"> | ||
219 | <label for="core-path" class="col-sm-2 control-label">Bitcoin Core</label> | ||
220 | <div class="col-sm-10"> | ||
221 | <p class="form-control no-border"> | ||
222 | Use path <code>m/0'/0'</code> with hardened addresses. | ||
223 | For more info see the <a href="https://github.com/bitcoin/bitcoin/pull/8035" target="_blank">Bitcoin Core BIP32 implementation</a> | ||
224 | </p> | ||
225 | </div> | ||
226 | </div> | ||
211 | </form> | 227 | </form> |
212 | </div> | 228 | </div> |
213 | </div> | 229 | </div> |
@@ -14853,6 +14869,7 @@ var Mnemonic = function(language) { | |||
14853 | DOM.bip44account = $("#bip44 .account"); | 14869 | DOM.bip44account = $("#bip44 .account"); |
14854 | DOM.bip44change = $("#bip44 .change"); | 14870 | DOM.bip44change = $("#bip44 .change"); |
14855 | DOM.strength = $(".strength"); | 14871 | DOM.strength = $(".strength"); |
14872 | DOM.hardenedAddresses = $(".hardened-addresses"); | ||
14856 | DOM.addresses = $(".addresses"); | 14873 | DOM.addresses = $(".addresses"); |
14857 | DOM.rowsToAdd = $(".rows-to-add"); | 14874 | DOM.rowsToAdd = $(".rows-to-add"); |
14858 | DOM.more = $(".more"); | 14875 | DOM.more = $(".more"); |
@@ -14876,6 +14893,7 @@ var Mnemonic = function(language) { | |||
14876 | DOM.bip44account.on("input", calcForDerivationPath); | 14893 | DOM.bip44account.on("input", calcForDerivationPath); |
14877 | DOM.bip44change.on("input", calcForDerivationPath); | 14894 | DOM.bip44change.on("input", calcForDerivationPath); |
14878 | DOM.tab.on("shown.bs.tab", calcForDerivationPath); | 14895 | DOM.tab.on("shown.bs.tab", calcForDerivationPath); |
14896 | DOM.hardenedAddresses.on("change", calcForDerivationPath); | ||
14879 | DOM.indexToggle.on("click", toggleIndexes); | 14897 | DOM.indexToggle.on("click", toggleIndexes); |
14880 | DOM.addressToggle.on("click", toggleAddresses); | 14898 | DOM.addressToggle.on("click", toggleAddresses); |
14881 | DOM.privateKeyToggle.on("click", togglePrivateKeys); | 14899 | DOM.privateKeyToggle.on("click", togglePrivateKeys); |
@@ -15180,16 +15198,27 @@ var Mnemonic = function(language) { | |||
15180 | 15198 | ||
15181 | function TableRow(index) { | 15199 | function TableRow(index) { |
15182 | 15200 | ||
15201 | var useHardenedAddresses = DOM.hardenedAddresses.prop("checked"); | ||
15202 | |||
15183 | function init() { | 15203 | function init() { |
15184 | calculateValues(); | 15204 | calculateValues(); |
15185 | } | 15205 | } |
15186 | 15206 | ||
15187 | function calculateValues() { | 15207 | function calculateValues() { |
15188 | setTimeout(function() { | 15208 | setTimeout(function() { |
15189 | var key = bip32ExtendedKey.derive(index); | 15209 | var key = ""; |
15210 | if (useHardenedAddresses) { | ||
15211 | key = bip32ExtendedKey.deriveHardened(index); | ||
15212 | } | ||
15213 | else { | ||
15214 | key = bip32ExtendedKey.derive(index); | ||
15215 | } | ||
15190 | var address = key.getAddress().toString(); | 15216 | var address = key.getAddress().toString(); |
15191 | var privkey = key.privKey.toWIF(network); | 15217 | var privkey = key.privKey.toWIF(network); |
15192 | var indexText = getDerivationPath() + "/" + index; | 15218 | var indexText = getDerivationPath() + "/" + index; |
15219 | if (useHardenedAddresses) { | ||
15220 | indexText = indexText + "'"; | ||
15221 | } | ||
15193 | addAddressToList(indexText, address, privkey); | 15222 | addAddressToList(indexText, address, privkey); |
15194 | }, 50) | 15223 | }, 50) |
15195 | } | 15224 | } |