From 30e00a6984106ebd7bd3edeac56b7342ecd10c86 Mon Sep 17 00:00:00 2001 From: Robin Owens Date: Thu, 27 Sep 2012 16:00:36 +0100 Subject: [PATCH] Adding in additional tab for Vanity Address calculations. When calc a vanity address there is a need for the user to multiply 2 private addresses together. This needs to be done offline. --- bitaddress.org.html | 126 ++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 122 insertions(+), 4 deletions(-) diff --git a/bitaddress.org.html b/bitaddress.org.html index 305e65e..02a71c2 100644 --- a/bitaddress.org.html +++ b/bitaddress.org.html @@ -3932,6 +3932,9 @@ .keyarea .output { display: block; } .keyarea .qrcode_public { display: inline-block; float: left; } .keyarea .qrcode_private { display: inline-block; position: relative; top: 28px; float: right; } + .vankeyarea { font-family: Courier New; text-align: left; position: relative; padding: 5px; } + .vankeyarea .label { text-decoration: underline; } + .vankeyarea .output { display: block; } #faqs ol { padding: 0 0 0 25px; } #faqs li { padding: 3px 0; } @@ -3956,7 +3959,10 @@ #detailarea #detailqrcodepubliccomp { position: relative; float: right; margin: 0 0 0 10px; } #detailarea #detailqrcodeprivate { position: relative; float: left; margin: 0 10px 0 0; } #detailarea #detailqrcodeprivatecomp { position: relative; float: right; margin: 0 0 0 10px; } - + #vanityarea { display: none; border: 2px solid green; min-height: 250px;} + #vanityarea .keyarea {display: none; } + #vanityaddareaoutput .keyarea {display: none; } + #vanityarea .notes { text-align: left; font-size: 80%; padding: 0 0 20px 0; } #bulkfaqs { display: none; } .bulkquestion { padding: 10px 15px; text-align: left; cursor: pointer; } .bulkquestion:hover { color: #77777A; } @@ -3992,6 +3998,8 @@ #brainpassphrase { width: 280px; } #detailcommands { display: none; } #detailcommands span { padding: 0 10px; } + #vanitykeycommands { display: none; } + #vanitykeycommands span { padding: 0 10px; } #detailprivkey { width: 250px; } .paper .commands { border-bottom: 2px solid green; padding: 10px 0; margin-bottom: 0; } #bulkstartindex, #paperlimit, #paperlimitperpage { width: 35px; } @@ -4050,6 +4058,7 @@
Bulk Wallet
Brain Wallet
Wallet Details
+
Vanity Private Key
@@ -4088,6 +4097,11 @@
+ +
+ +
+
@@ -4194,6 +4208,45 @@
+
+
+
+ Public Key: +
+

Copy and paste the above into the Public Key field in the Vanity Pool Website.
+
+
+ Private Key: + +

Copy and paste the above Private Key field into a text file. Ideally save to an encrypted drive. + You will need this to retrieve the Bitcoin Private Key once the Pool has found your prefix.
+
+
+
+
+
Enter Private Key (previously saved):
+
+
Enter Private Key (from Vanity Pool):
+
+
+ +
+
+
+ Private Key (WIF): + - +

The above is the Private Key to load into your wallet.
+
+
+
+ New Address: + - +

The above is your new address that should include your required prefix.
+
+
+
+
+
@@ -4301,6 +4354,35 @@ } }, + generateKeyPair: function (idPostFix) { + idPostFix = idPostFix || ""; + try { + var key = new Bitcoin.ECKey(false); + var publicKey = Crypto.util.bytesToHex(key.getPub()).toString().toUpperCase(); + //var halfWayIndex = Math.floor(publicKey.length / 2); + //var pubKeyFirstHalf = publicKey.substr(0, halfWayIndex); + //var pubKeySecondHalf = publicKey.substr(halfWayIndex, publicKey.length - halfWayIndex); + //publicKey = pubKeyFirstHalf + "
" + pubKeySecondHalf; + var privateKey = Crypto.util.bytesToHex(key.getBitcoinPrivateKeyByteArray()).toString().toUpperCase(); + } + catch (e) { + alert(e); + publicKey = false; + } + + if (publicKey) { + document.getElementById("vanitypubkey" + idPostFix).innerHTML = publicKey; + document.getElementById("vanityprivatekey" + idPostFix).innerHTML = privateKey; + + } + // browsers that failed to generate keys + else { + document.getElementById("vanitypubkey" + idPostFix).innerHTML = "error"; + document.getElementById("vanityprivatekey" + idPostFix).innerHTML = "error"; + } + document.getElementById("vanitykeyarea").style.display = "block"; + }, + qrCode: { // determine which type number is big enough for the input text length @@ -4835,10 +4917,45 @@ document.getElementById("detailqrcodeprivate").innerHTML = ""; document.getElementById("detailqrcodeprivatecomp").innerHTML = ""; } - } + }, + vanitykey: { + open: function () { + for (var wType in ninja.walletType) { + ninja.wallets[wType].close(); + } + document.getElementById("vanityarea").style.display = "block"; + document.getElementById("vanitykeycommands").style.display = "block"; + }, + + close: function () { + document.getElementById("vanityarea").style.display = "none"; + document.getElementById("vanitykeyarea").style.display = "none"; + document.getElementById("vanitykeycommands").style.display = "none"; + }, + addKeys: function () { + var privateKeyWif = false; + var bitcoinAddress = false; + //document.getElementById("vanityadditionalarea").style.display = "block"; + try{ + var privateKeyString=document.getElementById("vanityprivkey").value; + var privatePoolKeyString=document.getElementById("vanitypoolprivkey").value; + var privateKey=BigInteger.fromByteArrayUnsigned(Crypto.util.hexToBytes(privateKeyString)); + var privatePoolKey=BigInteger.fromByteArrayUnsigned(Crypto.util.hexToBytes(privatePoolKeyString)); + var n=EllipticCurve.getSECCurveByName("secp256k1").getN(); + var newPrivateKey=new Bitcoin.ECKey(privateKey.multiply(privatePoolKey).mod(n)); + bitcoinAddress = newPrivateKey.getBitcoinAddress(); + privateKeyWif = newPrivateKey.getBitcoinWalletImportFormat(); + } catch (e) { + alert(e); + } + document.getElementById("vanityprivatekeyWIF").innerHTML = privateKeyWif; + document.getElementById("vanityAddress").innerHTML = bitcoinAddress; + }, + + }, }, - walletType: { "singlewallet": "singlewallet", "paperwallet": "paperwallet", "bulkwallet": "bulkwallet", "brainwallet": "brainwallet", "detailwallet": "detailwallet" }, + walletType: { "singlewallet": "singlewallet", "paperwallet": "paperwallet", "bulkwallet": "bulkwallet", "brainwallet": "brainwallet", "detailwallet": "detailwallet","vanitykey":"vanitykey" }, getQueryString: function () { var result = {}, queryString = location.search.substring(1), re = /([^&=]+)=([^&]*)/g, m; @@ -4863,4 +4980,5 @@ setTimeout(ninja.wallets.singlewallet.forceGenerate, ninja.seedLimit * 20); - \ No newline at end of file + +