Author

Topic: Vanitygen: Vanity bitcoin address generator/miner [v0.22] - page 189. (Read 1153383 times)

legendary
Activity: 1400
Merit: 1005
EDIT:  Hmmm, didn't work.  "Invalid character '[' in prefix 1[p|P]etc..."

You don't need the pipe: 1[Aa][Bb][Cc]. In some shells you may have to escape/quote the square brackets. Safest is to enclose the whole regex in single quotes (double quotes in windows' cmd).
I have the targets stored in a text file.  I tried encapsulating each regex in single and double quotes, both errored out.  It seemed that the command window changed the double quotes to an o with two dots over it, and the single quotes to one of those AE letter combos.  Not sure what's up with that.

Regardless, still getting the invalid character '[' error without pipes in the text file.  Any other suggestions?
legendary
Activity: 1974
Merit: 1029
EDIT:  Hmmm, didn't work.  "Invalid character '[' in prefix 1[p|P]etc..."

You don't need the pipe: 1[Aa][Bb][Cc]. In some shells you may have to escape/quote the square brackets. Safest is to enclose the whole regex in single quotes (double quotes in windows' cmd).
legendary
Activity: 1400
Merit: 1005
Use regular expressions. Like this:

[g|G][e|E|3][n|N][t|T|7]    and so on. This matches Gent, gent, g3N7, ..

Adding * allows repeating the character.
G[e|E]*n  matches GeeeeEEEeeeen, Gen and Gn. If you want to have at least 1 occurence of the character, use + instead of *.

That's how I know regexps. Not sure if it is actually the pcre-style regexp syntax used in vanitygen.
Thank you much!

