Bitcoin Forum

Bitcoin => Wallet software => Topic started by: Bitcoin++ on June 20, 2014, 12:58:28 PM



Title: Brainwallet with Vanity Address
Post by: Bitcoin++ on June 20, 2014, 12:58:28 PM
Is there any open source brainwallet that lets you make a vanity address, e.g. starts like 1777...?

If it does not exist it should be easy to make. In addition to the passphrase, the user should input the desired pattern. The javascript should generate addresses until pattern found. For each iteration it could use the passphrase + a counter.


Title: Re: Brainwallet with Vanity Address
Post by: JohnFromWIT on June 20, 2014, 01:35:58 PM
You might end up with a huge number in your private key that you'd have to memorize.
But I think it could be done, maybe by making private keys out of random collection of words from a list.


Title: Re: Brainwallet with Vanity Address
Post by: Justin00 on June 20, 2014, 02:24:52 PM
I know this isnt what you are after...
but couldnt you use vanitygen to generate desired address.. and just encrypt the privkey using gpg or whatever and just have that password protected with some long password you remember... kind of defeats brain wallet.. cause you need the backup... but the password part would be brainwallet-a-tised

or am I totally off track ?


Title: Re: Brainwallet with Vanity Address
Post by: TimS on June 20, 2014, 05:07:17 PM
Is there any open source brainwallet that lets you make a vanity address, e.g. starts like 1777...?

If it does not exist it should be easy to make. In addition to the passphrase, the user should input the desired pattern. The javascript should generate addresses until pattern found. For each iteration it could use the passphrase + a counter.
A significant amount of work can go into finding a vanity address. It could take a prohibitively long time to refind the vanity address (with JS on the CPU, no less) every time you want to access the wallet.

I'd want to include the end count, at least to a little precision, in the brain wallet. You could encode this as a passphrase. E.g. let's say that the JS can try 10k per second to brute force the vanity pattern, and the vanity pattern you wanted was the 57,434,567th thing tried. The program would find the index to remember is "5743", which it encodes as "maybe inside" (with a list like Electrum's (https://raw.githubusercontent.com/spesmilo/electrum/master/lib/mnemonic.py), you can have over 2.6 million two-word combos); if you tell it your passphrase along with "maybe inside", the JS can find it within a second. If not, then you have to let it start from 0 to find it.

Or, just take the resulting private key and encode that (with diceware/Electrum-style encoding) as a series of words, and use that as your brainwallet. It would be twice as long as an Electrum seed, unfortunately, which would make for a pretty tough-to-remember brainwallet.


Title: Re: Brainwallet with Vanity Address
Post by: Bitcoin++ on June 21, 2014, 03:15:44 PM
I did the coding myself. Very simple.

In bitadress.org's HTML, lines 9086-9088, replace original code with this:

            var pattern = "77";
            var j = pattern.length + 1;
            var i = -1;
            var bytes;
            var btcKey;
            do {
            i = i + 1;
            bytes = Crypto.SHA256(key + i, { asBytes: true });
            btcKey = new Bitcoin.ECKey(bytes);
            } while (btcKey.getBitcoinAddress().substring(1, j) != pattern);
            var bitcoinAddress = btcKey.getBitcoinAddress();
            alert("Passphrase with nonce added : " + key + i);


You must replace "77" with whatever you please.

Note that the javascript will loop for a while. The browser may freeze.


Title: Re: Brainwallet with Vanity Address
Post by: dabura667 on June 22, 2014, 04:47:33 PM
I did the coding myself. Very simple.

In bitadress.org's HTML, lines 9086-9088, replace original code with this:

            var pattern = "77";
            var j = pattern.length + 1;
            var i = 0;
            var bytes;
            var btcKey;
            do {
            i = i + 1;
            bytes = Crypto.SHA256(key + i, { asBytes: true });
            btcKey = new Bitcoin.ECKey(bytes);
            } while (btcKey.getBitcoinAddress().substring(1, j) != pattern);
            var bitcoinAddress = btcKey.getBitcoinAddress();


You must replace "77" with whatever you please.

Note that the javascript will loop for a while. The browser may freeze.

Shouldn't you also change the javascript to display the nonce that must be added to the brainwallet to get the address? Otherwise it's not really a brainwallet...


Title: Re: Brainwallet with Vanity Address
Post by: Bitcoin++ on June 23, 2014, 06:04:22 AM
Shouldn't you also change the javascript to display the nonce that must be added to the brainwallet to get the address? Otherwise it's not really a brainwallet...

Yes, with the nonce added you can recover the address also with the original brainwallet. If not, it can still be recovered with this modified version, though it needs to make the same slow loop.

I updated the code with a messagebox that shows passphrase plus nonce.


Title: Re: Brainwallet with Vanity Address
Post by: Harley997 on July 04, 2014, 05:18:51 PM
I know this isnt what you are after...
but couldnt you use vanitygen to generate desired address.. and just encrypt the privkey using gpg or whatever and just have that password protected with some long password you remember... kind of defeats brain wallet.. cause you need the backup... but the password part would be brainwallet-a-tised

or am I totally off track ?
This is probably the closest thing to a vanity brain wallet that you will find. A vanity address by definition must use a "random" private address that associates with the public address with your "vanity" while a brain wallet is a private key that uses some kind of algorithm to get from your "password" to your private key, the algorithm must be standard enough so that you can get to it from a number of different sources.

One option would be to generate a vanity address and a separate brain wallet. You would then create a script to be run on an EC2 instance that would automatically sweep funds from the vanity address into the brain wallet upon receipt.