Bitcoin Forum

Bitcoin => Development & Technical Discussion => Topic started by: jackg on February 01, 2018, 05:46:49 PM



Title: Is there a bech32 vanity address generator?
Post by: jackg on February 01, 2018, 05:46:49 PM
I've been looking into trying to find a bech32 vanity address generator and was wondering if there is already one?

If not, I might try building a simple one based on my own needs (so would just be a minimal version and probably quite slow unless I can work out the source code of vanitygen and try to edit it to encorporate the bc1 part into it).

Unless there's a way to convert a legacy address into a bech one though I assumed the private keys would be of a different type?


Title: Re: Is there a bech32 vanity address generator?
Post by: RGBKey on February 01, 2018, 07:02:16 PM
I haven't seen one, but if you want I'd try to contribute to one on GitHub or somewhere. I like the idea, even though I know vanity addresses pose some security problems and they're not incorporated into HD backups, I still think it'd be really cool. Maybe here (https://github.com/bitcoin/bips/blob/master/bip-0173.mediawiki) would be a good place to start?


Title: Re: Is there a bech32 vanity address generator?
Post by: jackg on February 01, 2018, 07:29:19 PM
I haven't seen one, but if you want I'd try to contribute to one on GitHub or somewhere. I like the idea, even though I know vanity addresses pose some security problems and they're not incorporated into HD backups, I still think it'd be really cool. Maybe here (https://github.com/bitcoin/bips/blob/master/bip-0173.mediawiki) would be a good place to start?

Thanks for the link. What languages would you use as I'd personally prefer either C# or Python (python is quite slow so I'd have to convert it to C# afterwards as that seems quite a bit faster).

Currently reading the data from the link and want to see if I can build any interim stuff from it just as a simple address generator (or some sort of validator).


Title: Re: Is there a bech32 vanity address generator?
Post by: RGBKey on February 01, 2018, 08:03:37 PM
I haven't seen one, but if you want I'd try to contribute to one on GitHub or somewhere. I like the idea, even though I know vanity addresses pose some security problems and they're not incorporated into HD backups, I still think it'd be really cool. Maybe here (https://github.com/bitcoin/bips/blob/master/bip-0173.mediawiki) would be a good place to start?

Thanks for the link. What languages would you use as I'd personally prefer either C# or Python (python is quite slow so I'd have to convert it to C# afterwards as that seems quite a bit faster).

Currently reading the data from the link and want to see if I can build any interim stuff from it just as a simple address generator (or some sort of validator).

I don't know C#, but I know a little but of C. I'd be willing to try to learn though, I know Java and Node.js, and I've heard Java is very similar to C#


Title: Re: Is there a bech32 vanity address generator?
Post by: jackg on February 01, 2018, 08:18:25 PM
I haven't seen one, but if you want I'd try to contribute to one on GitHub or somewhere. I like the idea, even though I know vanity addresses pose some security problems and they're not incorporated into HD backups, I still think it'd be really cool. Maybe here (https://github.com/bitcoin/bips/blob/master/bip-0173.mediawiki) would be a good place to start?

Thanks for the link. What languages would you use as I'd personally prefer either C# or Python (python is quite slow so I'd have to convert it to C# afterwards as that seems quite a bit faster).

Currently reading the data from the link and want to see if I can build any interim stuff from it just as a simple address generator (or some sort of validator).

I don't know C#, but I know a little but of C. I'd be willing to try to learn though, I know Java and Node.js, and I've heard Java is very similar to C#

I think C#, C and Java are all quite close together yes and if you use a program like Visual Studio, the program fills in some of the gaps for you so it's quite nice to work with.

Do you not know any Python? Normally people start with that as its a fairly forgiving language to start on. I did an android version of JAVA a few years ago also so might be able to regress my knowledge a little.


Title: Re: Is there a bech32 vanity address generator?
Post by: RGBKey on February 01, 2018, 08:49:14 PM
I know no Python, I started with javascript in webpages, worked with Node.js for a long time, and in the past 2 years I've started to work with Java, and I've started with C in the past 6 months.


Title: Re: Is there a bech32 vanity address generator?
Post by: jackg on February 01, 2018, 09:00:17 PM
I know no Python, I started with javascript in webpages, worked with Node.js for a long time, and in the past 2 years I've started to work with Java, and I've started with C in the past 6 months.

Can you suggest a good JAVA client to use for development then and I'll try to see how it goes. I think they have tutorials on w3 that I can check also so that might work a bit better?

Would you use visual studio or another development software that can connect to Github?


Title: Re: Is there a bech32 vanity address generator?
Post by: nullius on February 01, 2018, 09:38:10 PM
What platform are you on?  In late December (https://bitcointalk.org/index.php?topic=25804.msg26877499#msg26877499), I wrote a Segwit “Bravo Charlie addresses (https://bitcointalk.org/index.php?topic=2646007.0)” (Bech32) and also P2SH-nested (“3” addresses).  It can search for both at once, which is beneficial because key generation is expensive.  This was used to generate both the Bitcoin addresses you see in my signature:  The address starting with “3NULL”, and the address starting with “bc1qcash”.

It is written in C.  I’ve been intending to clean up the code, test-test-test, and put it on Github; but somehow, that keeps getting pushed down the TODO list.  It is UNIX/Linux only, though I’ve mulled trying to compile Windows binaries with mingw if there were demand.  (I do not have any Windows systems.)

My generator is not derived from Vanitygen or any other vanity address generator.  At present, and in any foreseeable initial release, it does not use the point addition trick which Vanitygen uses; for each key tried, it reads a new private key off /dev/urandom and creates a public key from that using Core’s secp256k1 library.  Thus, it is relatively slow.  On an ancient airgap laptop with a very slow CPU, it can try a maximum of about 10k keys per second per core.  I just leave it running with a pattern; it has been running for weeks, as of now (I should check on it!).  Based on comparisons of how long a FreeBSD buildworld takes, I guesstimate that a newer CPU might get close to 100k keys/second/core.  A major speedup was obtained by using Core’s library; it is 5x–7x faster with Core’s secp256k1 than with libcrypto (OpenSSL), so I ripped out the code for using the latter.

unless I can work out the source code of vanitygen and try to edit it to encorporate the bc1 part into it

Beware, Segwit requires that addresses be generated from compressed public keys.  Vanitygen does not support compressed keys; I saw a patch somewhere on Github for that, with ensuing discussion pointing out that the patch had a serious bug.  (Aside, this also means that Vanitygen users are paying even more unnecessary fees than they are for not using Segwit.)

All the Bitcoin software I write uses only compressed public keys.  Also, I pay careful attention to avoiding release of any money-losing bugs.  This is one reason I am sometimes slow with these things.  Testing can take longer than coding.


Title: Re: Is there a bech32 vanity address generator?
Post by: jackg on February 01, 2018, 10:42:37 PM
What platform are you on?  In late December (https://bitcointalk.org/index.php?topic=25804.msg26877499#msg26877499), I wrote a Segwit “Bravo Charlie addresses (https://bitcointalk.org/index.php?topic=2646007.0)” (Bech32) and also P2SH-nested (“3” addresses).  It can search for both at once, which is beneficial because key generation is expensive.  This was used to generate both the Bitcoin addresses you see in my signature:  The address starting with “3NULL”, and the address starting with “bc1qcash”.

It is written in C.  I’ve been intending to clean up the code, test-test-test, and put it on Github; but somehow, that keeps getting pushed down the TODO list.  It is UNIX/Linux only, though I’ve mulled trying to compile Windows binaries with mingw if there were demand.  (I do not have any Windows systems.)

My generator is not derived from Vanitygen or any other vanity address generator.  At present, and in any foreseeable initial release, it does not use the point addition trick which Vanitygen uses; for each key tried, it reads a new private key off /dev/urandom and creates a public key from that using Core’s secp256k1 library.  Thus, it is relatively slow.  On an ancient airgap laptop with a very slow CPU, it can try a maximum of about 10k keys per second per core.  I just leave it running with a pattern; it has been running for weeks, as of now (I should check on it!).  Based on comparisons of how long a FreeBSD buildworld takes, I guesstimate that a newer CPU might get close to 100k keys/second/core.  A major speedup was obtained by using Core’s library; it is 5x–7x faster with Core’s secp256k1 than with libcrypto (OpenSSL), so I ripped out the code for using the latter.

unless I can work out the source code of vanitygen and try to edit it to encorporate the bc1 part into it

Beware, Segwit requires that addresses be generated from compressed public keys.  Vanitygen does not support compressed keys; I saw a patch somewhere on Github for that, with ensuing discussion pointing out that the patch had a serious bug.  (Aside, this also means that Vanitygen users are paying even more unnecessary fees than they are for not using Segwit.)

All the Bitcoin software I write uses only compressed public keys.  Also, I pay careful attention to avoiding release of any money-losing bugs.  This is one reason I am sometimes slow with these things.  Testing can take longer than coding.

I think your project duffers from one I envisaged myself writing. And as you're using bitcoin core to produce the keys then I'm not sure that's particularly efficient (and most of my computers are extremely slow)!

Can you not just get a C CLI for Windows and run it on that if someone particularly wanted to also (only Linux system I have is a raspberry pi, I tried installing Ubuntu on my laptop but it's BIOS didn't recognise the ISO or the installation disk :( ).


Title: Re: Is there a bech32 vanity address generator?
Post by: nullius on February 01, 2018, 11:38:32 PM
I think your project duffers from one I envisaged myself writing. And as you're using bitcoin core to produce the keys then I'm not sure that's particularly efficient (and most of my computers are extremely slow)!

You misunderstood.  I am not using Bitcoin Core to generate the keys—what?  Through the JSON-RPC interface?  That would be absurdly slow, and quite stupid.  Rather, I am using Core’s “Optimized C library for EC operations on curve secp256k1” (https://github.com/bitcoin-core/secp256k1).  Speed-wise, it runs circles around OpenSSL for ECC key operations.  On the slow test machine, with OpenSSL, I could never get over about 1500 trials per second per CPU core.  With Core’s library, I can get up to around 10000 t/s/c; and the speed of my platform’s regex library seems to become a serious bottleneck.

The probability is negligible that any of your computers could be slower than mine are.

Can you not just get a C CLI for Windows and run it on that if someone particularly wanted to also

I have no Windows in my house.  The idea I’d floated is using mingw (http://mingw.org/) to create a Microsoft Windows binary from a non-Windows system.

Before publicly distributing such a thing with my name on it, I would need to work with tester(s) who have Windows systems available.  It’d be good to know if anybody would be interested in doing that (cough).

(only Linux system I have is a raspberry pi, I tried installing Ubuntu on my laptop but it's BIOS didn't recognise the ISO or the installation disk :( ).

Off-topic:  I smell a potential issue of EFI vs. MBR.  You said your computers are slow; therefore, I presume they are old.  I suspect you may have downloaded something which uses EFI, and does it in a manner wholly incompatible with older systems.  This question is way off-topic here; should you be interested in discussing it, feel free to PM or e-mail me.  PGP mail is most preferred.


Title: Re: Is there a bech32 vanity address generator?
Post by: jackg on February 01, 2018, 11:52:50 PM
I think your project duffers from one I envisaged myself writing. And as you're using bitcoin core to produce the keys then I'm not sure that's particularly efficient (and most of my computers are extremely slow)!

You misunderstood.  I am not using Bitcoin Core to generate the keys—what?  Through the JSON-RPC interface?  That would be absurdly slow, and quite stupid.  Rather, I am using Core’s “Optimized C library for EC operations on curve secp256k1” (https://github.com/bitcoin-core/secp256k1).  Speed-wise, it runs circles around OpenSSL for ECC key operations.  On the slow test machine, with OpenSSL, I could never get over about 1500 trials per second per CPU core.  With Core’s library, I can get up to around 10000 t/s/c; and the speed of my platform’s regex library seems to become a serious bottleneck.

The probability is negligible that any of your computers could be slower than mine are.

Can you not just get a C CLI for Windows and run it on that if someone particularly wanted to also

I have no Windows in my house.  The idea I’d floated is using mingw (http://mingw.org/) to create a Microsoft Windows binary from a non-Windows system.

Before publicly distributing such a thing with my name on it, I would need to work with tester(s) who have Windows systems available.  It’d be good to know if anybody would be interested in doing that (cough).

(only Linux system I have is a raspberry pi, I tried installing Ubuntu on my laptop but it's BIOS didn't recognise the ISO or the installation disk :( ).

Off-topic:  I smell a potential issue of EFI vs. MBR.  You said your computers are slow; therefore, I presume they are old.  I suspect you may have downloaded something which uses EFI, and does it in a manner wholly incompatible with older systems.  This question is way off-topic here; should you be interested in discussing it, feel free to PM or e-mail me.  PGP mail is most preferred.

1. Yes I did definitely misunderstand what you meant there at the start. I thought you tapped into a regular bitcoin core library which would most likely cause a bottleneck. On the regex, would if/else statements in plain text solve it or just make it much worse.
2. Please PM me. One of the laptops is only a year old it does have a lot of RAM intensive stuff that needs to run though. I ran a test on my 7 year old one and my 2 Cores, 12 threads at 200MHz were all active at 199Hz (I assume the 1MHz was due to undervolting). What's efi/MBR? I only know MBR as being a register on an OS.

Edit: oh is it to do with hard drives (I did a Google search).


Title: Re: Is there a bech32 vanity address generator?
Post by: RGBKey on February 02, 2018, 04:37:00 AM

I have no Windows in my house.  The idea I’d floated is using mingw (http://mingw.org/) to create a Microsoft Windows binary from a non-Windows system.

Before publicly distributing such a thing with my name on it, I would need to work with tester(s) who have Windows systems available.  It’d be good to know if anybody would be interested in doing that (cough).

I use Windows, I could compile/test if needed.

I think your project duffers from one I envisaged myself writing. And as you're using bitcoin core to produce the keys then I'm not sure that's particularly efficient (and most of my computers are extremely slow)!

You misunderstood.  I am not using Bitcoin Core to generate the keys—what?  Through the JSON-RPC interface?  That would be absurdly slow, and quite stupid.  Rather, I am using Core’s “Optimized C library for EC operations on curve secp256k1” (https://github.com/bitcoin-core/secp256k1).  Speed-wise, it runs circles around OpenSSL for ECC key operations.  On the slow test machine, with OpenSSL, I could never get over about 1500 trials per second per CPU core.  With Core’s library, I can get up to around 10000 t/s/c; and the speed of my platform’s regex library seems to become a serious bottleneck.

The original vanitygen runs much slower in regex mode, right? It would be better to first attempt to run in a "prefix mode" like vanitygen if possible that just checks the equality of the first characters, and doesn't evaluate a regular expression.


Title: Re: Is there a bech32 vanity address generator?
Post by: Kakmakr on February 02, 2018, 06:35:22 AM
Is there currently a generator that creates normal Bech32 {SegWit} paper wallets? The http://www.bitaddress.org/ is still creating old legacy Bitcoin addresses. By normal, < I meant to say not Vanity addresses >

If we want to move to SegWit / Bech32, then these tools must be readily available. A lot of people are forced to use dodgy online wallet providers to create these SegWit addresses. <Most of these cannot even be signed by the owner of the coins> 


Title: Re: Is there a bech32 vanity address generator?
Post by: jackg on February 02, 2018, 11:19:36 AM
Is there currently a generator that creates normal Bech32 {SegWit} paper wallets? The http://www.bitaddress.org/ is still creating old legacy Bitcoin addresses. By normal, < I meant to say not Vanity addresses >

If we want to move to SegWit / Bech32, then these tools must be readily available. A lot of people are forced to use dodgy online wallet providers to create these SegWit addresses. <Most of these cannot even be signed by the owner of the coins> 

There is. As you're in with the chipmixer campaign, darkstar posted one (maybe try checking that thread). I'm not sure what it is exactly, you could always PM him also.


Title: Re: Is there a bech32 vanity address generator?
Post by: DarkStar_ on February 02, 2018, 08:58:29 PM
Is there currently a generator that creates normal Bech32 {SegWit} paper wallets? The http://www.bitaddress.org/ is still creating old legacy Bitcoin addresses. By normal, < I meant to say not Vanity addresses >

If we want to move to SegWit / Bech32, then these tools must be readily available. A lot of people are forced to use dodgy online wallet providers to create these SegWit addresses. <Most of these cannot even be signed by the owner of the coins> 

There is. As you're in with the chipmixer campaign, darkstar posted one (maybe try checking that thread). I'm not sure what it is exactly, you could always PM him also.

https://ip.bitcointalk.org/?u=https%3A%2F%2Fi.imgur.com%2FtLxmC1F.png&t=585&c=YiS65iVsF_o-nw

Disclaimer: I have personally never used SegwitAddress.org. Use at own risk, though it's open source and you can audit it.


Title: Re: Is there a bech32 vanity address generator?
Post by: jackg on February 02, 2018, 09:18:46 PM
Is there currently a generator that creates normal Bech32 {SegWit} paper wallets? The http://www.bitaddress.org/ is still creating old legacy Bitcoin addresses. By normal, < I meant to say not Vanity addresses >

If we want to move to SegWit / Bech32, then these tools must be readily available. A lot of people are forced to use dodgy online wallet providers to create these SegWit addresses. <Most of these cannot even be signed by the owner of the coins> 

There is. As you're in with the chipmixer campaign, darkstar posted one (maybe try checking that thread). I'm not sure what it is exactly, you could always PM him also.

https://ip.bitcointalk.org/?u=https%3A%2F%2Fi.imgur.com%2FtLxmC1F.png&t=585&c=YiS65iVsF_o-nw

Disclaimer: I have personally never used SegwitAddress.org. Use at own risk, though it's open source and you can audit it.

Ooh thanks darkstar_ might take a look at their encoder and see if I can learn anything from it to produce an algorithm. Might test them in a few days with a couple btc to see how reliable they are at producing addresses/private keys from their site.


Title: Re: Is there a bech32 vanity address generator?
Post by: RGBKey on February 02, 2018, 11:44:19 PM
I don't think programming a proof-of-concept vanity address generator in C would be that hard, if we use core's library to generate the keys. Optimization could come later, but implementing Bech32 in C would not be that difficult.


Title: Re: Is there a bech32 vanity address generator?
Post by: nullius on February 03, 2018, 12:14:37 AM
Apologies for the slow reply.  Catching up here a bit out of order:

Is there currently a generator that creates normal Bech32 {SegWit} paper wallets? The http://www.bitaddress.org/ is still creating old legacy Bitcoin addresses. By normal, < I meant to say not Vanity addresses >

If we want to move to SegWit / Bech32, then these tools must be readily available. A lot of people are forced to use dodgy online wallet providers to create these SegWit addresses. <Most of these cannot even be signed by the owner of the coins>  

I didn’t mention, my “vanity” generator sort of started as a bulk Segwit address generator which grew a regex loop.  It can rapidly output however many hundreds or thousands of addresses you may desire, “3” nested or Bech32, in a shell script friendly format with each line containing an address and the corresponding private key WIF.  It’s made for piping to something else, for specialized use cases only.  I didn’t mention this, because I strongly encourage users to use only HD wallets (other than for vanity addresses, of course).

See below re easyseed.

There is. As you're in with the chipmixer campaign, darkstar posted one (maybe try checking that thread). I'm not sure what it is exactly, you could always PM him also.

Mine probably does similarly to what I presume ChipMixer’s would do:  Fast bulk generation of pairs of addresses and WIFs.

I don't think programming a proof-of-concept vanity address generator in C would be that hard, if we use core's library to generate the keys. Optimization could come later, but implementing Bech32 in C would not be that difficult.

It’s not hard—at least, up to that point, it isn’t.  Mine started as an afternoon project.  There’s no need to implement Bech32 itself:  I just use sipa’s Bech32 reference code (https://github.com/sipa/bech32/tree/master/ref/c), the same as I used in my bech32 shell utility (https://bitcointalk.org/index.php?topic=2664728.0) (Github (https://github.com/nym-zone/bech32)).



Kakmakr, for safe paper wallet use:  I’ve considered adding BIP 32 derivation to easyseed (https://bitcointalk.org/index.php?topic=2664861.0) (Github (https://github.com/nym-zone/easyseed)).  That would do what you want, in an HD wallet you could back up with a mnemonic phrase in your choice from eight languages.  easyseed’s creation was motivated by my own need for secure, simple code to use on an airgap machine—no saved webpage junk!  Much if not most of its development process has been testing; and in that process, I caught a bug in the BIP 39 French wordlist (https://github.com/bitcoin/bips/pull/622).  But as of now, the most it will give you is a BIP 39 mnemonic phrase and the corresponding BIP 32 master extended private key.

This is solid, working code.  If I were to add BIP 32 derivation so it could generate addresses, would that suit your needs for airgap/paper wallet use?



On the regex, would if/else statements in plain text solve it or just make it much worse.

The original vanitygen runs much slower in regex mode, right? It would be better to first attempt to run in a "prefix mode" like vanitygen if possible that just checks the equality of the first characters, and doesn't evaluate a regular expression.

I could add that; but first, I should work on getting code published.

Also, I think a higher priority is thread support.  Right now, I simply run one instance per CPU core; this is a probabilistic process, so there is no need for synchronization of state.  Threads should be simple here, but may have problems cross-platform—what do you think, RGBKey?


I use Windows, I could compile/test if needed.

Thanks.  I will initially put something Unix-only on Github, then work on making ready for some sort of Windows version.  What is your Windows development environment?  I think I need to try going the mingw route, due to use of POSIX getopt(), POSIX regex, etc.


What's efi/MBR? I only know MBR as being a register on an OS.

Edit: oh is it to do with hard drives (I did a Google search).

It doesn’t have to do with hard drives, so much as with how the computer finds the OS on boot media and hands off control to it (roughly speaking).  My favoured OS (FreeBSD) packages two different sets of install images; and if you use the new-stuff-only one with an older computer, it will behave much as you described.  That’s why I thought of it.  (Side note:  I spoke imprecisely:  It’s really MBR vs. GPT and BIOS vs. EFI; but all these issues are related.  Setting the record straight for other readers/searchers. </offtopic>)


I should probably spend less time on the forum and more time on code.


Edit:  Added a hyperlink to sipa’s reference C code.


Title: Re: Is there a bech32 vanity address generator?
Post by: RGBKey on February 03, 2018, 01:56:26 AM
I use Windows, I could compile/test if needed.

Thanks.  I will initially put something Unix-only on Github, then work on making ready for some sort of Windows version.  What is your Windows development environment?  I think I need to try going the mingw route, due to use of POSIX getopt(), POSIX regex, etc.

My very limited C knowledge involves writing code on a linux VM and compiling with gcc. I can adapt to whatever though. I have the ability to get free licenses for visual studio through work.


Title: Re: Is there a bech32 vanity address generator?
Post by: Coding Enthusiast on February 03, 2018, 04:17:42 AM
I haven't seen one, but if you want I'd try to contribute to one on GitHub or somewhere. I like the idea, even though I know vanity addresses pose some security problems and they're not incorporated into HD backups, I still think it'd be really cool. Maybe here (https://github.com/bitcoin/bips/blob/master/bip-0173.mediawiki) would be a good place to start?

Thanks for the link. What languages would you use as I'd personally prefer either C# or Python (python is quite slow so I'd have to convert it to C# afterwards as that seems quite a bit faster).

Currently reading the data from the link and want to see if I can build any interim stuff from it just as a simple address generator (or some sort of validator).

If you want code to look at and see how it is done then check out sipa's implementation of Bech32 (https://github.com/sipa/bech32/tree/master/ref). It has almost all the programming languages you want.
And here is a C♯ implementation of it in this PR (https://github.com/sipa/bech32/pull/20)


Title: Re: Is there a bech32 vanity address generator?
Post by: nullius on February 03, 2018, 05:55:12 AM
Slightly offtopic question; please followup-to this thread (https://bitcointalk.org/index.php?topic=2664728.0):

If you want code to look at and see how it is done then check out sipa's implementation of Bech32 (https://github.com/sipa/bech32/tree/master/ref). It has almost all the programming languages you want.

Yes, that’s where I got the C code for my bech32 shell utility.  I mentioned sipa’s code above (https://bitcointalk.org/index.php?topic=2864073.msg29490833#msg29490833), but omitted to link it.  (The one time I don’t...)

Do you know if anybody has written a quality C implementation of error correction?  I’ve been intending to port sipa’s Javascript demonstration code for that purpose; but if somebody else already did (or wrote good new code), I don’t wish to duplicate efforts.

This would not be useful for address generators, vanity or otherwise; but it would be very useful for my bech32 shell utility, as well as some other things I have in the pipeline.


Title: Re: Is there a bech32 vanity address generator?
Post by: Kakmakr on February 03, 2018, 06:22:56 AM
Apologies for the slow reply.  Catching up here a bit out of order:

Is there currently a generator that creates normal Bech32 {SegWit} paper wallets? The http://www.bitaddress.org/ is still creating old legacy Bitcoin addresses. By normal, < I meant to say not Vanity addresses >

If we want to move to SegWit / Bech32, then these tools must be readily available. A lot of people are forced to use dodgy online wallet providers to create these SegWit addresses. <Most of these cannot even be signed by the owner of the coins>  

I didn’t mention, my “vanity” generator sort of started as a bulk Segwit address generator which grew a regex loop.  It can rapidly output however many hundreds or thousands of addresses you may desire, “3” nested or Bech32, in a shell script friendly format with each line containing an address and the corresponding private key WIF.  It’s made for piping to something else, for specialized use cases only.  I didn’t mention this, because I strongly encourage users to use only HD wallets (other than for vanity addresses, of course).

See below re easyseed.

There is. As you're in with the chipmixer campaign, darkstar posted one (maybe try checking that thread). I'm not sure what it is exactly, you could always PM him also.

Mine probably does similarly to what I presume ChipMixer’s would do:  Fast bulk generation of pairs of addresses and WIFs.

I don't think programming a proof-of-concept vanity address generator in C would be that hard, if we use core's library to generate the keys. Optimization could come later, but implementing Bech32 in C would not be that difficult.

It’s not hard—at least, up to that point, it isn’t.  Mine started as an afternoon project.  There’s no need to implement Bech32 itself:  I just use sipa’s Bech32 reference code (https://github.com/sipa/bech32/tree/master/ref/c), the same as I used in my bech32 shell utility (https://bitcointalk.org/index.php?topic=2664728.0) (Github (https://github.com/nym-zone/bech32)).



Kakmakr, for safe paper wallet use:  I’ve considered adding BIP 32 derivation to easyseed (https://bitcointalk.org/index.php?topic=2664861.0) (Github (https://github.com/nym-zone/easyseed)).  That would do what you want, in an HD wallet you could back up with a mnemonic phrase in your choice from eight languages.  easyseed’s creation was motivated by my own need for secure, simple code to use on an airgap machine—no saved webpage junk!  Much if not most of its development process has been testing; and in that process, I caught a bug in the BIP 39 French wordlist (https://github.com/bitcoin/bips/pull/622).  But as of now, the most it will give you is a BIP 39 mnemonic phrase and the corresponding BIP 32 master extended private key.

This is solid, working code.  If I were to add BIP 32 derivation so it could generate addresses, would that suit your needs for airgap/paper wallet use?

On the regex, would if/else statements in plain text solve it or just make it much worse.

The original vanitygen runs much slower in regex mode, right? It would be better to first attempt to run in a "prefix mode" like vanitygen if possible that just checks the equality of the first characters, and doesn't evaluate a regular expression.

I could add that; but first, I should work on getting code published.

Also, I think a higher priority is thread support.  Right now, I simply run one instance per CPU core; this is a probabilistic process, so there is no need for synchronization of state.  Threads should be simple here, but may have problems cross-platform—what do you think, RGBKey?


I use Windows, I could compile/test if needed.

Thanks.  I will initially put something Unix-only on Github, then work on making ready for some sort of Windows version.  What is your Windows development environment?  I think I need to try going the mingw route, due to use of POSIX getopt(), POSIX regex, etc.


What's efi/MBR? I only know MBR as being a register on an OS.

Edit: oh is it to do with hard drives (I did a Google search).

It doesn’t have to do with hard drives, so much as with how the computer finds the OS on boot media and hands off control to it (roughly speaking).  My favoured OS (FreeBSD) packages two different sets of install images; and if you use the new-stuff-only one with an older computer, it will behave much as you described.  That’s why I thought of it.  (Side note:  I spoke imprecisely:  It’s really MBR vs. GPT and BIOS vs. EFI; but all these issues are related.  Setting the record straight for other readers/searchers. </offtopic>)


I should probably spend less time on the forum and more time on code.


Edit:  Added a hyperlink to sipa’s reference C code.

Thanks for the comprehensive and detailed answer, but unfortunately this is still not user-friendly enough for the average Bitcoin user out there. Yes, I think it would be nice if this could be done in a nice GUI interface and not in a console or raw code.

The guys who created http://www.bitaddress.org/ did a pretty good job to make it idiot friendly.  ;D

The wallet generator at https://walletgenerator.net/ is even better, because they added a bunch of Alt coins too. <very handy>

Hope you see this from the Users perspective and not the developer <technical> ^smile^



Title: Re: Is there a bech32 vanity address generator?
Post by: Coding Enthusiast on February 03, 2018, 02:08:47 PM
Do you know if anybody has written a quality C implementation of error correction?

Haven't seen any yet.


Title: Re: Is there a bech32 vanity address generator?
Post by: nullius on February 12, 2018, 06:09:56 PM
Please see:  segvan: Segwit vanity address & bulk address generator (https://bitcointalk.org/index.php?topic=2934774.0)

Github: https://github.com/nym-zone/segvan


Title: Re: Is there a bech32 vanity address generator?
Post by: jackg on February 12, 2018, 06:17:00 PM
Please see:  segvan: Segwit vanity address & bulk address generator (https://bitcointalk.org/index.php?topic=2934774.0)

Github: https://github.com/nym-zone/segvan

Aha! You finally managed to perfect and upload it then? I'll test it when I open up a Linux machine. Might also try to convert it to use in Windows (probably by translating the code to one in Windows that'll run fast enough).


Title: Re: Is there a bech32 vanity address generator?
Post by: nullius on February 12, 2018, 06:25:31 PM
Please see:  segvan: Segwit vanity address & bulk address generator (https://bitcointalk.org/index.php?topic=2934774.0)

Github: https://github.com/nym-zone/segvan

Aha! You finally managed to perfect and upload it then? I'll test it when I open up a Linux machine. Might also try to convert it to use in Windows (probably by translating the code to one in Windows that'll run fast enough).

It didn’t take so long to get it onto Github.  Unfortunately, I’ve been spending too much time posting on the forum. <g>

It’s not perfect—far from it.  (Nothing which is missing documentation could be “perfect”!)  But core functionality is solid.  I tried building and running it on Linux before pushing it onto Github.  It should do fine for you there; and even a slow machine can produce addresses such as you now see in my signature, if you leave it crunching away for a few weeks.  I will try to cook up a Windows version.

Please direct follow-ups to the segvan thread (https://bitcointalk.org/index.php?topic=2934774.0).