EDIT:  Hmmm, didn't work.  "Invalid character '[' in prefix 1[p|P]etc..."
legendary
Activity: 1974
Merit: 1029
Sorry for my noobness... how does one import keys?

You need to use a modified bitcoin client (read the OP) and run:

Code:
bitcoind importprivkey 5KhUstDBWc...

The string to use is the "Privkey" as returned from vanitygen.


Adding * allows repeating the character.
G[e|E]*n  matches GeeeeEEEeeeen, Gen and Gn. If you want to have at least 1 occurence of the character, use + instead of *.

That's how I know regexps. Not sure if it is actually the pcre-style regexp syntax used in vanitygen.

What you describe, particularly the '+' bit, applies to both GNU extended and Perl compatible regexen.
member
Activity: 98
Merit: 10
Use regular expressions. Like this:

[g|G][e|E|3][n|N][t|T|7]    and so on. This matches Gent, gent, g3N7, ..

Adding * allows repeating the character.
G[e|E]*n  matches GeeeeEEEeeeen, Gen and Gn. If you want to have at least 1 occurence of the character, use + instead of *.

That's how I know regexps. Not sure if it is actually the pcre-style regexp syntax used in vanitygen.
legendary
Activity: 1400
Merit: 1005
Is there a way to make the search caps-insensitive?
legendary
Activity: 1400
Merit: 1005
Thanks.  I get this error though:

Quote
assertion "check_upper || ((bnlow2 == NULL) && (bnhigh2 == NULL))" failed: file
"vanitygen.c", line 482, function: get_prefix_ranges
    113 [sig] vanitygen 956 open_stackdumpfile: Dumping stack trace to vanitygen
.exe.stackdump

Wow SgtSpike, you must have been trying patterns prefixed with varying numbers of 1s in order to trigger this bug.  Well beyond my humble test suite.  Anyway, it's mostly clear what went wrong and I'll post a new version in a bit.
I excel at breaking stuff.  Cheesy

And thank you VERY much for posting a binary as well.  Much appreciated - I hate trying to compile on a Windows box, and I'm a chicken with my head cut off in Linux.
hero member
Activity: 546
Merit: 500
Sorry for my noobness... how does one import keys?
legendary
Activity: 1974
Merit: 1029
btw. to run on multiple cores I just use this.. it's not nice, but it works (for me Wink):

I do:

Code:
$ for I in {1..4}; do (./vanitygen -r foo; killall vanitygen) & done

The first to finish kills the others Smiley.
newbie
Activity: 12
Merit: 2
Digging through OpenSSL 1.0.0d, the main source of entropy for the default RNG on Linux would appear to be /dev/urandom, or failing that, /dev/random or /dev/srandom.  In fact, if you want to, you can load it up in strace and watch it open /dev/urandom and read random bytes.
Indeed, my mistake. time() is not the only source of entropy by default.
I didnt look deep enough.
Code:
openssl-1.0.0d/crypto/rand/md_rand.c: ssleay_rand_bytes():
if (!initialized)
{
RAND_poll();
initialized = 1;
}
Btw using just time() was quite secure anyway. Assuming Vanitygen runs at least several minutes, the amount of keys to brute-force is >2^64:
 - 15 bit PID
 - 21 bit timeframe (1 month)
 - 7-8 bit CPU speed, + a few bits of time uncertainty each EC_KEY_generate_key()
 - 2^20+ keys to generate  
member
Activity: 73
Merit: 10
Meh. Now I generated a hand full of nice addresses and the import doesn't work... Gotta try recompiling the most current patch to bitcoin later...
Can anybody verify the import works?

btw. to run on multiple cores I just use this.. it's not nice, but it works (for me Wink):
Code:
threads = []

(ARGV[1].to_i rescue 1).times do
  threads << Thread.start do
    puts `./vanitygen #{ARGV[0]}`
    Process.kill("INT", Process.pid)
  end
end

Signal.trap("INT") do
  puts "exiting"
  threads.each {|t| t.kill}
end

threads.each {|t| t.join}

run it like `ruby vanitygen.rb 1bit 4`
sr. member
Activity: 404
Merit: 250
Any chance a trusted member can provide a windows binary for this? I can not compile things on windows for the life of me!

Not sure if I qualify as "trusted" but here is a quick Cygwin build: http://www.sendspace.com/file/yzsf0z

Thanks a lot for this!
full member
Activity: 140
Merit: 430
Firstbits: 1samr7
Proper seeding of crypto-hard primitives is a hard problem,
which has been worked on and solved (/dev/urandom).

Unless I'm missing something, the above method is rather lame
as opposed to what a standard linux kernel implementation does.

I can't agree more.  However, EC_KEY_generate_key() gets random numbers from the well-scrutinized OpenSSL RNG, also used by the official bitcoin client and probably half the HTTPS servers on the internet.  And indeed, on Linux, OpenSSL will use /dev/urandom.  I wouldn't be too worried about it, if there's a serious problem, we'll probably find out on the news.
full member
Activity: 140
Merit: 430
Firstbits: 1samr7
New version 0.4 pasted.  Soon it'll go on github, but not yet.

  • Fix assertion failure when using exact prefixes starting with more than one 1, reported by SgtSpike
  • Include a Win32 binary
full member
Activity: 140
Merit: 430
Firstbits: 1samr7
Thanks.  I get this error though:

Quote
assertion "check_upper || ((bnlow2 == NULL) && (bnhigh2 == NULL))" failed: file
"vanitygen.c", line 482, function: get_prefix_ranges
    113 [sig] vanitygen 956 open_stackdumpfile: Dumping stack trace to vanitygen
.exe.stackdump

Wow SgtSpike, you must have been trying patterns prefixed with varying numbers of 1s in order to trigger this bug.  Well beyond my humble test suite.  Anyway, it's mostly clear what went wrong and I'll post a new version in a bit.
legendary
Activity: 1400
Merit: 1005
Any chance a trusted member can provide a windows binary for this? I can not compile things on windows for the life of me!

Not sure if I qualify as "trusted" but here is a quick Cygwin build: http://www.sendspace.com/file/yzsf0z
Thanks.  I get this error though:

Quote
assertion "check_upper || ((bnlow2 == NULL) && (bnhigh2 == NULL))" failed: file
"vanitygen.c", line 482, function: get_prefix_ranges
    113 [sig] vanitygen 956 open_stackdumpfile: Dumping stack trace to vanitygen
.exe.stackdump

You probably should paste that file somewhere.

Doesn't mean anything to me...

Quote
Stack trace:
Frame     Function  Args
0028C6B4  763E1184  (00000128, 0000EA60, 00000000, 0028C7D8)
0028C6C8  763E1138  (00000128, 0000EA60, 000000A4, 0028C7BC)
0028C7D8  610C92FA  (00000000, 00000128, 0028C7F8, 00000000)
0028C8B8  610C6057  (00000000, 00000000, 00000000, 00000000)
0028C908  610C643C  (000003BC, 0028C930, 00000002, 00000004)
0028C9C8  610C6551  (000003BC, 00000006, 0028C9F8, 610C65F5)
0028C9D8  610C658C  (00000006, 0028CE80, 763F8B12, 61FB0000)
0028C9F8  610C65F5  (61180054, 00406480, 004063AF, 000001E2)
0028CA28  6100109B  (004063AF, 000001E2, 00406910, 00406480)
0028CAE8  0040212C  (00000000, 00D3331D, 0028CC78, 00D316B8)
0028CCA8  00403F02  (00000000, 00000080, 00D53730, 00001F5C)
0028CCF8  00404A58  (0028CD36, 00000000, 0028CD68, 61007038)
0028CD68  61007038  (00000000, 0028CDA4, 61006980, 7EFDE000)
End of stack trace
full member
Activity: 140
Merit: 430
Firstbits: 1samr7
By the way, did you find anything about the single-proc behaviour? I'm not sure my laptop would handle the heat of having both CPUs working anyway, but other people with several CPUs might be interested in taking advantage of all of them.

this is cool.   I noticed it seems to only fill up 1 cpu core.  Should I kick off multiple instances so as to max out all my CPU power?   Or will it be redundant re-searching keyspace it already searched for my vanity phrase?

That's correct.  For the time being, you need to kick off one instance for each CPU core you want to use.  The key space searches won't be coordinated, but it's quite unlikely that any two instances of this program that are ever started by anybody will ever check the same keys.

Proper entropy is hard.

Process ID is 16 bits. Unix time is about 26 bits of entropy (assuming 2 year span, second resolution). Total Entropy: 42 bits. (unless I am missing a source of entropy)

Digging through OpenSSL 1.0.0d, the main source of entropy for the default RNG on Linux would appear to be /dev/urandom, or failing that, /dev/random or /dev/srandom.  In fact, if you want to, you can load it up in strace and watch it open /dev/urandom and read random bytes.
hero member
Activity: 588
Merit: 500
Any chance a trusted member can provide a windows binary for this? I can not compile things on windows for the life of me!

Not sure if I qualify as "trusted" but here is a quick Cygwin build: http://www.sendspace.com/file/yzsf0z
Thanks.  I get this error though:

Quote
assertion "check_upper || ((bnlow2 == NULL) && (bnhigh2 == NULL))" failed: file
"vanitygen.c", line 482, function: get_prefix_ranges
    113 [sig] vanitygen 956 open_stackdumpfile: Dumping stack trace to vanitygen
.exe.stackdump

You probably should paste that file somewhere.
legendary
Activity: 1400
Merit: 1005
Any chance a trusted member can provide a windows binary for this? I can not compile things on windows for the life of me!

Not sure if I qualify as "trusted" but here is a quick Cygwin build: http://www.sendspace.com/file/yzsf0z
Thanks.  I get this error though:

Quote
assertion "check_upper || ((bnlow2 == NULL) && (bnhigh2 == NULL))" failed: file
"vanitygen.c", line 482, function: get_prefix_ranges
    113 [sig] vanitygen 956 open_stackdumpfile: Dumping stack trace to vanitygen
.exe.stackdump
full member
Activity: 134
Merit: 102
Any chance a trusted member can provide a windows binary for this? I can not compile things on windows for the life of me!

Not sure if I qualify as "trusted" but here is a quick Cygwin build: http://www.sendspace.com/file/yzsf0z
Jump to: