Bitcoin Forum

Bitcoin => Development & Technical Discussion => Topic started by: FabioCarpi on January 15, 2015, 01:04:59 PM



Title: vanitygen
Post by: FabioCarpi on January 15, 2015, 01:04:59 PM
the vanitygen project is abandoned?
https://github.com/samr7/vanitygen last commit Oct 24, 2012

i like this tool
i use he offline (i read some thinks)
but i likely he addresses in compressed pubkey...


Title: Re: vanitygen
Post by: findftp on January 15, 2015, 07:24:14 PM
the vanitygen project is abandoned?
https://github.com/samr7/vanitygen last commit Oct 24, 2012
If it ain't broken, don't fix it.

Quote
i like this tool
i use he offline (i read some thinks)
but i likely he addresses in compressed pubkey...

Not sure what you mean. Do you mean you want the private key to be in another format?


Title: Re: vanitygen
Post by: FabioCarpi on January 15, 2015, 08:25:23 PM
Not sure what you mean. Do you mean you want the private key to be in another format?
yes. in pubkey compress format
start with K or L


Title: Re: vanitygen
Post by: findftp on January 15, 2015, 08:38:24 PM
Not sure what you mean. Do you mean you want the private key to be in another format?
yes. in pubkey compress format
start with K or L

Oh, that's easy.
Just take the output from vanitygen and go to wallet details at bitaddress.org.

Code:
satoshi@nakamoto ~/applications/vanitygen-master $ ./vanitygen -i 1fabio
Difficulty: 63825187
Pattern: 1fabio                                                               
Address: 1FABios7oEqdjEPjo3yeBWdqGTDrdukVWG
Privkey: 5Jg4heZuwpK5U8wmYs5TrS6Vhg6hUCgxE2yetEgnQvAWPNKV8zu


For security purpose you can even download the page and check the integrity on an clean (cd-rom boot) machine and run the page.

There you can fill in the private key and see the compressed keys.

WIF compressed:
L11RLQpGgwpnin4jde2hXBmFgXa9d4bLkXj4D9QbSZexhdaf9R5m

for this example.

May I ask where you want to use the address?


Title: Re: vanitygen
Post by: johoe on January 15, 2015, 09:06:33 PM
Not sure what you mean. Do you mean you want the private key to be in another format?
yes. in pubkey compress format
start with K or L

At least the version of vanitygen that I downloaded has a switch for this:
Code:
vanitygen -F compressed -i 1johoe
Address: 1JoHoeEj6hFtxr22xahQUTxzj55hE1BZug
Privkey: L1vN2kji2HkFQmju7oYnrNXzZ8R9mejfWqcj8k3x6BVRb2cf2RK4

Note that compressing the key afterwards does not work, as it changes the address.


Title: Re: vanitygen
Post by: FabioCarpi on January 15, 2015, 09:20:11 PM
my version dont suport the compressed format


Title: Re: vanitygen
Post by: findftp on January 15, 2015, 09:25:58 PM
my version dont suport the compressed format
Mine neither.
Did we miss something when compiling? :)


Title: Re: vanitygen
Post by: johoe on January 16, 2015, 10:33:48 AM
my version dont suport the compressed format
Mine neither.
Did we miss something when compiling? :)

I just checked.  I use the version from Scott Alfter:

https://github.com/salfter/vanitygen

This is his commit that added compressed keys:

https://github.com/salfter/vanitygen/commit/06c095e064b6fcf6fa609dc7b769bd0e60ac8336


Title: Re: vanitygen
Post by: FabioCarpi on January 16, 2015, 10:58:32 AM
where can i download the executable?


Title: Re: vanitygen
Post by: findftp on January 16, 2015, 12:21:37 PM
where can i download the executable?
There is no executable. This works on linux. You have to compile it.


Title: Re: vanitygen
Post by: johoe on January 16, 2015, 12:34:25 PM
where can i download the executable?

I don't see precompiled packages. I can send you a linux 64 bit executable for Ubuntu, if you trust me that I didn't include any backdoor.

If you have linux it is not so difficult to compile yourself.  You need the usual C development packages and the library packages libpcre3-dev and libssl-dev.

I just browsed around and there are many different forks of vanitygen and at least two different implementations for compressed keys.



