diff --git a/index.html b/index.html index 691dbd5..9dd7a91 100644 --- a/index.html +++ b/index.html @@ -1191,7 +1191,7 @@

The path of key derivation

-
+
Path
+
+ Address format
+ +
+

@@ -1226,7 +1235,7 @@
- + diff --git a/js/coin.js b/js/coin.js index d8f5388..1e33588 100644 --- a/js/coin.js +++ b/js/coin.js @@ -618,10 +618,20 @@ var privkey = (r.key_bytes).slice(1, 33); var privkeyHex = Crypto.util.bytesToHex(privkey); var pubkey = coinjs.newPubkey(privkeyHex); + var addr_format = $("#verifyHDaddress .derivation_addr_format").val(); + if (addr_format == "bech32") { + var address = coinjs.bech32Address(pubkey); + } else if (addr_format == "segwit") { + var address = coinjs.segwitAddress(pubkey); + } else { + var address = {'address': coinjs.pubkey2address(pubkey), + 'redeemscript': ''}; + } r.keys = {'privkey':privkeyHex, 'pubkey':pubkey, - 'address':coinjs.pubkey2address(pubkey), + 'address':address.address, + 'script':address.redeemscript, 'wif':coinjs.privkey2wif(privkeyHex)}; } else if(r.key_bytes[0] == 0x02 || r.key_bytes[0] == 0x03) { diff --git a/js/coinbin.js b/js/coinbin.js index afc98f1..5b167a7 100644 --- a/js/coinbin.js +++ b/js/coinbin.js @@ -1714,6 +1714,7 @@ $(document).ready(function() { html += ''; html += ''; html += ''; + html += ''; html += ''; html += ''; html += '';
IndexAddressPrivate Key (WIF)Extended xPubExtended xPrv
IndexAddressRedeem scriptPrivate Key (WIF)Extended xPubExtended xPrv
'+i+'