<div class="col-sm-10">
<div class="input-group">
<select id="strength" class="strength form-control">
- <option val="3">3</option>
- <option val="6">6</option>
- <option val="9">9</option>
- <option val="12">12</option>
- <option val="15" selected>15</option>
- <option val="18">18</option>
- <option val="21">21</option>
- <option val="24">24</option>
+ <option value="3">3</option>
+ <option value="6">6</option>
+ <option value="9">9</option>
+ <option value="12">12</option>
+ <option value="15" selected>15</option>
+ <option value="18">18</option>
+ <option value="21">21</option>
+ <option value="24">24</option>
</select>
<span class="input-group-btn">
<button class="btn generate">Generate Random Mnemonic</button>
<input id="bip32-path" type="text" class="path form-control" value="m/0">
</div>
</div>
+ <div class="form-group">
+ <div class="col-sm-2"></div>
+ <label class="col-sm-10">
+ <input class="hardened-addresses" type="checkbox">
+ Use hardened addresses
+ </label>
+ </div>
<div class="form-group">
<label class="col-sm-2 control-label">Hive Wallet</label>
<div class="col-sm-10">
</p>
</div>
</div>
+ <div class="form-group">
+ <label for="core-path" class="col-sm-2 control-label">Bitcoin Core</label>
+ <div class="col-sm-10">
+ <p class="form-control no-border">
+ Use path <code>m/0'/0'</code> with hardened addresses.
+ For more info see the <a href="https://github.com/bitcoin/bitcoin/pull/8035" target="_blank">Bitcoin Core BIP32 implementation</a>
+ </p>
+ </div>
+ </div>
+ <div class="form-group">
+ <label class="col-sm-2 control-label">Block Explorers</label>
+ <div class="col-sm-10">
+ <p class="form-control no-border">
+ Use path <code>m/44'/0'/0'</code>.
+ Only enter the <code>xpub</code> extended key into block explorer search fields, never the <code>xpriv</code> key.
+ </p>
+ </div>
+ </div>
</form>
</div>
</div>
pubKeyHash: 0x89,
wif: 0x85,
};
+
+bitcoin.networks.dash = {
+ bip32: {
+ public: 0x0488b21e,
+ private: 0x0488ade4
+ },
+ pubKeyHash: 0x4c,
+ scriptHash: 0x10,
+ wif: 0xcc,
+};
+
+bitcoin.networks.namecoin = {
+ bip32: {
+ public: 0x0488b21e,
+ private: 0x0488ade4
+ },
+ pubKeyHash: 0x34,
+ //scriptHash: 0x10,
+ wif: 0x80,
+};
+
+bitcoin.networks.peercoin = {
+ bip32: {
+ public: 0x0488b21e,
+ private: 0x0488ade4
+ },
+ pubKeyHash: 0x37,
+ //scriptHash: 0x10,
+ wif: 0xb7,
+};
+
</script>
<script>// Select components from sjcl to suit the crypto operations bip39 requires.
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");
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);
// 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() {
}
function calcBip32RootKeyFromBase58(rootKeyBase58) {
- bip32RootKey = bitcoin.HDNode.fromBase58(rootKeyBase58);
+ bip32RootKey = bitcoin.HDNode.fromBase58(rootKeyBase58, network);
}
function calcBip32ExtendedKey(path) {
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)
}
DOM.bip44coin.val(23);
},
},
+ {
+ name: "DASH",
+ onSelect: function() {
+ network = bitcoin.networks.dash;
+ DOM.bip44coin.val(5);
+ },
+ },
+ {
+ name: "Namecoin",
+ onSelect: function() {
+ network = bitcoin.networks.namecoin;
+ DOM.bip44coin.val(7);
+ },
+ },
+ {
+ name: "Peercoin",
+ onSelect: function() {
+ network = bitcoin.networks.peercoin;
+ DOM.bip44coin.val(6);
+ },
+ },
]
init();