/ bitcoin

BitCoin address with your name in it

Recently I've stumbled upon Vanitygen, a BitCoin wallet address generator that can include your string at the beginning of your wallet address.

While there isn't a binary distribution available it is easy to build it on Ubuntu and/or OSX.

Start by cloning the repository:

hasik@darwine:~$ git clone https://github.com/samr7/vanitygen.git
Cloning into 'vanitygen'...
remote: Counting objects: 515, done.
remote: Total 515 (delta 0), reused 0 (delta 0), pack-reused 515
Receiving objects: 100% (515/515), 294.44 KiB | 0 bytes/s, done.
Resolving deltas: 100% (335/335), done.
Checking connectivity... done.
hasik@darwine:~$ cd vanitygen

For Ubuntu you can get requirements using apt or aptitude, for OSX use homebrew or ports.


sudo apt-get install build-essential libssl-dev libpcre3-dev

Build your app:

hasik@darwine:~/vanitygen$ make
cc -ggdb -O3 -Wall   -c -o vanitygen.o vanitygen.c
cc -ggdb -O3 -Wall   -c -o pattern.o pattern.c
cc -ggdb -O3 -Wall   -c -o util.o util.c
cc vanitygen.o pattern.o util.o -o vanitygen -ggdb -O3 -Wall -lpcre -lcrypto -lm -lpthread
cc -ggdb -O3 -Wall   -c -o keyconv.o keyconv.c
cc keyconv.o util.o -o keyconv -ggdb -O3 -Wall -lpcre -lcrypto -lm -lpthread

Vanitygen is ready to use.

hasik@darwine:~/vanitygen$ ./vanitygen 1chris #this is a prefix for my wallet address
Difficulty: 15318045009
[1.68 Mkey/s][total 13198336][Prob 0.1%][50% in 1.8h] 

Two hours?! Not very fast. Fortunately, there is also an OpenCL version. I'm using an NVIDIA card so we can install OpenCL drivers and build another version of Vanitygen.

sudo apt-get install nvidia-opencl-dev

Then build it:

hasik@darwine:~/vanitygen$ make oclvanitygen
cc -ggdb -O3 -Wall   -c -o oclvanitygen.o oclvanitygen.c
cc -ggdb -O3 -Wall   -c -o oclengine.o oclengine.c
oclengine.c: In function ‘vg_ocl_init’:
oclengine.c:908:2: warning: ‘clCreateCommandQueue’ is deprecated [-Wdeprecated-declarations]
  vocp->voc_oclcmdq = clCreateCommandQueue(vocp->voc_oclctx,
In file included from oclengine.c:37:0:
/usr/include/CL/cl.h:1359:1: note: declared here
 clCreateCommandQueue(cl_context                     /* context */,
oclengine.c: In function ‘vg_ocl_prefix_check’:
oclengine.c:1553:18: warning: variable ‘tablesize’ set but not used [-Wunused-but-set-variable]
  int orig_delta, tablesize;
cc oclvanitygen.o oclengine.o pattern.o util.o -o oclvanitygen -ggdb -O3 -Wall -lpcre -lcrypto -lm -lpthread -lOpenCL

Unfortunately some deprecation notices and unused variable notices will come out of the current master build, nevertheless - the app works.

hasik@darwine:~/vanitygen$ ./oclvanitygen 1chris
Difficulty: 15318045009
Compiling kernel, can take minutes...done!
[67.97 Mkey/s][total 62914560][Prob 0.4%][50% in 2.6min]    

After a little over a minute:

Pattern: 1chris                                                                
Address: 1chrisGQi4LUspFqEge5QdYMXVGAk3Wbx
Privkey: 5KHt3FifvjvY3cjnVNQjZiiVVwM3Knotarealprivkeyuf5H7Eu

Much better now :)