Bitcoin Forum

Bitcoin => Bitcoin Technical Support => Topic started by: GamerSky on February 05, 2018, 08:22:35 PM



Title: Light program/script to generate addresses and QR code conversion?
Post by: GamerSky on February 05, 2018, 08:22:35 PM
Is there some light program/script that allows to generate bitcoin addresses, as well as converting address/private key to/from QR code (image file), and it'll be awesome if it supports mini private key format as well.
Ideally I'm looking for libraries to use in my project, but if they're stand alone CLI I can still manage to use them.


Title: Re: Light program/script to generate addresses and QR code conversion?
Post by: LoyceV on February 05, 2018, 09:51:50 PM
Is there some light program/script that allows to generate bitcoin addresses, as well as converting address/private key to/from QR code (image file), and it'll be awesome if it supports mini private key format as well.
Ideally I'm looking for libraries to use in my project, but if they're stand alone CLI I can still manage to use them.
A year ago, I've been playing around with miniprivatekey.py, bitcoin-tool and qrencode. I used this to search for mini private keys with vanity addresses.
Combined together, these 3 programs can do most of what you're looking for.

Update: I think I made up the name "miniprivatekey.py", so it's not helping you. I used this script (https://bitcoin.stackexchange.com/questions/36994/math-to-make-a-full-private-key-have-a-mini-private-key-equivalent/36995). The rest of the programs can easily be found.

Note: I haven't used this for anything holding actual funds. I'll leave it up to you to make sure it's secure and random enough.


Title: Re: Light program/script to generate addresses and QR code conversion?
Post by: GamerSky on February 06, 2018, 06:29:25 AM
Is there some light program/script that allows to generate bitcoin addresses, as well as converting address/private key to/from QR code (image file), and it'll be awesome if it supports mini private key format as well.
Ideally I'm looking for libraries to use in my project, but if they're stand alone CLI I can still manage to use them.
A year ago, I've been playing around with miniprivatekey.py, bitcoin-tool and qrencode. I used this to search for mini private keys with vanity addresses.
Combined together, these 3 programs can do most of what you're looking for.

Update: I think I made up the name "miniprivatekey.py", so it's not helping you. I used this script (https://bitcoin.stackexchange.com/questions/36994/math-to-make-a-full-private-key-have-a-mini-private-key-equivalent/36995). The rest of the programs can easily be found.

Note: I haven't used this for anything holding actual funds. I'll leave it up to you to make sure it's secure and random enough.

Thanks for the links, I've seen that python script somewhere else before, but they said it's not secure since Python doesn't use a secure random number generator.
I'll be looking into the bitcoin-tool stuff when I'm back from work, but for the qrencode thing, how are bitcoin address/pubkey/privkey used in them? like do they simply serialize the bytes? no special schema or something? how do qrcode readers deal with them when importing? It'll be awesome if you have some 100 page manual or proper documentation link for it since this is going to be part of a project I'm working on.


Title: Re: Light program/script to generate addresses and QR code conversion?
Post by: LoyceV on February 06, 2018, 07:01:14 AM
~ for the qrencode thing, how are bitcoin address/pubkey/privkey used in them? like do they simply serialize the bytes? no special schema or something? how do qrcode readers deal with them when importing? It'll be awesome if you have some 100 page manual or proper documentation link for it since this is going to be part of a project I'm working on.
QR-codes convert to text, that's it. Unless you need to know how it works exactly internally.
You can adjust the error tolerance, for instance if you want to be able to put a Bitcoin logo in it.
The man page (https://linux.die.net/man/1/qrencode) isn't that long.

From my cheat sheet:
Code:
# Make QR code with 7% error tolerance
qrencode -t png -o file.png -s 10 'private key here'

# Make QR code with 25% error tolerance (preferred option!)
qrencode -t png -o file.png -s 10 -l Q 'private key here'

# Make QR code with 30% error tolerance
qrencode -t png -o file.png -s 10 -l H 'private key here'

Example with 25% error tolerance used for the logo:
http://i66.tinypic.com/2j64e44.png