Title: Re: vanitygen
Post by: FabioCarpi on January 16, 2015, 12:48:09 PM
i use Windows
but i have a bootable pendrive with ubuntu


Title: Re: vanitygen
Post by: Josef27 on January 16, 2015, 12:50:27 PM
Atleast it still working, right?


Title: Re: vanitygen
Post by: FabioCarpi on January 16, 2015, 12:53:33 PM
yes


Title: Re: vanitygen
Post by: johoe on January 16, 2015, 01:11:57 PM
I put an archive with the linux 64 bit executable at

http://johoe.mooo.com/bitcoin/vanitygen-salfter-0.21-15-g06c095e.tar.gz (http://johoe.mooo.com/bitcoin/vanitygen-salfter-0.21-15-g06c095e.tar.gz)

Code:
> sha256sum vanitygen-salfter-0.21-15-g06c095e.tar.gz
89e7bf7b5a4499cea56f9e19a7c91102d99989b2b8ee67ac5935e8e14790dd02 vanitygen-salfter-0.21-15-g06c095e.tar.gz

It is build from the github repository as:
Code:
git clone https://github.com/salfter/vanitygen
cd vanitygen
git checkout 0.21-15-g06c095e
make
strip vanitygen keyconv

I didn't build oclvanitygen (AFAIK my intel GPU doesn't support it).

Edit: stripped executable, this changed sha256 sum.


Title: Re: vanitygen
Post by: HugoTheSpider on January 17, 2015, 12:30:30 PM
Hello, if vanitygen searches for both; compressed and uncompressed keys at once, it should raise the key rate up to 100% because the expensive EC math has to be done once only for each PubKey double, AFAIK. Right?

Old (pseudocode):
Code:
for each (i ...)
{
  batch = EC_stuff()
  for (j every item in batch)
  {
    EC_POINT_to_oct(group, batch[j], uncompressed, pubkey, 65) //pubkey = 04 XXXXXXX.. YYYYYYY...

    buffer[0..31] = SHA256(pubkey[0..64])
    hash160 = RIPEMD160(buffer[0..31])
    base58string = encodingFunc(hash160)
    if checkFunc(base58string) printKeyPair(PrivKey, base58string)
  }
}

should turn into:
Code:
for each (i ...)
{
  batch = EC_stuff()
  for (j = every item in batch)
  {
    EC_POINT_to_oct(group, batch[j], uncompressed, pubkey, 65) //pubkey = 04 XXXXXXX.. YYYYYYY...
   
    buffer[0..31] = SHA256(pubkey[0..64])
    hash160 = RIPEMD160(buffer[0..31])
    base58string = encodingFunc(hash160)
    if checkFunc(base58string) printKeyPair(PrivKey, base58string)
   
    if (pubkey[64]&1 != 0) pubkey[0] = 3 else pubkey[0] = 2 //pubkey = 02/03 XXXXXXXX.. YYYYYYY...
   
    buffer[0..31] = SHA256(pubkey[0..32]) //02/03 XXXXXX, ignore YYY
    hash160 = RIPEMD160(buffer[0..31])
    base58string = encodingFunc(hash160)
    if checkFunc(base58string) printKeyPair(PrivKey, base58string)
  }
}

Someone here which wants to give it a try and check if I'm right? I can't because I'm currently stick with a slow Windows laptop without a proper development tool chain.


Title: Re: vanitygen
Post by: johoe on January 17, 2015, 01:41:21 PM
Hello, if vanitygen searches for both; compressed and uncompressed keys at once, it should raise the key rate up to 100% because the expensive EC math has to be done once only for each PubKey double, AFAIK. Right?

I was always under the impression that vanitygen wouldn't do a multiplication in the inner loop but only increment the private key and add G to the public key.  I'm no longer sure this is true.  I hacked your suggestion and I went up from 560kKey/s to 720 kKey/s.  Another thing to try is using positive and negative point.  Negating a point is trivial for compressed key (xor the 2/3 with 1) and simple enough for uncompressed keys (negate y modulo N).


Title: Re: vanitygen
Post by: ChetnotAtkins on August 15, 2015, 09:10:57 AM
I am interested in a patch for oclvanitygen that would enable simultaneous search for compressed and uncompressed keys.

Is this solution above applicable (if so, which file should be changed) or could anybody post the necessary code changes to enable this? Thanks a lot